View Source Xav.Frame (xav v0.6.0)

Audio/video frame.

Summary

Types

Possible audio samples formats.

t()

Possible video frame formats.

Functions

Creates a new audio/video frame.

Converts a frame to an Nx tensor.

Types

@type audio_format() :: :u8 | :s16 | :s32 | :s64 | :f32 | :f64

Possible audio samples formats.

@type format() :: audio_format() | video_format()
@type t() :: %Xav.Frame{
  data: binary(),
  format: format(),
  height: non_neg_integer() | nil,
  pts: integer(),
  samples: integer() | nil,
  type: :audio | :video,
  width: non_neg_integer() | nil
}
@type video_format() :: :rgb

Possible video frame formats.

Currently, only RGB is supported.

Functions

Link to this function

new(data, format, samples, pts)

View Source
@spec new(binary(), format(), integer(), integer()) :: t()
Link to this function

new(data, format, width, height, pts)

View Source
@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.