[FFmpeg-user] whats wrong with select between filter syntax

Clément Bœsch u at pkh.me
Fri Jan 3 22:44:47 CET 2014

On Fri, Jan 03, 2014 at 04:37:49PM -0500, Travis Kelley wrote:
> I tried the gt/lt combination you suggested and it seems to work for the
> greater than clause.  In other words it doesn't stop encoding when it hits
> the less than time.  I tried reversing the gt/lt in the expression, but
> that didn't seem to matter either.  Either way I specify, I see ffmpeg run
> though the first few seconds of video very quickly until it hits the gt
> time, then it seems to continue encoding forever.

It's probably because it's decoding the whole video: ffmpeg doesn't have
visibility on what the filters actually do, and here the filter will just
drop some frames, but ffmpeg will nevertheless feed it with the whole
stream. You likely want to simply use -ss and -t (or -to in recent
versions), or eventually the segmenter¹.

Also, in your case, if you don't want very accurate cut, you can probably
just remux and thus make the extraction lossless.

> #  ffmpeg -i "input.mp4" -vf "select='gt(t,30)*lt(t,60)'" -c:v libx264
> -preset veryfast -profile:v high -level 4.1 -movflags +faststart -b:v 100k
> -ar 44100 -ac 2 -ab 96k /tmp/output.mp4
> ffmpeg -i "input.mp4" -vf "select='lt(t,30)*gt(t,20)'" -c:v libx264 -preset
> veryfast -profile:v high -level 4.1 -movflags +faststart -b:v 100k -ar
> 44100 -ac 2 -ab 96k /tmp/output.mp4
> As for the verison...gentoo only has 1.0.8 in its package repository marked
> stable.  1.2.4 is the newest version with built gentoo packages, but its
> marked as unstable.  I might look into building a newer version directly
> from source for my needs.

1.2.4 is also very old.

> Thanks Clément!

PS: please do not top post, it's considered rude.

[1]: http://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-ssegment

Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20140103/65df1d3a/attachment.asc>

More information about the ffmpeg-user mailing list