enable video recording

This commit is contained in:
Johxz 2017-01-01 21:40:41 -06:00
parent 38554f7396
commit 5e47c018b2
4 changed files with 116 additions and 0 deletions

View file

@ -55,6 +55,9 @@ function formatSessionNumber(%number)
// Records a movie file from the Canvas content using the specified fps.
// Possible encoder values are "PNG" and "THEORA" (default).
//---------------------------------------------------------------------------------------------
$RecordingMovie = false;
function recordMovie(%movieName, %fps, %encoder)
{
// If the canvas doesn't exist yet, setup a flag so it'll
@ -65,12 +68,24 @@ function recordMovie(%movieName, %fps, %encoder)
if (%encoder $= "")
%encoder = "THEORA";
%resolution = Canvas.getVideoMode();
// Start the movie recording
ChatHud.AddLine( "\c4Recording movie file to [\c2" @ %movieName @ "\cr].ogv.");
echo("Recording movie to: " @ %movieName);
startVideoCapture(Canvas, %movieName, %encoder, %fps);
$RecordingMovie = true;
}
function stopMovie()
{
// Stop the current recording
ChatHud.AddLine( "\c4Recording movie file finished.");
echo("Stopped movie recording");
stopVideoCapture();
$RecordingMovie = false;
}
/// This is bound in initializeCommon() to take