Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Video player drops frames and corrupts audio

Discussion in 'Audio & Video' started by DevDunk, Nov 5, 2023.

  1. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,138
    I'm rendering a 1080x1620 video. I can do this both using material override or render texture.
    When viewing this in the editor it all is smooth.
    When I preview it in an Android build the video drops a ton of frames (range of 10-40 frames per second with 60 fps video).
    The audio is also completely messed up. When disabling skip frame in video player I get `AudioSampleProvider buffer overflow. 74 sample frames discarded.` The discarded samples can be hundreds of samples as well.

    I already tried to change the audio settings video proj settings and via code

    Code (CSharp):
    1.  
    2. AudioConfiguration config = AudioSettings.GetConfiguration();
    3. config.sampleRate = 48000;
    4. config.dspBufferSize = 256;
    5. AudioSettings.Reset(config);
    Using unity 2022.3.12 URP
    Tested on multiple Android devices

    I load the videos using an imported video clip, not URL.
    I need transparency, so I tried VP8. I also tried h265 and h264, all with the same results

    Any help is appreciated, as I am running out of options.
    This is for an ongoing hackathon, so I cannot spend the money for AVPro sadly (and the whole system is already built on the video player)
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,138
    Apparently 6o fps video is not supported on android?
    30 fps does work properly.
    Once the bug reporter is back online there will be some reports...
     
    ebelkin likes this.