View Source Membrane.Transcoder (Membrane Transcoder plugin v0.1.3)

Provides transcoding capabilities for audio and video streams in Membrane.

The bin takes an incoming stream on its input and converts it into the desired one as specified by the option. Transcoding is applied only if it is neccessary. The following video stream formats are supported:

The following audio stream formats are supported:

Bin options

Passed via struct Membrane.Transcoder.t/0

  • output_stream_format

    stream_format() | stream_format_module() | stream_format_resolver()

    Required
    An option specifying desired output format.

    Can be either:

    • a struct being a Membrane stream format,
    • a module in which Membrane stream format struct is defined,
    • a function which receives input stream format as an input argument and is supposed to return the desired output stream format or its module.
  • enforce_transcoding?

    boolean() | (stream_format() -> boolean())

    Default value: false
    If set to true, the input media stream will be decoded and encoded, even if the input stream format and the output stream format are the same type.

    Can be either:

    • a boolean,
    • a function that receives the input stream format and returns a boolean.

Pads

:input

Accepted formats:

format when Audio.is_audio_format(format) or Video.is_video_format(format)
Direction::input
Availability::always

:output

Accepted formats:

format when Audio.is_audio_format(format) or Video.is_video_format(format)
Direction::output
Availability::always

Summary

Types

Describes stream formats acceptable on the bin's input and output.

Describes stream format modules that can be used to define inputs and outputs of the bin.

Describes a function which can be used to provide output format based on the input format.

t()

Struct containing options for Membrane.Transcoder

Functions

Returns description of options available for this module

Types

stream_format()

Describes stream formats acceptable on the bin's input and output.

stream_format_module()

@type stream_format_module() ::
  Membrane.H264
  | Membrane.H265
  | Membrane.VP8
  | Membrane.RawVideo
  | Membrane.AAC
  | Membrane.Opus
  | Membrane.RawAudio

Describes stream format modules that can be used to define inputs and outputs of the bin.

stream_format_resolver()

@type stream_format_resolver() :: (stream_format() ->
                               stream_format() | stream_format_module())

Describes a function which can be used to provide output format based on the input format.

t()

@type t() :: %Membrane.Transcoder{
  enforce_transcoding?: boolean() | (stream_format() -> boolean()),
  output_stream_format:
    stream_format() | stream_format_module() | stream_format_resolver()
}

Struct containing options for Membrane.Transcoder

Functions

options()

@spec options() :: keyword()

Returns description of options available for this module