5

To save time, I want to segment and transcode a large video file on multiple computers.

I use ffmpeg to transcode the segments of the large video file with:

ffmpeg -i large_movie.mp4 -ss 00:00:00 -t 00:01:00 -acodec libfaac seg0.flv
ffmpeg -i large_movie.mp4 -ss 00:01:00 -t 00:01:00 -acodec libfaac seg1.flv
...

And concatenate the segments with:

 ffmpeg -i concat.conf -vcodec copy -acodec copy result.flv

The content of the concat.conf:

ffsconcat version 1.0
file seg0.flv
file seg1.flv
...

Now we get a result FLV file result.flv content all the segments. But when I play this file, I found the segment boundary audio may be momentarily interrupted ! I'm sure those segments is closely associated, and the timestamp is right.

When I decode the AAC sample in segment file to a wave format, and open the wave with CoolEdit, I found at the front and the end of the file, the value of audio sample is very small (mute?) ! At the front of the file, there is about 21ms 'mute' sample. And at the end of the file, there is about 3ms 'mute' sample.

Is the mute samples result the momentarily interrupt ? How to concatenate media file containing AAC smoothly ?


After further testing, I found if you split a wave file to small wave files, then encode this small wave files to small aac file use faac:

faac -P -R 48000 -B 16 -C 2 -X -o 1.aac 1.wav
faac -P -R 48000 -B 16 -C 2 -X -o 2.aac 2.wav
faac -P -R 48000 -B 16 -C 2 -X -o 3.aac 3.wav
faac -P -R 48000 -B 16 -C 2 -X -o 4.aac 4.wav
faac -P -R 48000 -B 16 -C 2 -X -o 5.aac 5.wav

The console output like this:

[hugeice@fedora19 trans]$ faac -P -R 48000 -B 16 -C 2 -X -o 5.aac 5.wav
Freeware Advanced Audio Coder
FAAC 1.28

Quantization quality: 100
Bandwidth: 16000 Hz
Object type: Low Complexity(MPEG-2) + M/S
Container format: Transport Stream (ADTS)
Encoding 5.wav to 5.aac
   frame          | bitrate | elapsed/estim | play/CPU | ETA

And concatenate this small aac files to a big aac files use:

cat 1.aac 2.aac 3.aac 4.aac 5.aac > big.aac

Now, if you play the big.aac, there is a momeniary interrupt at the segment boundary!

The question becomes how segment coding and concatenate aac files smoothly ?

James Deng
  • 51
  • 1
  • 4
  • I found split wave file to segment wave file, and encode it to aac use faac, and concatenate this segment aac file to a big aac file, there is a momeniary interrupt at he segment boundary. So this issue has nothing to do with ffmpeg. The question becomes how segment coding and concatenate aac files smoothly ? – James Deng Aug 15 '13 at 07:32
  • May be the same trick as here would work - http://stackoverflow.com/questions/7333232/concatenate-two-mp4-files-using-ffmpeg – Dmitry May 14 '14 at 22:40
  • If your files were at some point encoded as mp3, your gaps might be due to the mp3 format requiring a certain file size and automatically adding padding (silence) at the end of it – David Schumann Mar 21 '18 at 20:07

0 Answers0