[FFmpeg-user] Cut-edits with ffmpeg

Tom Evans tevans.uk at googlemail.com
Thu Jul 25 17:50:29 CEST 2013


On Thu, Jul 25, 2013 at 4:26 PM, James Board <jpboard2 at yahoo.com> wrote:
>> 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 tried this, and it didn't work.  It complained about a missing ')' or too many
> args in 'between(n'
>     ffmpeg -i IN.avi -vf select = 'between(n,32,42)' OUT.avi
>

Filters are tricky. You need to pass a single argument to '-vf'. From
your command line, it looks like you are passing the argument
"select", there should not be spaces between "select", "=" and the
filter.

Secondly, filters are graphs - a connected chain of inputs and
outputs. You chain two filters together with a comma, and therefore,
in filter specs, commas that do not chain two filters together must be
escaped or quoted.

Finally, this is all describing what ffmpeg needs to see it. If your
shell needs extra quoting, then you need to add that in as well.

So, for your example, either of these will work:

  ffmpeg -i IN -vf select='between(n\,32\,42)' OUT

or

  ffmpeg -i IN -vf "select='between(n,32,42)'" OUT

Read this section on filtering:

http://trac.ffmpeg.org/wiki/FilteringGuide

Cheers

Tom


More information about the ffmpeg-user mailing list