]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_select.c
Merge remote-tracking branch 'cus/stable'
[ffmpeg] / libavfilter / vf_select.c
index 7cb5aae783f72e1c74ab27b38fc108da208a6443..341361da51d9e5aea4b582d37ffc3ecc0fecbb14 100644 (file)
@@ -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]))