View Source Xav.Frame (xav v0.10.0)
Audio/video frame.
Summary
Types
@type audio_format() :: :u8 | :s16 | :s32 | :s64 | :f32 | :f64
Possible audio samples formats.
@type format() :: audio_format() | video_format()
@type height() :: non_neg_integer() | nil
@type video_format() :: atom()
Possible video frame formats.
The list of accepted formats are all ffmpeg
pixel formats. For a complete list run:
ffmpeg -pix_fmts
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]
.