I recorded myself playing some games and then uploaded the videos to youtube. I noticed that after youtube finished all processing and made multiple resolutions available that the audio and video drift apart over time. As in, it starts out synced but after about an hour there is a noticeable drift. A friend of mine has no issue with the videos on Linux and the A/V is synced when I play the video on my iPad. The A/V is out of sync on every Windows and OSX computer I've tried. On OSX I even tried three different browsers with the same effect.
Things I've tried that didn't seem to make a difference:
- Using OBS and OBS-MP
- Constant frame rate (60fps)
- Variable frame rate
- Transcoding with hand brake before uploading to set a constant frame rate
- Using the "Web Optimized" checkbox in hand brake
- Lots of different recording options like audio sampling rate, etc
- Different browsers
- Disabling hardware accelerated decode: https://productforums.google.com/forum/#!topic/youtube/ZzW5iQfix3w
Interestingly when I play the video back using this player instead of the direct youtube link, I don't see the audio drift: http://youtubeaudiosync.tumblr.com/
And it's not just all youtube videos that are out of sync for me, this recording (not by me) is 1+ hours and it's perfectly in sync for me even if I skip to the end:
Another data point about the video above is that I can install the h264ify extension in Chrome and watching the avc codec version of that video it is still perfectly synced for me. I was starting to think it was as simple as the avc codec not playing correctly on my computer, but now I think the problem is more subtle than that.
Here is the video that I use for testing. It's acting up for me anywhere after an hour. For a really good test, skip to about 4 hours in to see if you have desync too:
As far as I can tell, the source video is "fine" in that some players have no problem with it, but once youtube processes, it has issues playing back on some computers. I've googled a bunch for issues like this, but I'm having a hard time finding a fix. I believe the issue has to do with which codec youtube serves up to the client. The link above that works for me happens to be the VP9 codec whereas my uploads are playing back on windows using the avc1 codec. You can see this by right clicking on the video and checking the "Stats for Nerds".
How can avoid YouTube A/V sync issues in my recordings? Do I have any control here?
Thanks in advance!