[FFmpeg-user] Audio advanced when encoding from ProRes to H.264

Michael Connolly michael at emptysea.com
Mon Aug 18 09:40:53 CEST 2014

Hi y'all,

I'm new-ish to encoding with FFMPEG and am hoping you guys can assist on a confusing issue.

I'm transcoding from ProRes with PCM audio to H.264 with AAC audio.  After transcoding, my audio track is advanced (appears earlier in the file) by about 1.5 frames.  This doesn't occur if I trancode from H.264 to H.264 at a different bitrate.  In that case the audio is preserved.    I did try converting from XDCAM -> h.264 as well and encountered the same issue -- the audio is advanced.

It feels like this might have something to do with my source formats being in a Quicktime wrapper, or perhaps that they have linear PCM audio tracks?  

To see my source files, check out this Dropbox location:

It contains a few files:

BloopMaster-ProRes.mov -- my master file with a few "bloops" and tones to confirm audio sync.
Bloop-ProRes-to-H264.mp4 -- a sample conversion via FFMPEG which shows the problem.
Bloop comparison in FCP X.png -- Screenshot from Final Cut Pro X showing how audio is advanced in the converted file.
	     FFMPEG Console Output.txt -- Console output from the run that makes the problem.

The commandline is here:

ffmpeg -loglevel verbose -i "BloopMaster-ProRes.mov" -s 1920x1080 -aspect 16:9 -b:v 3500k -minrate:v 2000k -maxrate:v 5000k -bufsize 7000k -c:v libx264 -preset medium -g 60 -keyint_min 60 -sc_threshold 0 -pass 1 -profile:v high -level 4.0 -pix_fmt yuv420p -an -threads 0 "Bloop-ProRes-to-H264.mp4" && ffmpeg -loglevel verbose -y -i BloopMaster-ProRes.mov -s 1920x1080 -aspect 16:9 -b:v 3500k -minrate:v 2000k -maxrate:v 5000k -bufsize 7000k -c:v libx264 -preset medium -g 60 -keyint_min 60 -sc_threshold 0 -pass 2 -profile:v high -level 4.0 -pix_fmt yuv420p -strict experimental -c:a aac -ac 2 -b:a 128k -threads 0 "Bloop-ProRes-to-H264.mp4"

Thanks so much for any help you might be able to offer!

Michael Connolly
michael at emptysea.com

More information about the ffmpeg-user mailing list