17
$\begingroup$

Given that av sync is on and the correct fps is set, why would the audio track and the video track not be of the same length. When the video file is played in a media player, no such problems occur, but when placed into blender's video editor, the total length of the video is longer than that of the audio. this varies from a short 8 second video with a 1 frame difference to a 2 hour long video with several thousand frames of difference. Also the audio does lag behind the video accordingly, but it takes a minute or so to really notice it desyncronising.

$\endgroup$
4

3 Answers 3

18
$\begingroup$

When you import a video with audio into the sequencer, the following happens:

  1. The video and audio are split into individual tracks, so they become effectively separate entities.

  2. The audio track is imported into the sequencer while respecting the total play-length of the audio, So there is no pitch shift. (Basically, the audio is never sped up or slowed down, it will always sound right)

  3. The video is imported frame-for-frame at the Frame Rate set in Blender's render panel, this means there is no frame interpolation or frame dropping going on.(Basically, the video will always play frame-by-frame, so it will be sped up or slowed down if the source video does not match the Frame Rate setting in Blender)

This has the unpleasant effect that if you import a 10 second video that is 24fps into Blender's 25fps timeline, the audio will last 10 seconds, but the video track (which has 240frames) will be squeezed into 240/25 = 9.6 seconds, hence the mismatch.

So, if all your source videos are the same FPS, then just set the Blender fps to that number, and you should be fine. If you have source videos of different FPS, then you can use the Speed Control strip to adjust the timing of each.

$\endgroup$
3
  • $\begingroup$ OP already has set the framerate accordingly. So this doesn't answer the question. $\endgroup$ Commented Sep 8, 2015 at 13:16
  • 1
    $\begingroup$ @ Mike Pan: Youre Explanation makes sence....before i read this i tried Speed Control to adjust the timing of the video strip leaving the audio untouched, by adding/effect strip/speed control to the video strip, and trying speed up the pictures to the final length of the audio strip, with no luck,like explained by Mikeycal Meyers tutorial: Speed up & Slow Down Audio/Video youtube.com/… the source video is from an android phone using avc1 with a frame rate of 23.283544 acording to vlc player. somebody an $\endgroup$
    – user18181
    Commented Sep 17, 2015 at 14:21
  • $\begingroup$ Please update your answer to address variable frame rate. $\endgroup$ Commented Mar 15, 2016 at 13:36
6
$\begingroup$

Here was the best solution I came across.

He just dragged out the end of the video snip by grabbing it then dragging, he added speed effect by selecting the strip and then going to Add > Effects Strip > Speed Control, then he made sure the box that says "Stretch to input strip length" in checked in the Speed Controls.

By doing this he was able to change the rendering to match the audio file even within a project that had a different FPS

$\endgroup$
1
  • $\begingroup$ when I do this the audio becomes even more out of sync... $\endgroup$
    – Tooniis
    Commented Sep 22, 2017 at 3:40
-1
$\begingroup$

This may be of interest to those who found this thread searching in a "greater context". I had a similar problem using Avidemux – whose purpose explicitly is editing…

A video file "file.mp4" (from youtube) reported in Avidemux to have a video length of 29 min, but an audio length of over 36 min. No "delay" or prefs value would help, as the delay grew towards the video's end. (Real SH.. !)

Here's a way to work around this "bug":

  • Having opened "file.mp4" in Quicktime-player-7 export only its "sound -> WAVE" (file.wav)…
  • next quit Quicktime and open the original "file.mp4" in Avidemux
  • where you add "file.wav" via this menu item:
    • Audio > main track > Audio source (External WAV) > Open "file.wav".
    • (For audio track settings I chose MP2(lav), 160 bps, reducing WAV's size)
  • save the lot in any convenient format.

This procedure takes very little time – far less than my previous trials.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .