Interface: TFilamentRecorder
Properties
fps
fps:
number
The amount of frames per second this video will be recorded at.
Filament can render faster than this, but frames will be queued to run at the given FPS, assuming the timing (timestamp) is correct.
Defined in
src/types/FilamentRecorder.ts:18
height
height:
number
The height of the video that is being recorded, in pixels.
Defined in
src/types/FilamentRecorder.ts:11
isRecording
isRecording:
boolean
Whether this Recorder is currently recording or not.
Defined in
src/types/FilamentRecorder.ts:27
outputFile
outputFile:
string
The file that this Recorder is- or will be recording to.
Defined in
src/types/FilamentRecorder.ts:22
width
width:
number
The width of the video that is being recorded, in pixels.
Defined in
src/types/FilamentRecorder.ts:7
Methods
addOnReadyForMoreDataListener()
addOnReadyForMoreDataListener(
callback
):Listener
Adds a listener that will be called every time the Recorder is ready for more data.
When the Recorder is ready for more data, you can use ()
to render the next Frame.
When your callback returns false
, the render loop will stop.
If you don't wait for this callback, you might risk dropping Frames as the recorder might not be ready to consume more frames.
Parameters
• callback
Returns
Listener
A Listener subscription that can be removed if no longer needed. If the Recorder gets deleted, the listener also becomes invalid.
Defined in
src/types/FilamentRecorder.ts:61
renderFrame()
renderFrame(
timestamp
):void
Appends the current Frame to the resulting video file.
This might perform a copy of the current result stored in the SwapChain, and will then encode the Frame using H.264 or H.265 to the video file.
Parameters
• timestamp: number
Returns
void
Throws
Throws an error if the Recorder is not ready for more data. Use ()
to
be notified when the Recorder is ready for more data to prevent this error.
Defined in
src/types/FilamentRecorder.ts:47
startRecording()
startRecording():
Promise
<void
>
Starts the recording session.
Returns
Promise
<void
>
Defined in
src/types/FilamentRecorder.ts:32
stopRecording()
stopRecording():
Promise
<string
>
Stops the recording session and invalidates this recorder.
Returns
Promise
<string
>