Membrane.MP3.Lame.Encoder
(Membrane MP3 Lame Plugin v0.18.6)
View Source
Element encoding raw audio into MPEG-1, layer 3 format
Element options
Passed via struct Membrane.MP3.Lame.Encoder.t/0
gapless_flushboolean()Default value:
true
When this option is set to true, encoder will be flushed without outputting any tags and allowing to play such file gaplessly if concatenated with another file.bitratepos_integer() | nilDefault value:
nil
Deprecated: pass the bitrate via therate_controloption instead, e.g.rate_control: {:cbr, bitrate: 192}.Output bitrate of encoded stream in kbit/sec, defaults to 192.
qualitynon_neg_integer()Default value:
5
Value of this parameter affects quality by selecting one of the algorithms for encoding:0being best (and very slow) and9being worst.Recommended values:
2- near-best quality, not too slow5- good quality, fast7- ok quality, really fast
disable_reservoirboolean()Default value:
false
When set to true, disables the LAME bit reservoir. This makes each MP3 frame self-contained (main_data_begin is always 0), so frames can be cleanly spliced at any boundary without decoder artifacts.Useful for live streaming with ad insertion where audio from different sources is concatenated.
rate_control:cbr | {:cbr, bitrate: pos_integer()} | {:vbr, vbr_config()}Default value:
:cbr
Rate control mode for the encoder::cbr- Constant Bitrate at the default bitrate (192 kbps).{:cbr, bitrate: kbps}- Constant Bitrate at the given bitrate.{:vbr, config}- Variable Bitrate. Seevbr_config/0for details.
Pads
:input
Accepted formats:
%RawAudio{sample_format: :s32le, sample_rate: 44100, channels: 2}Membrane.RemoteStream| Direction: | :input |
| Availability: | :always |
| Flow control: | :auto |
:output
Accepted formats:
%MPEGAudio{channels: 2, sample_rate: 44100, layer: :layer3, version: :v1}| Direction: | :output |
| Availability: | :always |
| Flow control: | :auto |
Summary
Types
Struct containing options for Membrane.MP3.Lame.Encoder
VBR configuration for the rate_control option.
Types
@type t() :: %Membrane.MP3.Lame.Encoder{ bitrate: pos_integer() | nil, disable_reservoir: boolean(), gapless_flush: boolean(), quality: non_neg_integer(), rate_control: :cbr | {:cbr, [{:bitrate, pos_integer()}]} | {:vbr, vbr_config()} }
Struct containing options for Membrane.MP3.Lame.Encoder
@type vbr_config() :: [ mode: :mt | :rh | :abr | :mtrh | :default, mean_bitrate: pos_integer(), quality: number(), min_bitrate: pos_integer(), max_bitrate: pos_integer(), hard_min: boolean() ]
VBR configuration for the rate_control option.
For details, see Lame's header file: https://sourceforge.net/p/lame/svn/HEAD/tree/trunk/lame/include/lame.h
Available options:
:mode(required) - Sets the algorithm vialame_set_VBR.:mean_bitrate(required for:abr, not allowed otherwise) - target average bitrate in kbps. Callslame_set_VBR_mean_bitrate_kbps.:quality(only for:rh,:mt,:mtrh,:default) - VBR quality level as a number in[0, 10)(0 = best, 9 = worst). Callslame_set_VBR_quality, which accepts fractional values for finer-grained control. If omitted, LAME's default is used.:min_bitrate- minimum allowed bitrate in kbps. Seelame_set_VBR_min_bitrate_kbpsfor reference.:max_bitrate- maximum allowed bitrate in kbps. Callslame_set_VBR_max_bitrate_kbps.:hard_min(boolean) - strictly enforce:min_bitrateeven for silence. Callslame_set_VBR_hard_min.
Functions
@spec options() :: keyword()
Returns description of options available for this module