class

FFmpeg::Frame

Inherits Reference / Object

Constructors

new(width : Int, height : Int, pixel_bytes : Int)

DEPRECATED specify pixel format instead of byte size

Source
new(width : Int, height : Int, pixel_format : LibAV::PixelFormat, align : Int = 1, buffer : Bytes | Nil = nil)
Source
new(source : FFmpeg::Frame)
Source
new(canvas : StumpyCore::Canvas)

canvas helpers

Source

Instance methods

allocate_buffer(width : Int, height : Int, pixel_bytes : Int)

DEPRECATED specify pixel format instead of byte size

Source
allocate_buffer(width : Int, height : Int, pixel_format : LibAV::PixelFormat, align : Int = 1, buffer : Bytes | Nil = nil)
Source
buffer
Source
convert_to(pixel_format : LibAV::PixelFormat) : FFmpeg::Frame

helper for converting to another format NOTE:: when streaming video you'd want to cache this scaler.

Source
copy_to(frame : FFmpeg::Frame)

copies the image buffer to a new frame

Source
crop(top : Int32, left : Int32, bottom : Int32, right : Int32) : FFmpeg::Frame

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

Source
finalize
Source
height
Source
key_frame?
Source
pixel_format
Source
quick_crop(top : Int32, left : Int32, bottom : Int32, right : Int32) : FFmpeg::Frame

crops the frame for use with scaler to combine cropping in a single operation

Source
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

Source
to_unsafe
Source
unsafe_crop(top : Int32, left : Int32, bottom : Int32, right : Int32) : FFmpeg::Frame
Source
width
Source