Allow users to specify the encoder used for framedumping.
This commit is contained in:
parent
1f89d91deb
commit
330881ae80
|
@ -50,6 +50,7 @@ const ConfigInfo<bool> GFX_FREE_LOOK{{System::GFX, "Settings", "FreeLook"}, fals
|
||||||
const ConfigInfo<bool> GFX_USE_FFV1{{System::GFX, "Settings", "UseFFV1"}, false};
|
const ConfigInfo<bool> GFX_USE_FFV1{{System::GFX, "Settings", "UseFFV1"}, false};
|
||||||
const ConfigInfo<std::string> GFX_DUMP_FORMAT{{System::GFX, "Settings", "DumpFormat"}, "avi"};
|
const ConfigInfo<std::string> GFX_DUMP_FORMAT{{System::GFX, "Settings", "DumpFormat"}, "avi"};
|
||||||
const ConfigInfo<std::string> GFX_DUMP_CODEC{{System::GFX, "Settings", "DumpCodec"}, ""};
|
const ConfigInfo<std::string> GFX_DUMP_CODEC{{System::GFX, "Settings", "DumpCodec"}, ""};
|
||||||
|
const ConfigInfo<std::string> GFX_DUMP_ENCODER{{System::GFX, "Settings", "DumpEncoder"}, ""};
|
||||||
const ConfigInfo<std::string> GFX_DUMP_PATH{{System::GFX, "Settings", "DumpPath"}, ""};
|
const ConfigInfo<std::string> GFX_DUMP_PATH{{System::GFX, "Settings", "DumpPath"}, ""};
|
||||||
const ConfigInfo<int> GFX_BITRATE_KBPS{{System::GFX, "Settings", "BitrateKbps"}, 2500};
|
const ConfigInfo<int> GFX_BITRATE_KBPS{{System::GFX, "Settings", "BitrateKbps"}, 2500};
|
||||||
const ConfigInfo<bool> GFX_INTERNAL_RESOLUTION_FRAME_DUMPS{
|
const ConfigInfo<bool> GFX_INTERNAL_RESOLUTION_FRAME_DUMPS{
|
||||||
|
|
|
@ -41,6 +41,7 @@ extern const ConfigInfo<bool> GFX_FREE_LOOK;
|
||||||
extern const ConfigInfo<bool> GFX_USE_FFV1;
|
extern const ConfigInfo<bool> GFX_USE_FFV1;
|
||||||
extern const ConfigInfo<std::string> GFX_DUMP_FORMAT;
|
extern const ConfigInfo<std::string> GFX_DUMP_FORMAT;
|
||||||
extern const ConfigInfo<std::string> GFX_DUMP_CODEC;
|
extern const ConfigInfo<std::string> GFX_DUMP_CODEC;
|
||||||
|
extern const ConfigInfo<std::string> GFX_DUMP_ENCODER;
|
||||||
extern const ConfigInfo<std::string> GFX_DUMP_PATH;
|
extern const ConfigInfo<std::string> GFX_DUMP_PATH;
|
||||||
extern const ConfigInfo<int> GFX_BITRATE_KBPS;
|
extern const ConfigInfo<int> GFX_BITRATE_KBPS;
|
||||||
extern const ConfigInfo<bool> GFX_INTERNAL_RESOLUTION_FRAME_DUMPS;
|
extern const ConfigInfo<bool> GFX_INTERNAL_RESOLUTION_FRAME_DUMPS;
|
||||||
|
|
|
@ -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_DUMP_EFB_TARGET.location, Config::GFX_DUMP_FRAMES_AS_IMAGES.location,
|
||||||
Config::GFX_FREE_LOOK.location, Config::GFX_USE_FFV1.location,
|
Config::GFX_FREE_LOOK.location, Config::GFX_USE_FFV1.location,
|
||||||
Config::GFX_DUMP_FORMAT.location, Config::GFX_DUMP_CODEC.location,
|
Config::GFX_DUMP_FORMAT.location, Config::GFX_DUMP_CODEC.location,
|
||||||
Config::GFX_DUMP_PATH.location, Config::GFX_BITRATE_KBPS.location,
|
Config::GFX_DUMP_ENCODER.location, Config::GFX_DUMP_PATH.location,
|
||||||
Config::GFX_INTERNAL_RESOLUTION_FRAME_DUMPS.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_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_FAST_DEPTH_CALC.location, Config::GFX_MSAA.location, Config::GFX_SSAA.location,
|
||||||
Config::GFX_EFB_SCALE.location, Config::GFX_TEXFMT_OVERLAY_ENABLE.location,
|
Config::GFX_EFB_SCALE.location, Config::GFX_TEXFMT_OVERLAY_ENABLE.location,
|
||||||
|
|
|
@ -159,7 +159,15 @@ bool AVIDump::CreateVideoFile()
|
||||||
|
|
||||||
const AVCodec* codec = nullptr;
|
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);
|
s_codec_context = avcodec_alloc_context3(codec);
|
||||||
if (!codec || !s_codec_context)
|
if (!codec || !s_codec_context)
|
||||||
{
|
{
|
||||||
|
|
|
@ -84,6 +84,7 @@ void VideoConfig::Refresh()
|
||||||
bUseFFV1 = Config::Get(Config::GFX_USE_FFV1);
|
bUseFFV1 = Config::Get(Config::GFX_USE_FFV1);
|
||||||
sDumpFormat = Config::Get(Config::GFX_DUMP_FORMAT);
|
sDumpFormat = Config::Get(Config::GFX_DUMP_FORMAT);
|
||||||
sDumpCodec = Config::Get(Config::GFX_DUMP_CODEC);
|
sDumpCodec = Config::Get(Config::GFX_DUMP_CODEC);
|
||||||
|
sDumpEncoder = Config::Get(Config::GFX_DUMP_ENCODER);
|
||||||
sDumpPath = Config::Get(Config::GFX_DUMP_PATH);
|
sDumpPath = Config::Get(Config::GFX_DUMP_PATH);
|
||||||
iBitrateKbps = Config::Get(Config::GFX_BITRATE_KBPS);
|
iBitrateKbps = Config::Get(Config::GFX_BITRATE_KBPS);
|
||||||
bInternalResolutionFrameDumps = Config::Get(Config::GFX_INTERNAL_RESOLUTION_FRAME_DUMPS);
|
bInternalResolutionFrameDumps = Config::Get(Config::GFX_INTERNAL_RESOLUTION_FRAME_DUMPS);
|
||||||
|
|
|
@ -100,6 +100,7 @@ struct VideoConfig final
|
||||||
bool bDumpFramesAsImages;
|
bool bDumpFramesAsImages;
|
||||||
bool bUseFFV1;
|
bool bUseFFV1;
|
||||||
std::string sDumpCodec;
|
std::string sDumpCodec;
|
||||||
|
std::string sDumpEncoder;
|
||||||
std::string sDumpFormat;
|
std::string sDumpFormat;
|
||||||
std::string sDumpPath;
|
std::string sDumpPath;
|
||||||
bool bInternalResolutionFrameDumps;
|
bool bInternalResolutionFrameDumps;
|
||||||
|
|
Loading…
Reference in New Issue