How to concatenate two MP4 files using FFmpeg?

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

    I was trying to concatenate three .mp3 audio files into one .m4a file and this ffmpeg command works.

    Input command:

    ffmpeg -i input1.mp3 -i input2.mp3 -i input3.mp3 \
           -filter_complex "concat=n=3:v=0:a=1" -f MOV -vn -y input.m4a
    

    Meanings of : -filter_complex "concat=n=3:v=0:a=1" :

    concat means use the media concatenate (joining) function.
    n means confirm total count of input files.
    v means has video? use 0 = no video, 1 = contains video.
    a means has audio? use 0 = no audio, 1 = contain audio.
    -f means force set file format (to see all supported formats, use ffmpeg -formats)
    -vn means disable video (and also -an would disable audio if not wanted)
    -y means overwrite output files (if the output file already exists).

    For more info: use ffmpeg -h full print all options (including all format and codec specific options, very long)

提交回复
热议问题