0

i have a long video which require to cut 2 seconds of video after each 10 seconds , how can i do that with FFMPEG ? I have tried video filter trim but it didn't cut video automatically after 10 seconds. Using -ss and -to option will require to create video parts and then concat them and it will take lot of time. Is there any Method in FFMPEG to do that. Thanks

  • Does this answer your question? [Every 30 seconds is to cut a video 3s](https://stackoverflow.com/questions/50770731/every-30-seconds-is-to-cut-a-video-3s) – kirogasa Apr 30 '23 at 13:02

1 Answers1

0

try this command:

fmpeg -i VIDEO.mp4 -filter_complex "[0:V]select='if(gte(t,ld(1)+10),st(1,t)*0,if(ld(1),gt(t,ld(1)+2),1))',setpts=N/(24*TB);[0:a]aselect='if(gte(t,ld(1)+10),st(1,t)*0,if(ld(1),gt(t,ld(1)+2),1))',asetpts=N/SR/TB" OUT.mp4
dboy
  • 1,004
  • 2
  • 16
  • 24