How to concatenate two MP4 files using FFmpeg?

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

    based on rogerdpack's and Ed999's responses, I've created my .sh version

    #!/bin/bash
    
    [ -e list.txt ] && rm list.txt
    for f in *.mp4
    do
       echo "file $f" >> list.txt
    done
    
    ffmpeg -f concat -i list.txt -c copy joined-out.mp4 && rm list.txt
    

    it joins all the *.mp4 files in current folder into joined-out.mp4

    tested on mac.

    resulting filesize is exact sum of my 60 tested files. Should not be any loss. Just what I needed

提交回复
热议问题