summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/FrameDump.cpp
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2022-03-23 12:26:22 -0700
committerShawn Hoffman <godisgovernment@gmail.com>2022-03-29 17:27:59 -0700
commit4fad2c26e4f3b94fc12e63a0ec472fec83ceb1fe (patch)
tree3246989186e338b916199dd7e8308172fee29b44 /Source/Core/VideoCommon/FrameDump.cpp
parentdecaea8f9b8f2705617e5a4782e72161e7afad22 (diff)
framedump: enable compat with utvideo codec
Diffstat (limited to 'Source/Core/VideoCommon/FrameDump.cpp')
-rw-r--r--Source/Core/VideoCommon/FrameDump.cpp16
1 files changed, 15 insertions, 1 deletions
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 <libavutil/error.h>
#include <libavutil/log.h>
#include <libavutil/mathematics.h>
+#include <libavutil/opt.h>
#include <libswscale/swscale.h>
}
@@ -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;