[FFmpeg-user] Audio "bumps" in concatenated file

Soeren Balko soeren at zfaas.com
Tue Oct 22 02:37:00 CEST 2013


Hi,

I am currently trying to accomplish the following scenario:

(1) Split an input file (say a MOV file) into same size segments, using the
"segment" muxer:

ffmpeg -i input.mov -codec copy -f segment -segment_time <segment length in
seconds> segment%05d.mov

(2) Transcode the individual segments separately into MPEG transport stream
segments using x264 and fdk-aac as video and audio codecs, respectively,
e.g.:

ffmpeg -i segment00001.mov -bsf:v h264_mp4toannexb -f mpegts -acodec
libfdk_aac -b:a 160k -ar 44100 -ac 2 -vcodec libx264 -profile:v baseline
-x264-params level=4:ref=3 -g 90 -s hd1080 -r 29.97 -aspect 16/9 -b:v 5400k
segment00001.ts

(3) And finally, I concatenate the transcoded segments into a single MP4
output file:

ffmpeg -i concat:segment00000.ts|segment00001.ts -codec copy -bsf:a
aac_adtstoasc output.mp4

This all works and the resulting file looks good. However at the "glue
points" of the transcoded segments there are brief "bumps" in the audio. My
take on this is that the individually transcoded segments "fade out" at the
end, causing the aforementioned "bumps".

Naturally, I want a smooth, continuous audio in the concatenated output
file and was wondering what to do about it. I searched the fdk_aac
documentation and couldn't find anything. Also there is no mentioning of
this problem in the FFmpeg documentation with regards to the segment and
concat (de)muxers. So I was for one wondering if this is a known problem
and more importantly, how to work around it.

One idea was to simply let the segments overlap (I couldn't use the segment
muxer for that) and when concatenating the transcoded segments, let the
successive one start before its predecessor has ended. Not sure how complex
this was (suggestions???) with regards to precise timing. At any rate, I
would probably need to splice out the audio and video streams and treat
these separately.

Another idea was a possible "smoothening" run over the concatenated output
file, provided such a feature exists in FFmpeg.

Any suggestions?

Thanks heaps,
Soeren


More information about the ffmpeg-user mailing list