How to concatenate two MP4 files using FFmpeg?

后端 未结 22 3064
遇见更好的自我
遇见更好的自我 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:07

    Here is a script I made to concatenate several GoPro mp4's into a 720p mp4. Hope it's of help.

    #!/bin/sh
    cmd="( "
    for i; do
        cmd="${cmd}ffmpeg -i $i -ab 256000 -vb 10000000 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -g 100 -f mpeg -; "
    done
    cmd="${cmd} ) | ffmpeg -i - -vb 10000000 -ab 256000 -s 1280x720 -y out-`date +%F-%H%M.%S`.mp4"
    echo "${cmd}"
    eval ${cmd}
    

提交回复
热议问题