Which video format allows concatenation simply by joining files?

cat out1.mp4 ou2.mp4 >out.mp4

These videos are created from images using ffmpeg:

ffmpeg -loop 1 -f image2 -i image.png -s 640x480 -vcodec libx264 -t 30 -y out.mp4

If you can give me a running example it'd be great.

  • what does this have to do with signal processing? – user13107 Aug 7 '13 at 1:27
  • It uses ffmpeg, and to be able to save processing/computational time I'm asking about suitable codecs to be used in ffmpeg. (x264, mjpeg,..) – Dzung Nguyen Aug 7 '13 at 1:39

From FFmpeg FAQ:

A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to concatenate video by merely concatenating the files containing them.

Hence you may concatenate your multimedia files by first transcoding them to these privileged formats, then using cat command (or copy under Windows), and finally transcoding back to your format of choice.

ffmpeg -i input1.avi -qscale:v 1 intermediate1.mpg
ffmpeg -i input2.avi -qscale:v 1 intermediate2.mpg
cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
ffmpeg -i intermediate_all.mpg -qscale:v 2 output.avi
  • If I want to keep image quality, I have to use mpeg with high bitrate which both create big intermediate files and time consuming. Which settings should I choose to save processing time? – Dzung Nguyen Aug 7 '13 at 18:54

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.