I have three flv files around 30 Mb each. I joined them together using mencoder on Linux with

mencoder -forceidx -ovc copy -oac pcm -o output.flv input1.flv input2.flv input3.flv

The video codec is H.264 and the audio is MPEG-4 AAC.

The resulting file is 390Mb.

Is there a way to join flv files on Linux without this file size increase?


The reason for the increase is that you are converting the audio to uncompressed PCM: -oac pcm.

Try this instead:

mencoder -forceidx -ovc copy -oac copy -o output.flv input1.flv input2.flv input3.flv
| improve this answer | |
  • I already tried it but got this error: Audio format 0x4134504d is incompatible with '-oac copy', please try '-oac pcm' instead or use '-fafmttag' to override it. – To Do Feb 14 '14 at 17:40
  • Well, the pcm command is the reason it is increasing in size. Have you tried the other alternative it suggested? – Shevek Feb 14 '14 at 17:52
  • I tried adding the option but got an error message: The fafmttag option must be an integer: -o. I got partial succes with -oac mp3lame: the file size went down to 127 Mb, still bigger than the original, though. – To Do Feb 14 '14 at 17:56
  • Try ` -fafmttag 0x706D ` – Shevek Feb 14 '14 at 20:03
  • Tried that. It tells me that -oac copy can only be done when the different files have the same codec. According to the details of the 3 files they do have the same audio codec. – To Do Feb 14 '14 at 21:42

I progressively discovered what the problem was.

using the -oac pcm option was rencoding the audio without compression.

It was not possible to use -oac copy -fafmttag 0x706D due to slight differences in the audio bit rate.

Using -oac mp3lame reduced the file size but a bit rate higher than the original was being used.

Using -oac mp3lame -lameopts vbr=3:br=96 I got a file with a size equivalent to the sum of the three original files. I did not check if the sound quality is the same or not.

| improve this answer | |
  • 1
    That is what my next suggestion would have been ;) – Shevek Feb 19 '14 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.