View Source Xav.VideoConverter (xav v0.10.0)

Video samples converter.

It supports pixel format conversion and/or scaling.

Summary

Functions

Converts a video frame.

Creates a new video converter.

Types

@type t() :: %Xav.VideoConverter{
  converter: reference(),
  out_format: Xav.Frame.video_format(),
  out_height: Xav.Frame.height(),
  out_width: Xav.Frame.width()
}

Functions

Link to this function

convert(video_converter, frame)

View Source
@spec convert(t(), Xav.Frame.t()) :: Xav.Frame.t()

Converts a video frame.

@spec new(Keyword.t()) :: t()

Creates a new video converter.

The following options can be passed:

  • :out_width (pos_integer/0) - scale the video frame to this width

    If out_width and out_height are both not provided, scaling is not performed. If one of the dimensions is nil, 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)