diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-03-23 12:21:09 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-05-12 09:37:47 +0200 |
commit | b84a2b91fdfc5c90a8f0afc97d87b02af0b0854e (patch) | |
tree | ae5ff7c4bdda4847bcb808091fbfed11d121896e | |
parent | 991d41769290bcb01894fe35677d43ee06f1d00b (diff) | |
download | ffmpeg-b84a2b91fdfc5c90a8f0afc97d87b02af0b0854e.tar.gz |
vf_showinfo: support AV_FRAME_DATA_VIDEO_ENC_PARAMS
-rw-r--r-- | libavfilter/vf_showinfo.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c index b0b0051357..5d4aee4169 100644 --- a/libavfilter/vf_showinfo.c +++ b/libavfilter/vf_showinfo.c @@ -36,6 +36,7 @@ #include "libavutil/timestamp.h" #include "libavutil/timecode.h" #include "libavutil/mastering_display_metadata.h" +#include "libavutil/video_enc_params.h" #include "avfilter.h" #include "internal.h" @@ -170,6 +171,25 @@ static void dump_content_light_metadata(AVFilterContext *ctx, AVFrameSideData *s metadata->MaxCLL, metadata->MaxFALL); } +static void dump_video_enc_params(AVFilterContext *ctx, AVFrameSideData *sd) +{ + AVVideoEncParams *par = (AVVideoEncParams*)sd->data; + int plane, acdc; + + av_log(ctx, AV_LOG_INFO, "video encoding parameters: type %d; ", par->type); + if (par->qp) + av_log(ctx, AV_LOG_INFO, "qp=%d; ", par->qp); + for (plane = 0; plane < FF_ARRAY_ELEMS(par->delta_qp); plane++) + for (acdc = 0; acdc < FF_ARRAY_ELEMS(par->delta_qp[plane]); acdc++) { + int delta_qp = par->delta_qp[plane][acdc]; + if (delta_qp) + av_log(ctx, AV_LOG_INFO, "delta_qp[%d][%d]=%d; ", + plane, acdc, delta_qp); + } + if (par->nb_blocks) + av_log(ctx, AV_LOG_INFO, "%u blocks; ", par->nb_blocks); +} + static void dump_color_property(AVFilterContext *ctx, AVFrame *frame) { const char *color_range_str = av_color_range_name(frame->color_range); @@ -352,6 +372,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) av_log(ctx, AV_LOG_INFO, "GOP timecode - %s", tcbuf); break; } + case AV_FRAME_DATA_VIDEO_ENC_PARAMS: + dump_video_enc_params(ctx, sd); + break; default: av_log(ctx, AV_LOG_WARNING, "unknown side data type %d (%d bytes)", sd->type, sd->size); |