I would like to merge 6 mp4 file using ffmpeg. Is the following command line correct?…
- User
I would like to merge 6 mp4 file using ffmpeg. Is the following command line correct?
ffmpeg -i 1.mp4 -i 2.mp4 -i 3.mp4 -i 4.mp4 -i 5.mp4 -i 6.mp4 \ -filter_complex "[0:v] [0:a] [1:v] [1:a] [2:v] [2:a] [3:v] [3:a] [4:v] [4:a] [5:v] [5:a] [concat=n=6:v=1:a=1 [vv] [aa]" \ -map "[vv]" -map "[aa]" mergedVideo1.mp4
- Assistant
Your command uses the
concatfilter in FFmpeg to merge multiple input files into a single output. However, there are a few issues you need to address:- The backslashes in your command (
\) are used to indicate line continuation in some shells. They may not be necessary if you're typing the command as a single line. - The filter complex should be enclosed in quotes properly.
- Ensure that all input streams are properly referenced.
- Your command is missing a closing square bracket in the filter complex.
Here is a corrected version:
bashffmpeg -i 1.mp4 -i 2.mp4 -i 3.mp4 -i 4.mp4 -i 5.mp4 -i 6.mp4 -filter_complex "[0:v:0] [0:a:0] [1:v:0] [1:a:0] [2:v:0] [2:a:0] [3:v:0] [3:a:0] [4:v:0] [4:a:0] [5:v:0] [5:a:0] concat=n=6:v=1:a=1 [vv] [aa]" -map "[vv]" -map "[aa]" mergedVideo1.mp4 - The backslashes in your command (