Frame
A single frame, as seen by the camera.
Properties​
bytesPerRow​
• bytesPerRow: number
Returns the amount of bytes per row.
Defined in​
height​
• height: number
Returns the height of the frame, in pixels.
Defined in​
isValid​
• isValid: boolean
Whether the underlying buffer is still valid or not. The buffer will be released after the frame processor returns, or close()
is called.
Defined in​
planesCount​
• planesCount: number
Returns the number of planes this frame contains.
Defined in​
width​
• width: number
Returns the width of the frame, in pixels.
Defined in​
Methods​
close​
â–¸ close(): void
Closes and disposes the Frame. Only close frames that you have created yourself, e.g. by copying the frame you receive in a frame processor.
Example
const frameProcessor = useFrameProcessor((frame) => {
const smallerCopy = resize(frame, 480, 270)
// run AI ...
smallerCopy.close()
// don't close `frame`!
})
Returns​
void
Defined in​
toString​
â–¸ toString(): string
Returns a string representation of the frame.
Example
console.log(frame.toString()) // -> "3840 x 2160 Frame"
Returns​
string