Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

VideoPlayer: Dropping frames, but frameDropped event not getting called

Discussion in '5.6 Beta' started by StarManta, Feb 7, 2017.

  1. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    I'm having an issue on the device (iPhone 6). The video is very clearly not playing all the frames - it's choppy and stuttering. The timestamp in the UI is advancing smoothly and XCode is reporting a steady 30fps, indicating that the game itself is running at the expected framerate. To me, this clearly indicates that the VideoPlayer component is dropping frames.

    The movie is 720p, 24fps, h.264 encoded, 237 MB total - nothing that should give an iPhone 6+ any trouble. It is being rendered via a RenderTexture on a quad. On another test project, the same video plays smoothly when playing directly to the screen (camera back plane), so I suspect that the RenderTexture has something to do with it.
    UPDATE: I've switched the app to use camera back plane and it has the same issue. Could this choppiness be memory-related?

    This line:
    Code (csharp):
    1. videoPlayer.frameDropped += (source) => { Debug.Log("VideoPlayer: Frame dropped at "+Time.time);}
    2.  
    ... should ensure that frame drops are accompanied by messages in the console, but I have never seen a single frame drop message.

    I've attached screenshots of XCode showing smooth, steady performance... but the video is anything BUT smooth. Screen Shot 2017-02-07 at 1.38.27 PM.png Screen Shot 2017-02-07 at 1.38.45 PM.png
     
    Last edited: Feb 7, 2017
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Hi StarManta,
    Could you please submit a bug report with a minimal reproduction case for this issue and reply in here with the case #?
     
  3. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    260
    Hi StarManta,

    Thanks for your detailed analysis, hopefully we'll identify the performance bottleneck in this scenario (as @LeonhardP mentioned, filing a bug against this is a good way to make sure it stays on our radar).

    One thing I have to mention so you don't waste your time: the frameDropped callback is not yet hooked and is just a provision in the API. We'll make sure to document this.

    Dominique
    A/V developer at Unity