FormatParser.Video (format_parser v2.6.0)

A Video struct and functions.

The Video struct contains the fields format, width_px, height_px and nature.

Summary

Functions

Parses a video file or result.

Types

t()

@type t() :: %FormatParser.Video{
  format: atom() | nil,
  height_px: integer() | nil,
  nature: atom(),
  width_px: integer() | nil
}

Functions

parse(file)

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

Parses a video file or result.

  • If given a tuple {:error, file} where file is a binary, attempts to parse the video file.
  • If given a binary file, attempts to parse the video file.
  • For any other input, returns the input as-is.

Examples

iex> parse("video.mp4") # parsed video result

iex> parse({:error, "video.mp4"}) # parsed video result

iex> parse(:unexpected) :unexpected