Membrane Caps: Video Raw v0.1.0 Membrane.Caps.Video.Raw View Source

This module provides caps struct for raw video frames.

Link to this section Summary

Types

Determines, whether buffers are aligned i.e. each buffer contains one frame

Format used to encode color of each pixel in each video frame

Number of frames per second. To avoid using floating point numbers, it is described by 2 integers number of frames per timeframe in seconds

Height of single frame in pixels

t()

Width of single frame in pixels

Functions

Simple wrapper over frame_size/3. Returns the size of raw video frame in bytes for the given caps

Returns the size of raw video frame in bytes (without padding)

Link to this section Types

Link to this type aligned_t() View Source
aligned_t() :: boolean()

Determines, whether buffers are aligned i.e. each buffer contains one frame.

Link to this type format_t() View Source
format_t() ::
  :I420 | :I422 | :I444 | :RGB | :BGRA | :RGBA | :NV12 | :NV21 | :YV12 | :AYUV

Format used to encode color of each pixel in each video frame.

Link to this type framerate_t() View Source
framerate_t() :: {frames :: non_neg_integer(), seconds :: pos_integer()}

Number of frames per second. To avoid using floating point numbers, it is described by 2 integers number of frames per timeframe in seconds.

For example, NTSC’s framerate of ~29.97 fps is represented by {30_000, 1001}

Height of single frame in pixels.

Link to this type t() View Source
t() :: %Membrane.Caps.Video.Raw{
  aligned: aligned_t(),
  format: format_t(),
  framerate: framerate_t(),
  height: height_t(),
  width: width_t()
}

Width of single frame in pixels.

Link to this section Functions

Link to this function frame_size(raw) View Source
frame_size(t()) :: Bunch.Type.try_t(pos_integer())

Simple wrapper over frame_size/3. Returns the size of raw video frame in bytes for the given caps.

Link to this function frame_size(format, width, height) View Source
frame_size(Raw.format_t(), Raw.width_t(), Raw.height()) ::
  Bunch.Type.try_t(pos_integer())

Returns the size of raw video frame in bytes (without padding).

It may result in error when dimensions don’t fulfill requirements for the given format (e.g. I420 requires both dimensions to be divisible by 2).