ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. startCameraRecording

Function

startCameraRecording

ClientDrawing (dx)Trilogy Hub only

Records the image of a camera from createCameraRender into memory (no sound). Returns a recording element. 1-60 frames per second, up to 600 seconds, JPEG quality 1-100. The camera should take at least as many shots per second as the recording, otherwise frames repeat.

Syntax

element startCameraRecording(element camera [, int fps = 15, int seconds = 60, int quality = 80])

Arguments

cameraelement
The camera.
fpsint, optional = 15
Frames per second.
secondsint, optional = 60
Maximum length.
qualityint, optional = 80
JPEG quality.

Returns

The recording or false.

Example

Recording 10 seconds of driving with a camera behind the car.

local veh = getPedOccupiedVehicle(localPlayer)
if veh then
    local cam = createCameraRender(640, 360, 30)
    attachCameraRender(cam, veh, 0, -6, 2)
    local rec = startCameraRecording(cam, 30, 10)
    setTimer(function()
        stopCameraRecording(rec)
        saveRecording(rec, "powtorki/ostatnia.avi")
    end, 10000, 1)
end

Notes

Recording from a script. Recording game footage to an AVI file from a script.

See also