[FFmpeg-user] confusion with "-vsync 1" / "-vsync cfr" and "-map" (to sync audio to video)

tracey jaquith tracey at archive.org
Sun Jan 13 22:24:15 CET 2013

On Jan 13, 2013, at 1:02 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> tracey jaquith <tracey <at> archive.org> writes:
>> ffmpeg -y -i http://archive.org/~tracey/_/tv-a-change/tv.ts 
>> -vsync 1 -map 0:0,0:1 -map 0:1,0:1 1.ts
> Did you test -async ?
> Please do not top-post here, it is considered rude, 
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

sorry for the top post, that happens to be my email default (didn't mean to be rude).

yes, I tried various -async options.

the "special" version of "-async 1" seemed to do fine, however I was concerned with it saying it will only correct beginning A/V drift at the start of the program (and what if, much less common, the program started dropping a lot of packets mid-way through and started throwing off the A/V packets a bit.  I guess PCR packets should help/fix that issue, but again, I liked the idea better of "-vsync 1" or "-vsync 0" since it looks like it will continually correct/dupe/drop as needed).

"-async [something else]" was me just making up a number -- I couldn't figure out from the online documentation, the source, or from google, what number or range was expected or allowable there (so just  more or less picked 8000 per a google hit).  The output file seemed OK w.r.t. to my original issue (.mp4 playback in flash plugin), but I didn't like the "bad science" of that (not really grok-ing that param) and I didn't run it over my battery of "dirty/tough test videos" to fully vet it.  Is there some place you might suggest I try to learn more about that "-async" param?

I'm inclined to go with the "-vsync 1" and add the longer version of "-map" args, hoping in theory, that they do work and will sync (and dupe/drop/stretch) audio to the video (and not video to the audio), with args something like:
"-map 0:0,0:0 -map 0:1,0:0"   (if the video is the 1st stream in the source file)
"-map 0:0,0:1 -map 0:1,0:1"   (if the video is the 2st stream in the source file)


More information about the ffmpeg-user mailing list