summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorVlad Firoiu <vladfi2@gmail.com>2017-12-29 09:00:55 -0500
committerLéo Lam <leo@innovatetechnologi.es>2018-01-03 13:23:10 +0100
commit330881ae80387a0acced81fc5e5409a5b8a4972e (patch)
treef66e5a8514457285bde3c0096540b00694d9756d /Source/Core/VideoCommon
parent1f89d91deb3d80fc54ab4314a992cd851d843b8d (diff)
Allow users to specify the encoder used for framedumping.
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/AVIDump.cpp10
-rw-r--r--Source/Core/VideoCommon/VideoConfig.cpp1
-rw-r--r--Source/Core/VideoCommon/VideoConfig.h1
3 files changed, 11 insertions, 1 deletions
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;