[FFmpeg-user] How to skip parts during transcoding? (aka edit decision list)

S. Fisher expandafter at yahoo.com
Thu Jul 18 09:56:02 CEST 2013


On Sat, 13 Jul 2013 22:33:16 +0200
Roberto Ragusa wrote:

> which is the best way to transcode a video and skip some intervals of it?
> (identified by timestamps or frame number)
> 
> Mencoder has some kind of edl (edit decision list) support, how can the
> same result be obtained with ffmpeg?


It can be done using the filters select, aselect, setpts, and asetpts.

Let's say you want to keep only two segments: the one starting at
5 seconds and ending at 20 seconds, and the one between 40 seconds
and 52 seconds.

ffmpeg -i "sample.avi" -vf select='-between(t,5,20)-between(t,40,52)',setpts=N/FRAME_RATE/TB
 -af aselect='-between(t,5,20)-between(t,40,52)',asetpts=N/SR/TB sample.mp4

You'll probably want to use a script to generate the command for you.



More information about the ffmpeg-user mailing list