[FFmpeg-devel] [PATCH 4/4] lavfi/select: store scene score in buf ref metadata.

Clément Bœsch ubitux at gmail.com
Thu Oct 11 22:20:27 CEST 2012


On Thu, Oct 11, 2012 at 11:56:43AM +0200, Stefano Sabatini wrote:
> On date Wednesday 2012-10-10 00:55:13 +0200, Clément Bœsch encoded:
> > ---
> >  libavfilter/vf_select.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavfilter/vf_select.c b/libavfilter/vf_select.c
> > index c68618f..bb10273 100644
> > --- a/libavfilter/vf_select.c
> > +++ b/libavfilter/vf_select.c
> > @@ -238,8 +238,12 @@ static int select_frame(AVFilterContext *ctx, AVFilterBufferRef *picref)
> >      AVFilterLink *inlink = ctx->inputs[0];
> >      double res;
> >  
> > -    if (CONFIG_AVCODEC && select->do_scene_detect)
> 
> > +    if (CONFIG_AVCODEC && select->do_scene_detect) {
> > +        char buf[32];
> >          select->var_values[VAR_SCENE] = get_scene_score(ctx, picref);
> > +        snprintf(buf, sizeof(buf), "%f", select->var_values[VAR_SCENE]);
> > +        av_dict_set(&picref->metadata, "lavfi.scene_score", buf, 0);
> > +    }
> 
> Missing docs, LGTM otherwise. And now you have no excuses to split
> this into a separate filter ;-).

Same as previous patch for the doc.

About the split, it's unfortunate but until vf select (or any other
filter) implements a generic way to honor any arbitrary metadata, I can't.

If anyone is willing to help for this, it would be welcome :)

-- 
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/20121011/899edb56/attachment.asc>


More information about the ffmpeg-devel mailing list