Garry's Mod Wiki

IVideoWriter:AddFrame

  IVideoWriter:AddFrame( number frameTime, boolean downsample )

Description

Adds the current framebuffer to the video stream.

Arguments

1 number frameTime
Usually set to what FrameTime is, or simply 1/fps.
2 boolean downsample
If true it will downsample the whole screenspace to the videos width and height, otherwise it will just record from the top left corner to the given width and height and therefor not the whole screen.

Example

If ActiveVideo was a IVideoWriter, it would record the screen every frame.

--Taken from /lua/menu/video.lua hook.Add( "DrawOverlay", "CaptureFrames", function() if ( !ActiveVideo ) then return end ActiveVideo:AddFrame( FrameTime(), true ) end )