Exmpeg.Native (exmpeg v0.3.0)

Copy Markdown View Source

Low-level Rustler bindings to the rsmpeg Rust crate.

This module is private to the library. Use Exmpeg for the public API. Stub names must match the Rust NIF symbols verbatim (Rustler verifies arity at module load time); friendlier wrappers live below them.

Summary

Types

Input source. A plain string is a filesystem path; {:memory, binary} hands the entire input buffered in memory to a custom AVIOContext.

Functions

Stream-copy concatenation of multiple inputs into a single output.

Decodes the best audio stream and writes it as a 16-bit PCM WAV.

Decodes a single video frame at a timestamp and writes it as an image.

Probes a media file and returns format + per-stream metadata.

Stream-copies an input container to an output container.

Per-stream re-encode with codec / bitrate / scale / fps selection.

Reports the FFmpeg version + configure flags this NIF is linked against.

Types

input_source()

@type input_source() :: String.t() | {:memory, binary()}

Input source. A plain string is a filesystem path; {:memory, binary} hands the entire input buffered in memory to a custom AVIOContext.

Functions

concat(inputs, output, opts)

@spec concat([input_source()], String.t(), map()) :: {:ok, map()} | {:error, map()}

Stream-copy concatenation of multiple inputs into a single output.

extract_audio(input, output, opts)

@spec extract_audio(input_source(), String.t(), map()) ::
  {:ok, map()} | {:error, map()}

Decodes the best audio stream and writes it as a 16-bit PCM WAV.

extract_frame(input, output, opts)

@spec extract_frame(input_source(), String.t(), map()) ::
  {:ok, map()} | {:error, map()}

Decodes a single video frame at a timestamp and writes it as an image.

probe(source)

@spec probe(input_source()) :: {:ok, map()} | {:error, map()}

Probes a media file and returns format + per-stream metadata.

remux(input, output, opts)

@spec remux(input_source(), String.t(), map()) :: {:ok, map()} | {:error, map()}

Stream-copies an input container to an output container.

transcode(input, output, opts)

@spec transcode(input_source(), String.t(), map()) :: {:ok, map()} | {:error, map()}

Per-stream re-encode with codec / bitrate / scale / fps selection.

version()

@spec version() :: {:ok, map()} | {:error, map()}

Reports the FFmpeg version + configure flags this NIF is linked against.