How to concatenate two MP4 files using FFmpeg?

后端 未结 22 3061
遇见更好的自我
遇见更好的自我 2020-11-22 02:32

I\'m trying to concatenate two mp4 files using ffmpeg. I need this to be an automatic process hence why I chose ffmpeg. I\'m converting the two files into .ts files and th

22条回答
  •  孤街浪徒
    2020-11-22 03:05

    I ended up using mpg as the intermediate format and it worked (NOTE this is a dangerous example, -qscale 0 will re-encode the video...)

    ffmpeg -i 1.mp4 -qscale 0 1.mpg
    ffmpeg -i 2.mp4 -qscale 0 2.mpg
    cat 1.mpg 2.mpg | ffmpeg -f mpeg -i - -qscale 0 -vcodec mpeg4 output.mp4
    

提交回复
热议问题