View Source Xav.Frame (xav v0.11.0)
Audio/video frame.
Summary
Types
@type audio_format() :: atom()
Possible audio samples formats.
To get the complete list of sample formats, check Xav.sample_formats/0
.
@type format() :: audio_format() | video_format()
@type height() :: non_neg_integer() | nil
@type video_format() :: atom()
Possible video frame formats.
To get the complete list of pixel formats, check Xav.pixel_formats/0
.
An example of a pixel format is :rgb24
.
@type width() :: non_neg_integer() | nil
Functions
@spec new(binary(), format(), non_neg_integer(), non_neg_integer(), integer()) :: t()
Creates a new audio/video frame.
@spec to_nx(t()) :: Nx.Tensor.t()
Converts a frame to an Nx tensor.
In case of a video frame, dimension names of the newly created tensor are [:height, :width, :channels]
.
For video frames, the only supported pixel formats are:
:rgb24
:bgr24