From 005e60fa22ed3df7c6e435036b0aa75a37a923f9 Mon Sep 17 00:00:00 2001 From: feos Date: Mon, 11 Mar 2019 01:29:34 +0300 Subject: [PATCH 1/2] change pixel format from BGRA to BGR0 for this kind of footage carrying alpha information makes no sense, and it additionally complicates things by hugely damaging compatibility of the resulting video. after this change alone the video becomes compatible with VfW/WinAPI and tools that rely on it (avisynth, virtualdub). fixes https://bugs.dolphin-emu.org/issues/11141 and https://bugs.dolphin-emu.org/issues/10193 --- Source/Core/VideoCommon/AVIDump.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/AVIDump.cpp b/Source/Core/VideoCommon/AVIDump.cpp index b8cdf1ca1c..118c869b9a 100644 --- a/Source/Core/VideoCommon/AVIDump.cpp +++ b/Source/Core/VideoCommon/AVIDump.cpp @@ -191,7 +191,7 @@ bool AVIDump::CreateVideoFile() s_codec_context->time_base.num = 1; s_codec_context->time_base.den = VideoInterface::GetTargetRefreshRate(); s_codec_context->gop_size = 12; - s_codec_context->pix_fmt = g_Config.bUseFFV1 ? AV_PIX_FMT_BGRA : AV_PIX_FMT_YUV420P; + s_codec_context->pix_fmt = g_Config.bUseFFV1 ? AV_PIX_FMT_BGR0 : AV_PIX_FMT_YUV420P; if (output_format->flags & AVFMT_GLOBALHEADER) s_codec_context->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; From 7fd940411b375e2d7b17b6d219927842d95a1ee2 Mon Sep 17 00:00:00 2001 From: feos Date: Mon, 11 Mar 2019 01:30:12 +0300 Subject: [PATCH 2/2] decrease gop size (keyint) this makes seeking a lot smoother (especially at high resolutions), while only adding less than 1% of filesize with this codec. --- Source/Core/VideoCommon/AVIDump.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/AVIDump.cpp b/Source/Core/VideoCommon/AVIDump.cpp index 118c869b9a..5eaa31213c 100644 --- a/Source/Core/VideoCommon/AVIDump.cpp +++ b/Source/Core/VideoCommon/AVIDump.cpp @@ -190,7 +190,7 @@ bool AVIDump::CreateVideoFile() s_codec_context->height = s_height; s_codec_context->time_base.num = 1; s_codec_context->time_base.den = VideoInterface::GetTargetRefreshRate(); - s_codec_context->gop_size = 12; + s_codec_context->gop_size = 1; s_codec_context->pix_fmt = g_Config.bUseFFV1 ? AV_PIX_FMT_BGR0 : AV_PIX_FMT_YUV420P; if (output_format->flags & AVFMT_GLOBALHEADER)