[FFmpeg-devel] [PATCH] initialize avctx->pix_fmt in av1 parser.

ManojGuptaBonda mbonda at nvidia.com
Fri Jun 19 10:01:22 EEST 2020


Initialize avctx->pix_fmt in av1_parser.c
AV1 Chroma format is invalid when quering using below code:
iVideoStream = av_find_best_stream(fmtc, AVMEDIA_TYPE_VIDEO, -1, -1, >
NULL, 0);
eChromaFormat = (AVPixelFormat)fmtc->streams[iVideoStream]->codecpar->
>format;
---
 libavcodec/av1_parser.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c
index 68b7a78abe..16e617ed16 100644
--- a/libavcodec/av1_parser.c
+++ b/libavcodec/av1_parser.c
@@ -164,6 +164,7 @@ static int av1_parser_parse(AVCodecParserContext *ctx,
         avctx->color_primaries = (enum AVColorPrimaries) color->color_primaries;
         avctx->color_trc = (enum AVColorTransferCharacteristic) color->transfer_characteristics;
         avctx->color_range = color->color_range ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
+        avctx->pix_fmt = ctx->format;
 
         if (ctx->width != avctx->width || ctx->height != avctx->height) {
             ret = ff_set_dimensions(avctx, ctx->width, ctx->height);
-- 
2.17.1



More information about the ffmpeg-devel mailing list