Garry's Mod Wiki

video.Record

IVideoWriter, string video.Record( table config )

Description

Attempts to create an IVideoWriter.

Arguments

1 table config
The video config. See Structures/VideoData.

Returns

1 IVideoWriter
The video object (returns false if there is an error)
2 string
The error string, if there is an error

Example

How to create a basic IVideoWriter, and how to use it

local config = { container = "webm", video = "vp8", audio = "vorbis", quality = 50, bitrate = 200, fps = 30, lockfps = 30, name = "Test", width = 1280, height = 720 } local iVideoWriter = video.Record( config ) iVideoWriter:SetRecordSound( true ) local function Record() iVideoWriter:AddFrame( FrameTime(), true ) end function StartRecording() hook.Add( "DrawOverlay", "Record", Record ) end function StopRecording() hook.Remove( "DrawOverlay", "Record" ) iVideoWriter:Finish() end

Page Links


Special Pages


Wikis

?

Render Time: 41ms

Session 0
DB GetPage 4
Generate Html 13
SaveChanges 10
Render Body 0
Render Sidebar 12