View Source Membrane.Opus.Encoder (Membrane Opus plugin v0.20.5)
This element performs encoding of Opus audio into a raw stream. You'll need to parse the stream and then package it into a container in order to use it.
Element options
Passed via struct Membrane.Opus.Encoder.t/0
application
allowed_applications()
Default value:
:audio
Output type (similar to compression amount).bitrate
allowed_bitrates()
Default value:
:auto
Explicit control of the Opus codec bitrate. This can be :auto (default, OPUS_BITRATE_AUTO), :max (OPUS_BITRATE_MAX) or a value from 500 to 512000 bits per second.See https://www.opus-codec.org/docs/html_api/group__opusencoder.html and https://www.opus-codec.org/docs/html_api/group__encoderctls.html#ga0bb51947e355b33d0cb358463b5101a7
signal_type
allowed_signal_types()
Default value:
:auto
Explicit control of the Opus signal type. This can be :auto (default, OPUS_SIGNAL_AUTO), :voice (OPUS_SIGNAL_VOICE) or :music (OPUS_SIGNAL_MUSIC)See https://www.opus-codec.org/docs/html_api/group__opusencoder.html and https://www.opus-codec.org/docs/html_api/group__encoderctls.html#gaaa87ccee4ae46aa6c9528e03c5122b89
input_stream_format
RawAudio.t()
Default value:
nil
Input type - used to set input sample rate and channels.
Pads
:input
Accepted formats:
%RawAudio{sample_format: :s16le, channels: channels, sample_rate: sample_rate}
when channels in @allowed_channels and sample_rate in @allowed_sample_rates
Membrane.RemoteStream
Direction: | :input |
Availability: | :always |
Flow control: | :auto |
:output
Accepted formats:
%Opus{self_delimiting?: false}
Direction: | :output |
Availability: | :always |
Flow control: | :auto |
Summary
Types
Struct containing options for Membrane.Opus.Encoder
Types
@type allowed_applications() :: :voip | :audio | :low_delay
@type allowed_bitrates() ::
:auto
| :max
| 10000
| 24000
| 32000
| 64000
| 96000
| 128_000
| 256_000
| 450_000
@type allowed_channels() :: 1 | 2
@type allowed_sample_rates() :: 8000 | 12000 | 16000 | 24000 | 48000
@type allowed_signal_types() :: :auto | :voice | :music
@type t() :: %Membrane.Opus.Encoder{ application: allowed_applications(), bitrate: allowed_bitrates(), input_stream_format: Membrane.RawAudio.t(), signal_type: allowed_signal_types() }
Struct containing options for Membrane.Opus.Encoder
Functions
@spec options() :: keyword()
Returns description of options available for this module