I want to make a clip from a video with FFmpeg with 2-second video every m
minutes, where
m = video_length / 5
For example I have a video that is 10 minutes long. The video clip will have 10 seconds total length (5 segments by 2 seconds) and will be composed of these video timestamp ranges:
00:00 - 00:02
02:00 - 02:02
04:00 - 04:02
06:00 - 06:02
08:00 - 08:02
This will produce a sort of trailer from the video.
I know I can achieve that with segment but can't figure out the whole process.
You can do this using the select filter, in one go
ffmpeg -i in.mp4
-vf select='lt(mod(t,120),2)',setpts=N/FRAME_RATE/TB
-af aselect='lt(mod(t,120),2)',asetpts=N/SR/TB
out.mp4
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments