class FFmpeg::Frame
- FFmpeg::Frame
- Reference
- Object
Defined in:
ffmpeg/frame.crConstructors
-
.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)
- .new(source : FFmpeg::Frame)
-
.new(canvas : StumpyCore::Canvas)
canvas helpers
- .new
Instance Method Summary
-
#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)
- #buffer : Bytes
-
#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.
-
#copy_to(frame : FFmpeg::Frame)
copies the image buffer to a new frame
-
#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.
- #finalize
- #height
- #key_frame? : Bool
- #pixel_format : PixelFormat
-
#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
-
#to_canvas : StumpyCore::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 : Pointer(FFmpeg::LibAV::Util::AVFrame)
- #unsafe_crop(top : Int32, left : Int32, bottom : Int32, right : Int32) : FFmpeg::Frame
- #width
Constructor Detail
DEPRECATED specify pixel format instead of byte size
Instance Method Detail
DEPRECATED specify pixel format instead of byte size
helper 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
crops the frame for use with scaler to combine cropping in a single operation
a very simple way to get a stumpy canvas from a frame also very inefficient so I don't recommend using in production