How to take multiple inputs with specific trim times to one output, single command ffmpeg I'm trying to make a single ffmpeg command that will take multiple inputs, seek specific times within them, then output to a single file.

For example, I have inputA.avi and inputB.avi and each is 1 hour long. I want a single output file that takes inputA.avi from 00:00:00 to 00:20:00 for the beginning and inputB.avi from 00:00:00 to 00:10:00 for the end. The end result should be a 30 minute video file that has the first 20 minutes of inputA then the first 10 minutes of inputB.

I currently can do the following three commands to get the job done:

ffmpeg -ss 00:00:00 -t 00:20:00 -i inputA.avi [rest of command] inputA-trim.avi
ffmpeg -ss 00:00:00 -t 00:10:00 -i inputB.avi [rest of command] inputB-trim.avi
ffmpeg -f concat -i inputList.txt [rest of command] final.mp4


where inputList.txt contains only

file inputA-trim.avi
file inputB-trim.avi


This works, but has unnecessary steps and creates intermediary files. I also have to create a batch file and txt file to get everything to run in succession. I'd like to be able to create a single ffmpeg command that can take multiple inputs with individual -ss and -t commands, then put them in a single output.
#1 Using concat filter i.e. without textfile

ffmpeg -ss 0 -t 20:00 -i inputA.avi -ss 0 -t 10:00 -i inputB.avi -filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1" out.mp4


--OR--

#2 Using concat demuxer i.e. with textfile

file inputA-trim.avi
inpoint 0
outpoint 20:00
file inputB-trim.avi
inpoint 0
outpoint 10:00


and then your final command

ffmpeg -f concat -i inputList.txt [rest of command] final.mp4




See https://trac.ffmpeg.org/wiki/Concatenate for details.