[FFmpeg-user] Cutting part of four files and concatenating

Cecil Westerhof Cecil at decebal.nl
Thu May 26 19:31:58 EEST 2022


I have to cut a part from four files and concatenate them together.
At the moment I am doing that in the following way:
    time ffmpeg -i 00250.MTS -i Pictures/reiger.jpg                                         \
                -ss 00:19 -to 02:41                                                         \
                -filter_complex "[0:v][1:v] overlay=W-w-10:10:enable='between(t, 73, 106)'" \
                -pix_fmt yuv420p -acodec copy -vcodec libx264 -preset veryfast -crf 26      \
        hetOnmogelijkeDoen.mp4
    time ffmpeg -y -i 00264.MTS     \
                -ss 00:08           \
                -to 00:17           \
                -acodec copy        \
                -vcodec libx264     \
                -preset veryfast    \
                audio1.mp4
    time ffmpeg -y -i 00265.MTS     \
                -ss 00:04           \
                -to 00:17           \
                -acodec copy        \
                -vcodec libx264     \
                -preset veryfast    \
                audio2.mp4
    time ffmpeg -y -i 00266.MTS     \
                -ss 00:06           \
                -to 00:15           \
                -acodec copy        \
                -vcodec libx264     \
                -preset veryfast    \
                audio3.mp4
    time ffmpeg -y -i 00267.MTS     \
                -ss 00:08           \
                -to 00:16           \
                -acodec copy        \
                -vcodec libx264     \
                -preset veryfast    \
                audio4.mp4
    time ffmpeg -y -i audio1.mp4 -i audio2.mp4 -i audio3.mp4 -i audio4.mp4  \
                -filter_complex "[0:v][0:a][1:v][1:a][2:v][2:a][3:v][3:a]
                                 concat=n=4:v=1:a=1[v][a]"                  \
                -map "[v]" -map "[a]"                                       \
                -vcodec libx264 -preset veryfast                            \
                mergedAudio.mp4

I was wondering if this is the correct way to do this.
I especially would like to know if it could be done in one swoop. Now
the video is converted two times.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof


More information about the ffmpeg-user mailing list