I’m using ffmpeg to convert a video from avi to mp4.
The audio / video in the output mp4 are out of sync. I researched and found the following link, which suggests that this is an issue with newer builds of ffmpeg:
I tried build 18715 as suggested and indeed the a/v is in sync. I thought I’d just use this build, but I then realized that the output file size is much larger (about a third more). Any idea why? Bandwidth is currently a major concern in my application.
I’m trying to either solve the sync problem with the latest build or figure out how to reduce the size of the file with the older build. Any suggestions?
EDIT:
The command I use for the conversion:
ffmpeg -i test.avi -vb 100k -ab 48k -r 20 test.mp4
This is a very low res and quite static video and the low bitrate is adequate (and isn’t a cause for any problem when not using mp4).
try adding
-async 1to your command…From Manual:
-async samples_per_second:Audio sync method. “Stretches/squeezes” the audio stream to match the timestamps, the parameter is the maximum samples per second by which the audio is changed. -async 1 is a special case where only the start of the audio stream is corrected without any later correction.