[FFmpeg-devel] [PATCH 4/4] lavfi/select: store scene score in buf ref metadata.
Stefano Sabatini
stefasab at gmail.com
Thu Oct 11 11:56:43 CEST 2012
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 ;-).
--
FFmpeg = Funny and Fast Meaningful Practical Ermetic Glue
More information about the ffmpeg-devel
mailing list