Score:0

Concatenate multiple trimmed videos FFmpeg

cg flag

I am a rooky in FFmpeg and I am trying to concatenate multiple videos that must be trimmed into a new video, the command that I am trying to use is:

ffmpeg -i 00042.mp4 -ss 00:00:02 -to 00:00:03 -i 00040.mp4 -ss 00:00:01 -to 00:00:02 -filter_complex concat=n=2:v=1:a=1 output.mp4

The code works fine, but is concatenating and addit to "output.mp4" only for the last video inputted.

Do you have any suggetion?

Score:2
cn flag

That last -to is trimming the output file.

Options for each input file must be before each -i, so change:

ffmpeg -i 00042.mp4 -ss 00:00:02 -to 00:00:03 -i 00040.mp4 -ss 00:00:01 -to 00:00:02 -filter_complex concat=n=2:v=1:a=1 output.mp4

to:

ffmpeg -ss 00:00:02 -to 00:00:03 -i 00042.mp4 -ss 00:00:01 -to 00:00:02 -i 00040.mp4  -filter_complex concat=n=2:v=1:a=1 output.mp4
ilie alexandru avatar
cg flag
Thank you so much!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.