[FFmpeg-user] Cut-edits with ffmpeg

Carl Lindqvist lulebo at gmail.com
Thu Jul 25 13:12:08 CEST 2013


I've just started experimenting using the select filter to do this.
You can use select in combination with between and the "n" parameter
to select a bunch of frames to cut/keep. Right now I use aselect to do
the same thing on the audio. Not sure if it's needed, haven't done
much testing. Here is an example that will encode frames 0-100 and
130-200 to the output:

ffmpeg.exe -i SOURCEFILE.avi -vf
select='-between(n,0,100)-between(n,130,200)',setpts=N/FRAME_RATE/TB
-c:v libx264 -preset veryfast -b:v 700k -profile:v main -af
aselect='-between(n,0,100)-between(n,130,200)',asetpts=N/SR/TB -c:a
libvo_aacenc -b:a 96k -ac 2 OUT.mp4

I'm not yet sure if between 0-100 means that it will keep frame 0 and
100 or if it means 1 to 99, but I think it is 0 to 100.

/Carl


More information about the ffmpeg-user mailing list