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

Tracey Jaquith tracey at archive.org
Fri Jan 11 19:32:29 CET 2013


I am the developer of the TV Archive ( http://archive.org/tv )
and have a question regarding A/V "sync" issues.

We are finding that some of our "harder" channels are requiring
"-vsync 0" or "-vsync 1".  The problem with the former is that our resulting .mp4
get A/V slip when progressively downloaded through the flash plugin (only)
but are fine for html5 browsers.   So we want to go with "-vsync 1".
I'd *like* to make the audio frames dropped/duped (hey, I'm a video geek
not an audio geek 8-) so am focusing on this man page portion:

‘-vsync parameter’
...
      With -map you can select from which stream the timestamps should be taken. You can leave either video or audio unchanged and sync the remaining stream(s) to the unchanged one.

Finally my question!  Am I misunderstanding/misusing something below?  I would
think that the number of video and audio frames should change depending on
which input stream is being used as the "sync_file_id:stream_specifier"
(the second part of each "-map" argument, 0:0 or 0:1)

ffmpeg -y -i http://archive.org/~tracey/_/tv-a-change/short.mpg   -vsync 1  -map 0:0,0:0 -map 0:1,0:0   out.ts
ffmpeg -y -i http://archive.org/~tracey/_/tv-a-change/short.mpg   -vsync 1  -map 0:0,0:1 -map 0:1,0:1   out.ts

however, they each show the same number of frames in either result "out.ts", and
same number of dupes/drops in either cmd-line invocation.

Maybe I'm thinking about something wrongly?  Shouldn't the frames adjust differently in the resulting audio/video
depending on which "sync_file_id:stream_specifier" I'm using.

Thanks for any thoughts, ideas, correcting my brain, or otherwise!
-Tracey

(more info, if helpful, below)



(The source file basic characteristics:
Input #0, mpeg, from 'http://archive.org/~tracey/_/tv-a-change/short.mpg':
  Duration: 00:00:12.00, start: 0.360000, bitrate: 6669 kb/s
    Stream #0:0[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
)


From using "0:0"
...
frame=  360 fps= 96 q=31.0 Lsize=    3198kB time=00:00:11.97 bitrate=2187.0kbits/s dup=85 drop=0    
ffprobe -show_frames out.ts 2>&1 | grep _type= |sort|uniq -c
    475 media_type=audio
    660 media_type=video
    330 pict_type=I
    330 pict_type=P


From using "0:1"
...
frame=  360 fps= 76 q=31.0 Lsize=    3198kB time=00:00:11.97 bitrate=2187.0kbits/s dup=85 drop=0    
ffprobe -show_frames out.ts 2>&1 | grep _type= |sort|uniq -c
    475 media_type=audio
    660 media_type=video
    330 pict_type=I
    330 pict_type=P




More information about the ffmpeg-user mailing list