[FFmpeg-cvslog] avfilter/show_info : add print of color information (range, color_primaries, color_trc, colorspace)
Martin Vignali
git at videolan.org
Wed Oct 24 22:22:51 EEST 2018
ffmpeg | branch: master | Martin Vignali <martin.vignali at gmail.com> | Sat Oct 20 15:54:15 2018 +0200| [66974311b1da2e854aaa6320648e7f0bdbbb84ea] | committer: Martin Vignali
avfilter/show_info : add print of color information (range, color_primaries, color_trc, colorspace)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=66974311b1da2e854aaa6320648e7f0bdbbb84ea
---
libavfilter/vf_showinfo.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
index 689b5399db..37e73b60aa 100644
--- a/libavfilter/vf_showinfo.c
+++ b/libavfilter/vf_showinfo.c
@@ -95,6 +95,39 @@ static void dump_stereo3d(AVFilterContext *ctx, AVFrameSideData *sd)
av_log(ctx, AV_LOG_INFO, " (inverted)");
}
+static void dump_color_property(AVFilterContext *ctx, AVFrame *frame)
+{
+ const char *color_range_str = av_color_range_name(frame->color_range);
+ const char *colorspace_str = av_color_space_name(frame->colorspace);
+ const char *color_primaries_str = av_color_primaries_name(frame->color_primaries);
+ const char *color_trc_str = av_color_transfer_name(frame->color_trc);
+
+ if (!color_range_str || frame->color_range == AVCOL_RANGE_UNSPECIFIED) {
+ av_log(ctx, AV_LOG_INFO, "color_range:unknown");
+ } else {
+ av_log(ctx, AV_LOG_INFO, "color_range:%s", color_range_str);
+ }
+
+ if (!colorspace_str || frame->colorspace == AVCOL_SPC_UNSPECIFIED) {
+ av_log(ctx, AV_LOG_INFO, " color_space:unknown");
+ } else {
+ av_log(ctx, AV_LOG_INFO, " color_space:%s", colorspace_str);
+ }
+
+ if (!color_primaries_str || frame->color_primaries == AVCOL_PRI_UNSPECIFIED) {
+ av_log(ctx, AV_LOG_INFO, " color_primaries:unknown");
+ } else {
+ av_log(ctx, AV_LOG_INFO, " color_primaries:%s", color_primaries_str);
+ }
+
+ if (!color_trc_str || frame->color_trc == AVCOL_TRC_UNSPECIFIED) {
+ av_log(ctx, AV_LOG_INFO, " color_trc:unknown");
+ } else {
+ av_log(ctx, AV_LOG_INFO, " color_trc:%s", color_trc_str);
+ }
+ av_log(ctx, AV_LOG_INFO, "\n");
+}
+
static void update_sample_stats(const uint8_t *src, int len, int64_t *sum, int64_t *sum2)
{
int i;
@@ -200,6 +233,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
av_log(ctx, AV_LOG_INFO, "\n");
}
+ dump_color_property(ctx, frame);
+
return ff_filter_frame(inlink->dst->outputs[0], frame);
}
More information about the ffmpeg-cvslog
mailing list