- Documentation
- Client functions
- startCameraRecording
Function
startCameraRecording
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
stopCameraRecordingStops recording. The recording stays available for playback and saving. Returnsfalseif it was no longer recording.createRecordingPlayerCreates a recording player that is a texture: you draw it like any texture, also in the world withdxDrawMaterialLine3D. The recording can be deleted afterwards; the player keeps its own frames.saveRecordingSaves a recording to an AVI file in the resource (overwrites an existing one, likefileCreate).