Update config.xml with libopenglrecorder
Consider use mjpeg / h264 (DIY compile) for HQ video
This commit is contained in:
parent
3fcf62a84a
commit
31f9acf7ed
@ -568,19 +568,20 @@ namespace UserConfigParams
|
||||
&m_recording_group, "Limit game framerate not beyond the fps of"
|
||||
" recording video."));
|
||||
|
||||
PARAM_PREFIX IntUserConfigParam m_record_format
|
||||
PARAM_DEFAULT(IntUserConfigParam(0, "record_format",
|
||||
&m_recording_group, "Specify the format for record (VP8, VP9, "
|
||||
"mjpeg)"));
|
||||
PARAM_PREFIX IntUserConfigParam m_video_format
|
||||
PARAM_DEFAULT(IntUserConfigParam(0, "video_format",
|
||||
&m_recording_group, "Specify the video for record, which is the enum"
|
||||
" of VideoFormat in libopenglrecorder. It will"
|
||||
" auto fallback to MJPEG if libopenglrecorder was"
|
||||
" not compiled with such video encoder."));
|
||||
|
||||
PARAM_PREFIX IntUserConfigParam m_vp_end_usage
|
||||
PARAM_DEFAULT(IntUserConfigParam(0, "vp_end_usage",
|
||||
&m_recording_group, "Specify the rate control algorithm for libvpx,"
|
||||
" see enum vpx_rc_mode"));
|
||||
PARAM_PREFIX IntUserConfigParam m_audio_bitrate
|
||||
PARAM_DEFAULT(IntUserConfigParam(112000, "audio_bitrate",
|
||||
&m_recording_group, "Specify the bitrate for audio"));
|
||||
|
||||
PARAM_PREFIX IntUserConfigParam m_vp_bitrate
|
||||
PARAM_DEFAULT(IntUserConfigParam(20000, "vp_bitrate",
|
||||
&m_recording_group, "Specify the bitrate for libvpx"));
|
||||
PARAM_PREFIX IntUserConfigParam m_video_bitrate
|
||||
PARAM_DEFAULT(IntUserConfigParam(20000, "video_bitrate",
|
||||
&m_recording_group, "Specify the bitrate for video"));
|
||||
|
||||
PARAM_PREFIX IntUserConfigParam m_recorder_jpg_quality
|
||||
PARAM_DEFAULT(IntUserConfigParam(90, "recorder_jpg_quality",
|
||||
|
@ -609,16 +609,30 @@ void IrrDriver::initDevice()
|
||||
m_actual_screen_size = m_video_driver->getCurrentRenderTargetSize();
|
||||
|
||||
#ifdef ENABLE_RECORDER
|
||||
ogrRegGeneralCallback(OGR_CBT_START_RECORDING,
|
||||
[] (void* user_data) { MessageQueue::add
|
||||
(MessageQueue::MT_GENERIC, _("Video recording started.")); }, NULL);
|
||||
ogrRegStringCallback(OGR_CBT_ERROR_RECORDING,
|
||||
[](const char* s, void* user_data)
|
||||
{ Log::error("openglrecorder", "%s", s); }, NULL);
|
||||
ogrRegStringCallback(OGR_CBT_SAVED_RECORDING,
|
||||
[] (const char* s, void* user_data) { MessageQueue::add
|
||||
(MessageQueue::MT_GENERIC, _("Video saved in \"%s\".", s));
|
||||
}, NULL);
|
||||
ogrRegIntCallback(OGR_CBT_PROGRESS_RECORDING,
|
||||
[] (const int i, void* user_data)
|
||||
{ MessageQueue::showProgressBar(i, _("Encoding progress:")); }, NULL);
|
||||
|
||||
RecorderConfig cfg;
|
||||
cfg.m_triple_buffering = 1;
|
||||
cfg.m_record_audio = 1;
|
||||
cfg.m_width = m_actual_screen_size.Width;
|
||||
cfg.m_height = m_actual_screen_size.Height;
|
||||
int vf = UserConfigParams::m_record_format;
|
||||
int vf = UserConfigParams::m_video_format;
|
||||
cfg.m_video_format = (VideoFormat)vf;
|
||||
cfg.m_audio_format = OGR_AF_VORBIS;
|
||||
cfg.m_audio_bitrate = 112000;
|
||||
cfg.m_video_bitrate = UserConfigParams::m_vp_bitrate;
|
||||
cfg.m_audio_bitrate = UserConfigParams::m_audio_bitrate;
|
||||
cfg.m_video_bitrate = UserConfigParams::m_video_bitrate;
|
||||
cfg.m_record_fps = UserConfigParams::m_record_fps;
|
||||
cfg.m_record_jpg_quality = UserConfigParams::m_recorder_jpg_quality;
|
||||
if (ogrInitConfig(&cfg) == 0)
|
||||
@ -639,20 +653,6 @@ void IrrDriver::initDevice()
|
||||
[](unsigned int t, unsigned int a) { return glMapBuffer(t, a); },
|
||||
[](unsigned int t) { return glUnmapBuffer(t); });
|
||||
|
||||
ogrRegGeneralCallback(OGR_CBT_START_RECORDING,
|
||||
[] (void* user_data) { MessageQueue::add
|
||||
(MessageQueue::MT_GENERIC, _("Video recording started.")); }, NULL);
|
||||
ogrRegStringCallback(OGR_CBT_ERROR_RECORDING,
|
||||
[](const char* s, void* user_data)
|
||||
{ Log::error("openglrecorder", "%s", s); }, NULL);
|
||||
ogrRegStringCallback(OGR_CBT_SAVED_RECORDING,
|
||||
[] (const char* s, void* user_data) { MessageQueue::add
|
||||
(MessageQueue::MT_GENERIC, _("Video saved in \"%s\".", s));
|
||||
}, NULL);
|
||||
ogrRegIntCallback(OGR_CBT_PROGRESS_RECORDING,
|
||||
[] (const int i, void* user_data)
|
||||
{ MessageQueue::showProgressBar(i, _("Encoding progress:")); }, NULL);
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef SERVER_ONLY
|
||||
|
Loading…
Reference in New Issue
Block a user