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