I’m new to ffmpeg and trying to wrap my head around the filtergraph. I have a number of clips, and for each one I want to:
- trim the start and end
- fade it to the next one
- don’t re-encode anything except the fade
My best attempt at this (trying to use 1 second long clips for testing):
ffmpeg -i part-1.mp4 -i part-2.mp4
-filter_complex "[0:v]trim=start=227:duration=1[0_middle];
[0:v]trim=start=228:duration=1[0_end];
[1:v]trim=start=30:duration=1[1_start];
[1:v]trim=start=31:duration=1[1_middle];
[0_end][1_start]xfade=transition=fade:duration=1[fade_0_1];
[0_middle][fade_0_1][1_middle]concat=n=3[output]"
-map "[output]"
output.mp4
However this just hangs and eventually says:
More than 1000 frames duplicated
So I have 2 questions — what am I doing wrong? And how do I copy, instead of re-encode, 0_middle
and 1_middle
? If I add -vcodec copy
it tells me filtering and a streamcopy can’t be used together, but I can’t find another way of specifying this.
Nobody is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.