diff --git a/Source/Core/Core/Config/GraphicsSettings.cpp b/Source/Core/Core/Config/GraphicsSettings.cpp index 099f9676ac..4455cb63af 100644 --- a/Source/Core/Core/Config/GraphicsSettings.cpp +++ b/Source/Core/Core/Config/GraphicsSettings.cpp @@ -50,6 +50,7 @@ const ConfigInfo GFX_FREE_LOOK{{System::GFX, "Settings", "FreeLook"}, fals const ConfigInfo GFX_USE_FFV1{{System::GFX, "Settings", "UseFFV1"}, false}; const ConfigInfo GFX_DUMP_FORMAT{{System::GFX, "Settings", "DumpFormat"}, "avi"}; const ConfigInfo GFX_DUMP_CODEC{{System::GFX, "Settings", "DumpCodec"}, ""}; +const ConfigInfo GFX_DUMP_ENCODER{{System::GFX, "Settings", "DumpEncoder"}, ""}; const ConfigInfo GFX_DUMP_PATH{{System::GFX, "Settings", "DumpPath"}, ""}; const ConfigInfo GFX_BITRATE_KBPS{{System::GFX, "Settings", "BitrateKbps"}, 2500}; const ConfigInfo GFX_INTERNAL_RESOLUTION_FRAME_DUMPS{ diff --git a/Source/Core/Core/Config/GraphicsSettings.h b/Source/Core/Core/Config/GraphicsSettings.h index 009dcbb5d8..475edf8a8b 100644 --- a/Source/Core/Core/Config/GraphicsSettings.h +++ b/Source/Core/Core/Config/GraphicsSettings.h @@ -41,6 +41,7 @@ extern const ConfigInfo GFX_FREE_LOOK; extern const ConfigInfo GFX_USE_FFV1; extern const ConfigInfo GFX_DUMP_FORMAT; extern const ConfigInfo GFX_DUMP_CODEC; +extern const ConfigInfo GFX_DUMP_ENCODER; extern const ConfigInfo GFX_DUMP_PATH; extern const ConfigInfo GFX_BITRATE_KBPS; extern const ConfigInfo GFX_INTERNAL_RESOLUTION_FRAME_DUMPS; diff --git a/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp b/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp index 2af57fbbc6..36cde2a9d9 100644 --- a/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp +++ b/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp @@ -37,8 +37,8 @@ bool IsSettingSaveable(const Config::ConfigLocation& config_location) Config::GFX_DUMP_EFB_TARGET.location, Config::GFX_DUMP_FRAMES_AS_IMAGES.location, Config::GFX_FREE_LOOK.location, Config::GFX_USE_FFV1.location, Config::GFX_DUMP_FORMAT.location, Config::GFX_DUMP_CODEC.location, - Config::GFX_DUMP_PATH.location, Config::GFX_BITRATE_KBPS.location, - Config::GFX_INTERNAL_RESOLUTION_FRAME_DUMPS.location, + Config::GFX_DUMP_ENCODER.location, Config::GFX_DUMP_PATH.location, + Config::GFX_BITRATE_KBPS.location, Config::GFX_INTERNAL_RESOLUTION_FRAME_DUMPS.location, Config::GFX_ENABLE_GPU_TEXTURE_DECODING.location, Config::GFX_ENABLE_PIXEL_LIGHTING.location, Config::GFX_FAST_DEPTH_CALC.location, Config::GFX_MSAA.location, Config::GFX_SSAA.location, Config::GFX_EFB_SCALE.location, Config::GFX_TEXFMT_OVERLAY_ENABLE.location, diff --git a/Source/Core/VideoCommon/AVIDump.cpp b/Source/Core/VideoCommon/AVIDump.cpp index 6a7590f034..36340a4679 100644 --- a/Source/Core/VideoCommon/AVIDump.cpp +++ b/Source/Core/VideoCommon/AVIDump.cpp @@ -159,7 +159,15 @@ bool AVIDump::CreateVideoFile() const AVCodec* codec = nullptr; - codec = avcodec_find_encoder(codec_id); + if (!g_Config.sDumpEncoder.empty()) + { + codec = avcodec_find_encoder_by_name(g_Config.sDumpEncoder.c_str()); + if (!codec) + WARN_LOG(VIDEO, "Invalid encoder %s", g_Config.sDumpEncoder.c_str()); + } + if (!codec) + codec = avcodec_find_encoder(codec_id); + s_codec_context = avcodec_alloc_context3(codec); if (!codec || !s_codec_context) { diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index eace12cda3..6c68fd5e37 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -84,6 +84,7 @@ void VideoConfig::Refresh() bUseFFV1 = Config::Get(Config::GFX_USE_FFV1); sDumpFormat = Config::Get(Config::GFX_DUMP_FORMAT); sDumpCodec = Config::Get(Config::GFX_DUMP_CODEC); + sDumpEncoder = Config::Get(Config::GFX_DUMP_ENCODER); sDumpPath = Config::Get(Config::GFX_DUMP_PATH); iBitrateKbps = Config::Get(Config::GFX_BITRATE_KBPS); bInternalResolutionFrameDumps = Config::Get(Config::GFX_INTERNAL_RESOLUTION_FRAME_DUMPS); diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index 0167cff5a5..f7ece85a64 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -100,6 +100,7 @@ struct VideoConfig final bool bDumpFramesAsImages; bool bUseFFV1; std::string sDumpCodec; + std::string sDumpEncoder; std::string sDumpFormat; std::string sDumpPath; bool bInternalResolutionFrameDumps;