mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-27 07:15:37 +00:00
enable video recording
This commit is contained in:
parent
38554f7396
commit
5e47c018b2
4 changed files with 116 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue