summaryrefslogtreecommitdiff
path: root/libavfilter/vf_blackdetect.c
diff options
context:
space:
mode:
authorBilly Shambrook <billy.shambrook@gmail.com>2014-05-22 21:48:41 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-05-24 03:56:42 +0200
commit308188be3412d743b1ea4c1da65eb832774ced38 (patch)
tree23886297798395c33b3f2523ac483b55eb36be15 /libavfilter/vf_blackdetect.c
parent9722a6a3f35c824d6809a54964900f2490cc82dd (diff)
downloadffmpeg-308188be3412d743b1ea4c1da65eb832774ced38.tar.gz
Add metadata injection to blackdetect
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_blackdetect.c')
-rw-r--r--libavfilter/vf_blackdetect.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavfilter/vf_blackdetect.c b/libavfilter/vf_blackdetect.c
index 90a28a9428..94af61346a 100644
--- a/libavfilter/vf_blackdetect.c
+++ b/libavfilter/vf_blackdetect.c
@@ -134,6 +134,7 @@ static int request_frame(AVFilterLink *outlink)
return ret;
}
+// TODO: document metadata
static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
{
AVFilterContext *ctx = inlink->dst;
@@ -161,12 +162,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
/* black starts here */
blackdetect->black_started = 1;
blackdetect->black_start = picref->pts;
+ av_dict_set(avpriv_frame_get_metadatap(picref), "lavfi.black_start",
+ av_ts2timestr(blackdetect->black_start, &inlink->time_base), 0);
}
} else if (blackdetect->black_started) {
/* black ends here */
blackdetect->black_started = 0;
blackdetect->black_end = picref->pts;
check_black_end(ctx);
+ av_dict_set(avpriv_frame_get_metadatap(picref), "lavfi.black_end",
+ av_ts2timestr(blackdetect->black_end, &inlink->time_base), 0);
}
blackdetect->last_picref_pts = picref->pts;