[FFmpeg-user] split audio/video and merge later gets async

Francois Visagie francois.visagie at gmail.com
Mon Sep 2 13:44:52 CEST 2013

> -----Original Message-----
> From: ffmpeg-user-bounces at ffmpeg.org [mailto:ffmpeg-user-
> bounces at ffmpeg.org] On Behalf Of Frank Tetzel
> Sent: 02 September 2013 11:25
> To: ffmpeg-user at ffmpeg.org
> Subject: Re: [FFmpeg-user] split audio/video and merge later gets async
> > First see if specifying [,sync_file_id[:stream_specifier]] with the
> > '-map' options helps:
> > http://www.ffmpeg.org/ffmpeg-all.html#Advanced-options. Try both the
> > original audio and video stream for the sync stream and see which
> > works best.
> Thanks for the quick reply.
> I tried both:
> $ ffmpeg -i grab.mkv -i grab-aud.wav -map 0:0 -map 1:0,0:1 -c copy
> merge.mkv $ ffmpeg -i grab.mkv -i grab-aud.wav -map 0:0 -map 1:0,0:0 -c
> copy merge.mkv
> but it didn't help. It's still async. I didn't notice any difference.
> I just noticed now that the splitted audio is about 4 seconds shorter than
> video stream. Not sure how that happened. The recorded file grab.mkv is
> completely fine and directly compressing it with libx264 and libfdk-aac is
> fine.
> I probably have to resample the audio and stretch it. But i'm not sure
> the right way to do it. This one didn't work:
> $ ffmpeg -i grab.mkv -i grab-aud.wav -map 0:0 -map 1:0,0:1 -af
> 'aresample=async=10' -c:v copy -c:a pcm_s16le merge.mkv

In that case remuxing with an audio delay is likely to turn out the only
workable solution as Carl Eugen mentions, but for future reference you'll
get best results from specifying the same sync stream for _all_ mappings,

$ ffmpeg -i grab.mkv -i grab-aud.wav -map 0:0,0:0 -map 1:0,0:0 -c copy

More information about the ffmpeg-user mailing list