FFmpeg::Frame
Inherits Reference / Object
Constructors
new(width : Int, height : Int, pixel_bytes : Int)
DEPRECATED specify pixel format instead of byte size
new(width : Int, height : Int, pixel_format : LibAV::PixelFormat, align : Int = 1, buffer : Bytes | Nil = nil)
Sourcenew(source : FFmpeg::Frame)
Sourcenew
SourceInstance methods
allocate_buffer(width : Int, height : Int, pixel_bytes : Int)
DEPRECATED specify pixel format instead of byte size
allocate_buffer(width : Int, height : Int, pixel_format : LibAV::PixelFormat, align : Int = 1, buffer : Bytes | Nil = nil)
Sourcebuffer
Sourcehelper for converting to another format NOTE:: when streaming video you'd want to cache this scaler.
crop helper - values are pixel distances from the edges NOTE:: when streaming video you'd want to cache scalers. This is useful where you need to crop different segments each frame
finalize
Sourceheight
Sourcekey_frame?
Sourcepixel_format
Sourcecrops the frame for use with scaler to combine cropping in a single operation
to_canvas
a very simple way to get a stumpy canvas from a frame also very inefficient so I don't recommend using in production
to_unsafe
Sourcewidth
Source