From 72868144e5862168a4f829557b7a41f686b8b12d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <ubitux@gmail.com> Date: Sat, 26 May 2012 12:38:59 +0200 Subject: lavfi/select: add scene detection. Based on the shotdetect algorithm (http://shotdetect.nonutc.fr/ by Johan MATHE johan.mathe tremplin-utc.net). --- doc/filters.texi | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'doc') diff --git a/doc/filters.texi b/doc/filters.texi index 324a1542e8..d9d503f610 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -2603,6 +2603,12 @@ the frame is bottom-field-first @item pos the position in the file of the filtered frame, -1 if the information is not available (e.g. for synthetic video) + +@item scene +value between 0 and 1 to indicate a new scene; a low value reflects a low +probability for the current frame to introduce a new scene, while a higher +value means the current frame is more likely to be one (see the example below) + @end table The default value of the select expression is "1". @@ -2635,6 +2641,15 @@ select='gte(t\,10)*lte(t\,20)*eq(pict_type\,I)' select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)' @end example +Complete example to create a mosaic of the first scenes: + +@example +ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png +@end example + +Comparing @var{scene} against a value between 0.3 and 0.5 is generally a sane +choice. + @section setdar, setsar The @code{setdar} filter sets the Display Aspect Ratio for the filter -- cgit v1.2.3