Exmpeg.MediaInfo (exmpeg v0.3.0)

Copy Markdown View Source

Top-level result of Exmpeg.probe/1.

Mirrors what ffprobe -show_format -show_streams would print: a container-level summary plus a list of Exmpeg.Stream entries. Both shapes are stable across releases; new fields will only be added.

Summary

Functions

Convenience: list every stream matching kind.

Convenience: return the first stream matching kind, or nil.

Types

format()

@type format() :: %{
  name: String.t(),
  long_name: String.t() | nil,
  duration_s: float() | nil,
  bit_rate: integer(),
  start_time_s: float() | nil,
  nb_streams: non_neg_integer(),
  tags: %{optional(String.t()) => String.t()}
}

t()

@type t() :: %Exmpeg.MediaInfo{format: format(), streams: [Exmpeg.Stream.t()]}

Functions

all(media_info, kind)

@spec all(t(), Exmpeg.Stream.kind()) :: [Exmpeg.Stream.t()]

Convenience: list every stream matching kind.

first(media_info, kind)

@spec first(t(), Exmpeg.Stream.kind()) :: Exmpeg.Stream.t() | nil

Convenience: return the first stream matching kind, or nil.

iex> Exmpeg.MediaInfo.first(info, :video)
%Exmpeg.Stream{kind: :video, ...}