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

Francois Visagie francois.visagie at gmail.com
Mon Sep 2 10:00:13 CEST 2013

> -----Original Message-----
> From: ffmpeg-user-bounces at ffmpeg.org [mailto:ffmpeg-user-
> bounces at ffmpeg.org] On Behalf Of Frank Tetzel
> Sent: 01 September 2013 14:41
> To: ffmpeg-user at ffmpeg.org
> Subject: [FFmpeg-user] split audio/video and merge later gets async
> Hi,
> i've recorded a video with ffmpeg:
> $ ffmpeg -f x11grab -r 25 -s 798x438 -i :0.0+1,461 -f alsa -ac 1 -ar
> 44100 -i default:CARD=PCH -c:v libx264 -crf 0 -preset ultrafast -c:a flac
> grab.mkv
> Now, i want to process the audio outside of ffmpeg with sox for noise
> reduction and encode it with neroaac. After that i want to merge audio and
> video with ffmpeg again. But the result is always async (progressively
> more).
> Even if i don't process the audio file (except convert to wav). Just
> and merging gets out of sync.
> $ ffmpeg -i grab.mkv -vn -c:a pcm_s16le grab-aud.wav $ ffmpeg -i grab.mkv
> grab-aud.wav -map 0:0 -map 1:0 -c copy merge.mkv
> I guess the problem is the conversion to wav, because if i copy the flac
> stream it works, but can't be processed by neroaac.
> So, does anybody know a way to split audio as wav and merge it back, and
> get it synchronized?

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.

More information about the ffmpeg-user mailing list