[FFmpeg-user] Cut-edits with ffmpeg

James Board jpboard2 at yahoo.com
Thu Jul 25 16:59:44 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.

This sounds exactly like what I've been looking for.

I could not find any documentation for the 'select' filter in
http://www.ffmpeg.org/ffmpeg-all.html.  However it might be
in there, but it's hard to find because if you search for the word
'select' it appears hundreds of times.

Is there documentation for select?  The reason I'm asking
is that your ffmpeg command has a lot of arguments which I
don't understand and I'm not sure if I really need them.  My
input and output file will be AVI, and both will be some raw
format where each frame is stored in full (mpeg encode later).


More information about the ffmpeg-user mailing list