[FFmpeg-user] select scene and skip 2 seconds?

Clément Bœsch u at pkh.me
Mon Jan 5 12:33:55 CET 2015

On Mon, Jan 05, 2015 at 12:12:47PM +0100, Robert Nagy wrote:
> I want to generate some thumbnails for a video library.
> Currently I'm using:
> -frames:v 1 -filter:v "select=gt(scene\,0.5)" thumb.png
> Which almost works. The problem is that I'd like the thumbnail to be taken
> 2 seconds after the scene change have been detected.
> Is there a way to achieve that?

With two steps, and a bit ugly, but you can do something like this:

  eval $(ffprobe -v error -select_streams v:0 -show_entries frame=best_effort_timestamp_time -of flat=s=_ -f lavfi "movie=in.mov,scale=640:-1,select='gt(scene,0.5)',trim=end_frame=1")

And then something like:
  ffmpeg -i in.mov -ss $[$frames_frame_0_best_effort_timestamp_time+2] -frames:v 1 thumb.png

(note: this last command will only work with a shell that supports float

Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20150105/cae1d6a1/attachment.asc>

More information about the ffmpeg-user mailing list