How to merge videos by avconv?

前端 未结 10 2200
逝去的感伤
逝去的感伤 2021-01-30 17:12

I have several chunks in folder.

0001.mp4
0002.mp4
0003.mp4
...
0112.mp4

I would like to merge them into full.mp4

I tried to use:

10条回答
  •  一生所求
    2021-01-30 17:44

    For mp4 the only working solution I found was with MP4Box from gpac package

    #!/bin/bash
    filesList=""
    for file in $(ls *.mp4|sort -n);do
        filesList="$filesList -cat $file"
    done
    MP4Box $filesList -new merged_files_$(date +%Y%m%d_%H%M%S).mp4
    

    or command is

    MP4Box -cat file1.mp4 -cat file2.mp4 -new mergedFile.mp4
    

    with mencoder and avconv I could'nt make it work :-(

提交回复
热议问题