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

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


On Fri, Jan 03, 2014 at 04:52:07PM -0500, Travis Kelley wrote:
> On Fri, Jan 3, 2014 at 4:44 PM, Clément Bœsch <u at pkh.me> wrote:
> > 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.
> 
> Actually it looks like it was walking through the video copying the
> audio only since I hadn't specified a select filter for the audio yet.
>  I ran the same command with -an to null out the audio and got a 10
> second video as I expected.  Now I just need to figure out why I don't
> have the aselect filter.  I suspect its probably due to the older
> version of ffmpeg.
> 
> This line ended up working to produce a 10 second file of just the video
> 
> ffmpeg -i "input.mp4" -vf "select='lt(t,10)'" -an -c:v libx264 -preset
> veryfast -profile:v high -level 4.1 -movflags +faststart -b:v 100k
> /tmp/output.mp4
> 

Why don't you just:
  ffmpeg -ss 10 -i input.mp4 -t 15 -c copy /tmp/output.mp4
?

or if you insist on re-encoding for exact seeking:
  ffmpeg -i input.mp4 -ss 10 -t 15 [your-encode-options] /tmp/output.mp4

?

[...]

-- 
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/de1d0827/attachment.asc>


More information about the ffmpeg-user mailing list