Implement recording video to avi file.
It allows to easily record a video, which can be then for example attached to a bug report. It also allows to record promotion videos (eg. trailers), which should be more smooth than recorded using external application. Main disadventages are: - Constant fps in avi file - Atm. it's not possible to record sounds. I even don't know if it's possible at all (if we can easily get access to the sound buffer). I see about 20-25% fps drop during recording. I think that it's acceptable. But if needed, the fps can be increased by using separated thread for recording. Currently it uses jpeg compression with 70 quality. It can be easily tweaked to use higher/lower compression or even just uncompressed bitmaps.
This commit is contained in:
@@ -107,7 +107,9 @@ enum DebugMenuCommand
|
||||
DEBUG_VISUAL_VALUES,
|
||||
DEBUG_PRINT_START_POS,
|
||||
DEBUG_ADJUST_LIGHTS,
|
||||
DEBUG_SCRIPT_CONSOLE
|
||||
DEBUG_SCRIPT_CONSOLE,
|
||||
DEBUG_START_RECORDING,
|
||||
DEBUG_STOP_RECORDING
|
||||
}; // DebugMenuCommand
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -566,6 +568,14 @@ bool handleContextMenuAction(s32 cmdID)
|
||||
{
|
||||
ScriptingConsole* console = new ScriptingConsole();
|
||||
}
|
||||
else if (cmdID == DEBUG_START_RECORDING)
|
||||
{
|
||||
irr_driver->startRecording();
|
||||
}
|
||||
else if (cmdID == DEBUG_STOP_RECORDING)
|
||||
{
|
||||
irr_driver->stopRecording();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -642,6 +652,11 @@ bool onEvent(const SEvent &event)
|
||||
sub->addItem(L"Normal view (Ctrl + F2)", DEBUG_GUI_CAM_NORMAL);
|
||||
sub->addItem(L"Toggle smooth camera", DEBUG_GUI_CAM_SMOOTH);
|
||||
sub->addItem(L"Attach fps camera to kart", DEBUG_GUI_CAM_ATTACH);
|
||||
|
||||
int idx = mnu->addItem(L"Recording >",-1,true, true);
|
||||
sub = mnu->getSubMenu(idx);
|
||||
sub->addItem(L"Start recording", DEBUG_START_RECORDING);
|
||||
sub->addItem(L"Stop recording", DEBUG_STOP_RECORDING);
|
||||
|
||||
mnu->addItem(L"Adjust values", DEBUG_VISUAL_VALUES);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user