Cut multiple parts of a video with ffmpeg Cut multiple parts of a video with ffmpeg python python

Cut multiple parts of a video with ffmpeg


The select filter is better for this.

ffmpeg -i video \       -vf "select='between(t,4,6.5)+between(t,17,26)+between(t,74,91)',            setpts=N/FRAME_RATE/TB" \       -af "aselect='between(t,4,6.5)+between(t,17,26)+between(t,74,91)',            asetpts=N/SR/TB" out.mp4

select and its counterpart filter is applied to the video and audio respectively. Segments selected are times 4 to 6.5 seconds, 17 to 26 seconds and finally 74 to 91 seconds. The timestamps are made continuous with the setpts and its counterpart filter..