How to concatenate multiple videos with ffmpeg? 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).

Questions:


Is ffmpeg capable of doing this correctly and how?
Sure. Command is

ffmpeg -i 1.mp4 -i 2.mp4 -i 3.mp4 -i bg.mp3
-filter_complex
"[0]trim=0:20,scale=1920:-1,crop=1920:1080:0:0[a];
 [1]trim=0:20,scale=1920:-1,crop=1920:1080:0:0[b];
 [2]trim=0:20,scale=1920:-1,crop=1920:1080:0:0[c];
 [a][b][c]concat=3[v]"
-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.