mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
Configable dump codec.
This commit is contained in:
parent
a1a9e488a5
commit
21e66e60e3
@ -96,8 +96,6 @@ bool AVIDump::Start(int w, int h)
|
|||||||
|
|
||||||
bool AVIDump::CreateVideoFile()
|
bool AVIDump::CreateVideoFile()
|
||||||
{
|
{
|
||||||
AVCodec* codec = nullptr;
|
|
||||||
|
|
||||||
const std::string& s_format = g_Config.sDumpFormat;
|
const std::string& s_format = g_Config.sDumpFormat;
|
||||||
|
|
||||||
std::stringstream file_ss;
|
std::stringstream file_ss;
|
||||||
@ -130,8 +128,10 @@ bool AVIDump::CreateVideoFile()
|
|||||||
}
|
}
|
||||||
avformat_alloc_output_context2(&s_format_context, output_format, nullptr, filename.c_str());
|
avformat_alloc_output_context2(&s_format_context, output_format, nullptr, filename.c_str());
|
||||||
|
|
||||||
AVCodecID codec_id =
|
const AVCodecDescriptor* codec_desc = avcodec_descriptor_get_by_name(g_Config.sDumpCodec.c_str());
|
||||||
g_Config.bUseFFV1 ? AV_CODEC_ID_FFV1 : output_format->video_codec;
|
AVCodecID codec_id = codec_desc ? codec_desc->id : output_format->video_codec;
|
||||||
|
|
||||||
|
const AVCodec* codec = nullptr;
|
||||||
|
|
||||||
if (!(codec = avcodec_find_encoder(codec_id)) ||
|
if (!(codec = avcodec_find_encoder(codec_id)) ||
|
||||||
!(s_codec_context = avcodec_alloc_context3(codec)))
|
!(s_codec_context = avcodec_alloc_context3(codec)))
|
||||||
|
@ -76,6 +76,7 @@ void VideoConfig::Load(const std::string& ini_file)
|
|||||||
settings->Get("FreeLook", &bFreeLook, false);
|
settings->Get("FreeLook", &bFreeLook, false);
|
||||||
settings->Get("UseFFV1", &bUseFFV1, false);
|
settings->Get("UseFFV1", &bUseFFV1, false);
|
||||||
settings->Get("DumpFormat", &sDumpFormat, "avi");
|
settings->Get("DumpFormat", &sDumpFormat, "avi");
|
||||||
|
settings->Get("DumpCodec", &sDumpCodec, "");
|
||||||
settings->Get("BitrateKbps", &iBitrateKbps, 2500);
|
settings->Get("BitrateKbps", &iBitrateKbps, 2500);
|
||||||
settings->Get("InternalResolutionFrameDumps", &bInternalResolutionFrameDumps, false);
|
settings->Get("InternalResolutionFrameDumps", &bInternalResolutionFrameDumps, false);
|
||||||
settings->Get("EnablePixelLighting", &bEnablePixelLighting, false);
|
settings->Get("EnablePixelLighting", &bEnablePixelLighting, false);
|
||||||
|
@ -102,6 +102,7 @@ struct VideoConfig final
|
|||||||
bool bDumpEFBTarget;
|
bool bDumpEFBTarget;
|
||||||
bool bDumpFramesAsImages;
|
bool bDumpFramesAsImages;
|
||||||
bool bUseFFV1;
|
bool bUseFFV1;
|
||||||
|
std::string sDumpCodec;
|
||||||
std::string sDumpFormat;
|
std::string sDumpFormat;
|
||||||
bool bInternalResolutionFrameDumps;
|
bool bInternalResolutionFrameDumps;
|
||||||
bool bFreeLook;
|
bool bFreeLook;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user