Audio/Video out of sync in rendered video, but not in VSE

Guys. First time i have such problem in VSE and never before had this .I am using VSE very often for more than one year.

Audio/Video out of sync in rendered video, but not in VSE. There was same thread here few years ago (http://blender.stackexchange.com/questions/31471/audio-video-out-of-sync-in-rendered-video-but-not-in-vse)

…but after reading it i dont understand what those developers or programmers are talking about and i dont see the solution there.

I will tell you what i did. I am making tutorial so i made a screen capture. Also i made a few photos.

I went to the Blender and started to edit all of that and cut it many times, i was adding many speed control effects (to match up with the length of audio). So the video is overall 16 minutes long. Then i enabled Video Audio sync option. And i started to render it in loseless format, 25 fps. Everything is perfect in VSE editor window but its out of sync in render window. For example in render window frame 2100 is the same that in VSE frame 3900. And i see same frame twice in render - first time i see this frame at frame 2100 and second time same frame in render window i see at frame 3500 or 3900(dont remember exactly but if its important will render it again and tell you). But if i go to VSE there is no repetition like that and everything is in sync.

Is there simple solution to that or in order to sort it i have to make same difficult math and use logic and calculate all of the videos fps and to know how codecs are working, how compression is happening…exetra exetra

Thanks

By the way my screen captured videos have same fps that in Blender render settings - 25. If its helps

you must edit with AV sync turned on. Otherwise Blender may not show you the correct frames when you slice and apply speed effects. Also I would suggest making a proxy with timecode to make sure Blender is addressing the right frames. Finally I captured a screen recording that lasted 6 hours and there was significant frame dropping resulting in a loss of audio sync over time.

Sorry but i dont understand what do you mean by saying “Blender addressing the right frames” (so if i dont understand this i cannot fix it by using proxies, which are just reducing quality of the preview to see it with fast fps, and not solving the problem). I assume that “adressing” means that Blender doesnt show right frames in VSE? But in the VSE preview everything is ok. Also i dont think that frame dropping is exist in my case because when i play my video outside of Blender by using lets say MPC HC player i dont see any frame dropping.

Wow!!! I cant believe that i fixed it myself without too much knowledge about fps. Thats very good because i thought that i will have to start my editing from scratch again.

So for those who will face this problem of video not syncing in VSE and render window here is the tip, so what i did:

1 - Download programm called Handbrake. Then go to your Blender output folder (where you saved all of your videos that you used for editing). Import those videos one by one into handbrake and use youtube preset settings (that are recommended in this tutorial https://www.youtube.com/watch?v=rHJ2W0Ofb44). I think the most important thing in those settings is constant frame rate ticked + constant quality and maybe deinterlacing (but dont know for sure because i am not expert in this at all). Once imported press start button to convert your videos, choose same output directory where your Blender videos are and rename it the same way that your videos in Blender output directory are having. (But the format that chosen in Handbrake is MP4 so if your Blender videos have different format it will not be replaced automatically in the output folder so we will fix it in Blender)

2 - So we have now same name for our videos but not same format (unless you had MP4 strips initially). So to make Blender regognize and find our strips again we have to select each strip one by one and go to Strip-Change-Path files and select MP4 file with same name that your strip has and press Change DATA-FILES in the right top corner. Before this (just in case) make sure that AV-sync option is still enabled. After i did those steps i went to render tab and rendered it (file format H264, format AVI, CODEC H264, and lossless output). BINGO!

So i think the problem in my case was in settings that i used for CAMstudio (screen recording software that i am using) They were set so that i have very small file size for output so Blender probably didnt like those settings so i used Handbrake to convert same videos to the format and with settings that Blender likes more and then just replaced old videos with the new:) And good thing (i didnt expect that) that even after replacing videos with new format and settings Blender still remembers where the cuts where made and all editing information so we dont have to tweak anything else

2 Likes

Excellent that you found and fixed this – and then explained it in such great detail.

I have found, in my “noodlings around with this,” that compression can also be a very-big bugaboo. If your video is aiming for “a small file size,” the video is heavily compressed. And, I think, is where syncing problems come from, and yes, they do get progressively worse as the audio “slips” against the video.

I’ve also noticed that if the audio is compressed also, it’s even worse. (I wonder, if you took a “compressed audio file” and actually measured its duration against the original, would it or would it not take ‘exactly(!) the same amount of time?’ Ditto video, for that matter …)

I’ve seen this behavior in several video-editing suites, even very expensive ones, so, “it’s not just Blender VSE.”

The problem with audio is that it is created based on samples per second not frames per second. Go to the User preferences and see the audio sample rate. You should try to match the project rate to the source media. Domestic cameras and recordings tend to be 41Khz while pro gear records at 48Khz.

Thanks for posting your solution in such detail - it’s now sitting in my Blender Help-file library!

Thank you so much! It´s been a while since you wrote this, but you’ve just save me from a lot of trouble.