Audio lag in Video Player

Hi guys,
I have a 24 sec video clip of a spectrogram that I've added to a Video Player object which also contains an Audio Source which is used as the sound outlet for the video's sound. So far I've tried the formats .ogv, .m4v, .avi, .mov and .mp4. All of them give me audio lag where the audio in most cases is offset by half a second or so with .ogv being even worse than that. All this is still in the editor, deploying to Android makes it even worse. For each of the formats I've tried both H264 an VP8. I'm using Unity 5.6.1f1. Any ideas?

1 Like

+1


A few things I can recommend that have given the best results out of what I've tried so far:

  • Disable looping in the video player component; it seems to exacerbate the problem.
  • The accepted answer here includes some code, follow this video and add the code as shown.
  • .mp4 seems to work better than other formats

Hope this helps!

Sorry for bumping such an old thread, but after playing around in 2019, Turning off looping and wait for first frame in the video player component has seemed to work just fine for me without any code, just in case someone else comes across this issue in the future as I did

1 Like

Thank you!!