Need to:

concatenate 3 mpg4 video clips (each around 1 minute long, and 800x500 size) + background mp3 -> into a 1-minute long (1920x1080) video composed of the first 20 seconds from each of the 4 videos.

So each clip would need to be enlarged (from 800x500 to 1920x1200 to keep aspect ration), and then the height (cropped down to 1920x1080 from the bottom of the video).

Then each video cut down to the first 20 seconds.

Then the 3 videos are concatenated (along with a 1 minute long mp3 file to play in the background of the final video).


  1. Is ffmpeg capable of doing this correctly and how?

1 Answer 1


Sure. Command is

ffmpeg -i 1.mp4 -i 2.mp4 -i 3.mp4 -i bg.mp3
-map "[v]" -map 3:a
-shortest out.mp4

Skip the -shortest if the audio is slightly longer than 1 minute. Alternatively, adjust one of the trim endpoints to make up for the shortfall.

to play in the background of the final video -> I assume final here means the output and not the 3rd video.

  • Is there a benefit of using -i 1.mp4 ... [0]trim=0:20... over -ss 0 -t 20 -i 1.mp4 ...? I would think that trimming within a filter takes more resources than seeking to the video locations on the input level. Code wise, this definitely seems more readable.
    – user3643
    Commented Jul 29, 2019 at 21:44
  • 1
    You will save decoding time if your -ss is inside the file, yes. But ffmpeg can only seek to keyframes so the portion between the returned keyframe and actual ss point as well as the limiting of duration via input -t is carried out by auto-inserting a trim filter at the front.
    – Gyan
    Commented Jul 30, 2019 at 4:54
  • So basically the same, unless your ss point is quite far into the file? Thanks.
    – user3643
    Commented Jul 30, 2019 at 5:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.