Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Video Audio gets out of sync with video

Discussion in 'Audio & Video' started by Brathnann, Oct 26, 2017.

  1. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,200
    Currently experiencing odd behavior on Android with the Unity Videoplayer.

    I have a video with included audio as an mp4 file. It's in the streamingassets folder right now, so I'm using the URL link version of the VideoPlayer to play it. (these videos will be online in a later build). The video plays correctly without issues if I start the video and let it play through.

    However, if I tap on the pause button, the video will pause but the audio keeps playing for another second before it pauses as well, thus when the video resumes, the audio is out of sync.

    This currently only happens on Android and everything works fine in the editor. Tested in 5.6.1 and 2017.2.

    I'm just using the .Play() and .Pause() on the video.

    Any help would be appreciated.
     
  2. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,200
    Still looking for help on this. I'd like to avoid swapping back to AvPro. AvPro is great, but with the new player, just figured we could include that and keep the build size smaller.
     
  3. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,200
    Upgraded to 2018.1 f2 and still seeing this. Any solutions or reasons it might be happening would be appreciated. Thanks.
     
  4. jnroesch

    jnroesch

    Joined:
    Feb 2, 2018
    Posts:
    6
    we do have the same Problem. It seems that unity does not really care About the Video Player. I think the best solution would be to us the "direct" Option for the Audio Output mode but the documentation says that it is "not yet implemented" and as far as I know Unity did not say when they plan to implement it so no luck there … @Brathnann did you find a Workaround?
     
  5. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,200
    2018.2 seemed to fix the out of sync issue. Audio now pauses when the video pauses. We tried a bunch of stuff, but could not find a workaround for previous versions unfortunately.
     
  6. FilipeGarcia

    FilipeGarcia

    Joined:
    Jun 3, 2020
    Posts:
    2
    Hi, sorry to bother you guys, I followed the tutorial bellow. I did everything in it and the video plays well, but there is 1 second second video delay in relation to its audio. My game is based on videos, so I don't know what to do I'm getting frustrated..

    My videos were rendered using Premiere, they are in H264, 1080p, 12fps, and the quality is 5. I tried almost everything, I try rendering them in lower quality, but the video delay is always there and has always the same delay (first the sound, then the correspondent video frames). when I put the video in double speed it seem to be synced...



    What should I do? Thanks :)