[FFmpeg-devel] [PATCH] lavfi: add blackdetect filter

Clément Bœsch ubitux at gmail.com
Sat Mar 3 15:29:18 CET 2012


On Sat, Mar 03, 2012 at 02:22:47PM +0100, Stefano Sabatini wrote:
> On date Saturday 2012-03-03 00:54:40 +0100, Clément Bœsch encoded:
> > On Fri, Mar 02, 2012 at 04:46:20PM +0100, Stefano Sabatini wrote:
> > > Address trac ticket #901.
> > > ---
> > >  doc/filters.texi             |   50 ++++++++++
> > >  libavfilter/Makefile         |    1 +
> > >  libavfilter/allfilters.c     |    1 +
> > >  libavfilter/vf_blackdetect.c |  209 ++++++++++++++++++++++++++++++++++++++++++
> > >  4 files changed, 261 insertions(+), 0 deletions(-)
> > >  create mode 100644 libavfilter/vf_blackdetect.c
> > > 
> > > diff --git a/doc/filters.texi b/doc/filters.texi
> > > index 238401a..b5e8954 100644
> > > --- a/doc/filters.texi
> > > +++ b/doc/filters.texi
> > > @@ -761,6 +761,56 @@ video, use the command:
> > >  ass=sub.ass
> > >  @end example
> > >  
> > > + at section blackdetect
> > > +
> > 
> > Global comment: couldn't we have a "unified color" detector instead? So we
> > could detect bright frames for instance, or full green ones.
> 
> This filter is optimized for working on the luma plane.
> 
> I could easily factorize the code and create a dual whitedetect
> filter, do you think that would be useful? (Alternatively the user can
> still invert the video with negate).
> 

Useful I don't know, it was just a suggestion :)

[...]

> From 7b683bb6c6f626d8447eae893d578be9471c3abe Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefasab at gmail.com>
> Date: Fri, 2 Mar 2012 15:51:26 +0100
> Subject: [PATCH] lavfi: add blackdetect filter
> 
> Address trac ticket #901.
> ---
>  doc/filters.texi             |   54 +++++++++++
>  libavfilter/Makefile         |    1 +
>  libavfilter/allfilters.c     |    1 +
>  libavfilter/vf_blackdetect.c |  209 ++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 265 insertions(+), 0 deletions(-)
>  create mode 100644 libavfilter/vf_blackdetect.c
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 238401a..7e5f2f4 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -761,6 +761,60 @@ video, use the command:
>  ass=sub.ass
>  @end example
>  
> + at section blackdetect
> +
> +Detect black video intervals that are (almost) completely black. Can
> +be useful to detect chapter transitions or commercials. Output lines

I guess it can also be useful to detect invalid recordings.

Rest of the patch LGTM.

[...]

-- 
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-devel/attachments/20120303/93ebab5c/attachment.asc>


More information about the ffmpeg-devel mailing list