View Source Xav.VideoConverter (xav v0.10.0)
Video samples converter.
It supports pixel format conversion and/or scaling.
Summary
Types
@type t() :: %Xav.VideoConverter{ converter: reference(), out_format: Xav.Frame.video_format(), out_height: Xav.Frame.height(), out_width: Xav.Frame.width() }
Functions
@spec convert(t(), Xav.Frame.t()) :: Xav.Frame.t()
Converts a video frame.
Creates a new video converter.
The following options can be passed:
:out_width
(pos_integer/0
) - scale the video frame to this widthIf
out_width
andout_height
are both not provided, scaling is not performed. If one of the dimensions isnil
, the other will be calculated based on the input dimensions as to keep the aspect ratio.:out_height
(pos_integer/0
) - scale the video frame to this height:out_format
(atom/0
) - video format to convert to (e.g.:rgb24
)