Discussion:
[FFmpeg-user] async vs. vsync or together
Bernd Butscheidt
2012-12-11 22:08:23 UTC
Permalink
I am still fooling around with the async option to reencode a ts-stream and split it into separate video and audio files in one step.

But before I asked further questions about this, I want to be sure I understood the concept behind this option.

The man page says:

"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."

So I expect async to change the audio to be in sync with the video stream I leave unchanged, generic example:.

ffmpeg -i input.video -map 0:0 out.h264 -map 0:1,0:0 -async 48000 audio.ac3


This should change the audio (with id 1) to be kept in sync with the video stream (with id 0). If I remux both resulted stream, e.g. with mkvmerge, there should be no further problems expected?


Alternativly, I understood I could leave the audio untouched and let the video to be changed:

ffmpeg -i input.video -vsync -map 0:0,0:1 out.h264 -map 0:1 audio.ac3

Question 1: Am I right so far?

If I am right so far at all, why does a page like this:http://lzone.de/fix+async+video+with+ffmpeg
tells us

"Interestingly Google shows people using -aync and -vsync together. So it might be worth experimenting a bit to achieve the intended result :-)"
suggesting it could be useful to use the two options async and vsync together? Who then would be syncing with whom and which stream would be changed in the favor for the other?

So question 2: Any reason to use vsync and async together?

Kind regards
Bernd B.
Carl Eugen Hoyos
2012-12-11 22:59:34 UTC
Permalink
Post by Bernd Butscheidt
ffmpeg -i input.video -map 0:0 out.h264 -map 0:1,0:0 -async 48000 audio.ac3
I suspect ac3 has no timestamps, h264 has timestamps
but they are not supported well by FFmpeg.

Apart from that: the sync options are used if the input
stream has unusual timestamps to keep A/V sync in the
output stream (async) or to stop FFmpeg from dropping
or duplicating output frames (vsync) - there may be
other uses, but I don't think above command line makes
sense.
Note that especially the async option is less necessary
as it used to be because FFmpeg handles many streams
better than before even without sync options.

Carl Eugen

Loading...