X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_select.c;h=341361da51d9e5aea4b582d37ffc3ecc0fecbb14;hb=747a00b688d74f3187e9c4dc21fe1b0ce2b63064;hp=7cb5aae783f72e1c74ab27b38fc108da208a6443;hpb=d6f6a7557c8d25bb9943b4d3390550a9cffb918b;p=ffmpeg diff --git a/libavfilter/vf_select.c b/libavfilter/vf_select.c index 7cb5aae783f..341361da51d 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]))