diff options
author | Clément Bœsch <ubitux@gmail.com> | 2012-10-10 00:36:19 +0200 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2012-10-21 17:29:11 +0200 |
commit | de23953de2d827381886c900b02e9ead02ad56a3 (patch) | |
tree | f35f3dda2d54f3f37f91b9289d0af6ef1e7cddd3 /libavfilter | |
parent | 6fb2fd895e858ab93f46e656a322778ee181c307 (diff) | |
download | ffmpeg-de23953de2d827381886c900b02e9ead02ad56a3.tar.gz |
lavfi/select: store scene score in buf ref metadata.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/version.h | 2 | ||||
-rw-r--r-- | libavfilter/vf_select.c | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/libavfilter/version.h b/libavfilter/version.h index eeb78059e7..0ad7372f44 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -30,7 +30,7 @@ #define LIBAVFILTER_VERSION_MAJOR 3 #define LIBAVFILTER_VERSION_MINOR 20 -#define LIBAVFILTER_VERSION_MICRO 100 +#define LIBAVFILTER_VERSION_MICRO 101 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ LIBAVFILTER_VERSION_MINOR, \ diff --git a/libavfilter/vf_select.c b/libavfilter/vf_select.c index 7cb5aae783..341361da51 100644 --- a/libavfilter/vf_select.c +++ b/libavfilter/vf_select.c @@ -241,8 +241,13 @@ 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); + // TODO: document metadata + snprintf(buf, sizeof(buf), "%f", select->var_values[VAR_SCENE]); + av_dict_set(&picref->metadata, "lavfi.scene_score", buf, 0); + } if (isnan(select->var_values[VAR_START_PTS])) select->var_values[VAR_START_PTS] = TS2D(picref->pts); if (isnan(select->var_values[VAR_START_T])) |