Allow users to specify the encoder used for framedumping.

This commit is contained in:
Vlad Firoiu
2017-12-29 09:00:55 -05:00
committed by Léo Lam
parent 1f89d91deb
commit 330881ae80
6 changed files with 15 additions and 3 deletions

View File

@ -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)
{

View File

@ -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);

View File

@ -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;