0

Using ffmpeg, I want to cut many segments of a video and merge them into one output video. I am able to do this with the below command, but the video is merged in the order it appears in the source video. I need to merge the video into the order of the cuts as they appear in the command.

(So the first segment that is cut should be the first segment of the new output video. Currently the first segment of the video whatever has the earliest time stamp.)

ffmpeg -i InputTest.mp4 -vf  "select='between(t,1348.43,1348.61)+between(t,976.33,976.49)+between(t,2196.67,2196.99)+between(t,795.95,796.17)+between(t,2385.44,2385.55)+between(t,96.546,96.766)+between(t,2412.64,2412.76)+between(t,546.465,546.815)+between(t,59.26,59.8)+between(t,812.63,813.07)+between(t,2400.23,2400.36)+between(t,813.97,814.29)+between(t,1164.68,1164.88)+between(t,49.17,49.61)+between(t,61.25,61.42)+between(t,1130.3,1130.54)+between(t,1144.85,1145.19)+between(t,666.75,667.34)+between(t,795.18,795.43)', setpts=N/FRAME_RATE/TB" -af "aselect='between(t,1348.43,1348.61)+between(t,976.33,976.49)+between(t,2196.67,2196.99)+between(t,795.95,796.17)+between(t,2385.44,2385.55)+between(t,96.546,96.766)+between(t,2412.64,2412.76)+between(t,546.465,546.815)+between(t,59.26,59.8)+between(t,812.63,813.07)+between(t,2400.23,2400.36)+between(t,813.97,814.29)+between(t,1164.68,1164.88)+between(t,49.17,49.61)+between(t,61.25,61.42)+between(t,1130.3,1130.54)+between(t,1144.85,1145.19)+between(t,666.75,667.34)+between(t,795.18,795.43)', asetpts=N/SR/TB" out.mp4
user3745883
  • 93
  • 1
  • 10

0 Answers0