From 4fad2c26e4f3b94fc12e63a0ec472fec83ceb1fe Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Wed, 23 Mar 2022 12:26:22 -0700 Subject: [PATCH] framedump: enable compat with utvideo codec --- Source/Core/VideoCommon/FrameDump.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/FrameDump.cpp b/Source/Core/VideoCommon/FrameDump.cpp index 8e1ac75297..7054ba11af 100644 --- a/Source/Core/VideoCommon/FrameDump.cpp +++ b/Source/Core/VideoCommon/FrameDump.cpp @@ -20,6 +20,7 @@ extern "C" { #include #include #include +#include #include } @@ -247,7 +248,20 @@ bool FrameDump::CreateVideoFile() m_context->codec->time_base = time_base; m_context->codec->gop_size = 1; m_context->codec->level = 1; - m_context->codec->pix_fmt = g_Config.bUseFFV1 ? AV_PIX_FMT_BGR0 : AV_PIX_FMT_YUV420P; + + if (m_context->codec->codec_id == AV_CODEC_ID_FFV1) + { + m_context->codec->pix_fmt = AV_PIX_FMT_BGR0; + } + else if (m_context->codec->codec_id == AV_CODEC_ID_UTVIDEO) + { + m_context->codec->pix_fmt = AV_PIX_FMT_GBRP; + av_opt_set_int(m_context->codec->priv_data, "pred", 3, 0); // median + } + else + { + m_context->codec->pix_fmt = AV_PIX_FMT_YUV420P; + } if (output_format->flags & AVFMT_GLOBALHEADER) m_context->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;