ExFLV.Tag.VideoData (FLV muxer and demuxer v0.4.0)

View Source

Module describing flv VIDEODATA.

Summary

Functions

Creates a new VIDEODATA tag.

Parses the binary into a VIDEODATA tag.

Same as parse/1 but raises on error.

Types

codec_id()

@type codec_id() ::
  :jpeg
  | :sorenson_h263
  | :screen_video
  | :vp6
  | :vp6_alpha
  | :screen_video_v2
  | :avc

frame_type()

@type frame_type() ::
  :keyframe
  | :interframe
  | :disposable_interframe
  | :generated_keyframe
  | :command_frame

payload()

@type payload() :: iodata() | ExFLV.Tag.VideoData.AVC.t()

t()

@type t() :: %ExFLV.Tag.VideoData{
  codec_id: codec_id(),
  data: payload(),
  frame_type: frame_type()
}

Functions

new(data, codec_id, frame_type)

@spec new(payload(), codec_id(), frame_type()) :: t()

Creates a new VIDEODATA tag.

parse(arg)

@spec parse(binary()) :: {:ok, t()} | {:error, any()}

Parses the binary into a VIDEODATA tag.

parse!(data)

@spec parse!(binary()) :: t()

Same as parse/1 but raises on error.

iex> ExFLV.Tag.VideoData.parse!(<<34, 0, 1, 2, 3>>)
%ExFLV.Tag.VideoData{
  frame_type: :interframe,
  codec_id: :sorenson_h263,
  data: <<0, 1, 2, 3>>
}