lame

lame

Properties

gboolean allow-diff-short Read / Write
gint ath-lower Read / Write
gboolean ath-only Read / Write
gboolean ath-short Read / Write
gint bitrate Read / Write
gfloat compression-ratio Read / Write
gboolean copyright Read / Write
gint cwlimit Read / Write
gboolean disable-reservoir Read / Write
gboolean emphasis Read / Write
gboolean error-protection Read / Write
gboolean extension Read / Write
gboolean force-ms Read / Write
gboolean free-format Read / Write
gint highpass-freq Read / Write
gint highpass-width Read / Write
gint lowpass-freq Read / Write
gint lowpass-width Read / Write
GstLameMode mode Read / Write
gboolean no-ath Read / Write
gboolean no-short-blocks Read / Write
gboolean original Read / Write
GstLamePadding padding-type Read / Write
GstLamePreset preset Read / Write
GstLameQuality quality Read / Write
gboolean strict-iso Read / Write
GstLameVbrmode vbr Read / Write
gint vbr-hard-min Read / Write
gint vbr-max-bitrate Read / Write
gint vbr-mean-bitrate Read / Write
gint vbr-min-bitrate Read / Write
GstLameQuality vbr-quality Read / Write
gboolean xingheader Read / Write

Types and Values

struct GstLame

Object Hierarchy

    GObject
    ╰── GstObject
        ╰── GstElement
            ╰── GstAudioEncoder
                ╰── GstLame

Implemented Interfaces

GstLame implements GstTagSetter and GstPreset.

Description

This element encodes raw integer audio into an MPEG-1 layer 3 (MP3) stream. Note that MP3 is not a free format, there are licensing and patent issues to take into consideration. See Ogg/Vorbis for a royalty free (and often higher quality) alternative.

Note

This element is deprecated, use the lame element instead which provides a much simpler interface and results in better MP3 files.

Output sample rate

If no fixed output sample rate is negotiated on the element's src pad, the element will choose an optimal sample rate to resample to internally. For example, a 16-bit 44.1 KHz mono audio stream encoded at 48 kbit will get resampled to 32 KHz. Use filter caps on the src pad to force a particular sample rate.

Writing metadata (tags)

Whilst the lame encoder element does claim to implement the GstTagSetter interface, it does so only for backwards compatibility reasons. Tag writing has been removed from lame. Use external elements like id3v2mux or apev2mux to add tags to your MP3 streams. The same goes for XING headers: use the xingmux element to add XING headers to your VBR mp3 file.

Example pipelines

1
gst-launch -v audiotestsrc wave=sine num-buffers=100 ! audioconvert ! lame ! filesink location=sine.mp3
Encode a test sine signal to MP3.
1
gst-launch -v alsasrc ! audioconvert ! lame bitrate=192 ! filesink location=alsasrc.mp3
Record from a sound card using ALSA and encode to MP3
1
gst-launch -v filesrc location=music.wav ! decodebin ! audioconvert ! audioresample ! lame bitrate=192 ! id3v2mux ! filesink location=music.mp3
Transcode from a .wav file to MP3 (the id3v2mux element is optional)
1
gst-launch -v cdda://5 ! audioconvert ! lame bitrate=192 ! filesink location=track5.mp3
Encode Audio CD track 5 to MP3
1
gst-launch -v audiotestsrc num-buffers=10 ! audio/x-raw-int,rate=44100,channels=1 ! lame bitrate=48 mode=3 ! filesink location=test.mp3
Encode to a fixed sample rate

Last reviewed on 2007-07-24 (0.10.7)

Functions

Types and Values

struct GstLame

struct GstLame;

Opaque data structure.

Property Details

The “allow-diff-short” property

  “allow-diff-short”         gboolean

Allow diff short.

Owner: GstLame

Flags: Read / Write

Default value: FALSE


The “ath-lower” property

  “ath-lower”                gint

lowers ATH by x dB.

Owner: GstLame

Flags: Read / Write

Default value: 3


The “ath-only” property

  “ath-only”                 gboolean

Ignore GPSYCHO completely, use ATH only.

Owner: GstLame

Flags: Read / Write

Default value: FALSE


The “ath-short” property

  “ath-short”                gboolean

Ignore GPSYCHO for short blocks, use ATH only.

Owner: GstLame

Flags: Read / Write

Default value: FALSE


The “bitrate” property

  “bitrate”                  gint

Bitrate in kbit/sec (8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 or 320).

Owner: GstLame

Flags: Read / Write

Allowed values: [0,320]

Default value: 128


The “compression-ratio” property

  “compression-ratio”        gfloat

let lame choose bitrate to achieve selected compression ratio.

Owner: GstLame

Flags: Read / Write

Allowed values: [0,200]

Default value: 0


The “copyright” property

  “copyright”                gboolean

Mark as copyright.

Owner: GstLame

Flags: Read / Write

Default value: FALSE


The “cwlimit” property

  “cwlimit”                  gint

Compute tonality up to freq (in kHz) default 8.8717 (DEPRECATED: this setting has no effect).

Owner: GstLame

Flags: Read / Write

Allowed values: [0,50000]

Default value: 0


The “disable-reservoir” property

  “disable-reservoir”        gboolean

Disable the bit reservoir.

Owner: GstLame

Flags: Read / Write

Default value: TRUE


The “emphasis” property

  “emphasis”                 gboolean

Emphasis.

Owner: GstLame

Flags: Read / Write

Default value: FALSE


The “error-protection” property

  “error-protection”         gboolean

Adds 16 bit checksum to every frame.

Owner: GstLame

Flags: Read / Write

Default value: FALSE


The “extension” property

  “extension”                gboolean

Extension.

Owner: GstLame

Flags: Read / Write

Default value: FALSE


The “force-ms” property

  “force-ms”                 gboolean

Force ms_stereo on all frames.

Owner: GstLame

Flags: Read / Write

Default value: FALSE


The “free-format” property

  “free-format”              gboolean

Produce a free format bitstream.

Owner: GstLame

Flags: Read / Write

Default value: FALSE


The “highpass-freq” property

  “highpass-freq”            gint

frequency(kHz), highpass filter cutoff below freq.

Owner: GstLame

Flags: Read / Write

Allowed values: [0,50000]

Default value: 0


The “highpass-width” property

  “highpass-width”           gint

frequency(kHz) - default 15% of highpass freq.

Owner: GstLame

Flags: Read / Write

Allowed values: >= -1

Default value: -1


The “lowpass-freq” property

  “lowpass-freq”             gint

frequency(kHz), lowpass filter cutoff above freq.

Owner: GstLame

Flags: Read / Write

Allowed values: [0,50000]

Default value: 17000


The “lowpass-width” property

  “lowpass-width”            gint

frequency(kHz) - default 15% of lowpass freq.

Owner: GstLame

Flags: Read / Write

Allowed values: >= -1

Default value: -1


The “mode” property

  “mode”                     GstLameMode

Encoding mode.

Owner: GstLame

Flags: Read / Write

Default value: Joint Stereo


The “no-ath” property

  “no-ath”                   gboolean

turns ATH down to a flat noise floor.

Owner: GstLame

Flags: Read / Write

Default value: FALSE


The “no-short-blocks” property

  “no-short-blocks”          gboolean

Do not use short blocks.

Owner: GstLame

Flags: Read / Write

Default value: FALSE


The “original” property

  “original”                 gboolean

Mark as original.

Owner: GstLame

Flags: Read / Write

Default value: TRUE


The “padding-type” property

  “padding-type”             GstLamePadding

Padding type (DEPRECATED: this setting has no effect).

Owner: GstLame

Flags: Read / Write

Default value: No Padding


The “preset” property

  “preset”                   GstLamePreset

Lame Preset.

Owner: GstLame

Flags: Read / Write

Default value: None


The “quality” property

  “quality”                  GstLameQuality

Quality of algorithm used for encoding.

Owner: GstLame

Flags: Read / Write

Default value: 3


The “strict-iso” property

  “strict-iso”               gboolean

Comply as much as possible to ISO MPEG spec.

Owner: GstLame

Flags: Read / Write

Default value: TRUE


The “vbr” property

  “vbr”                      GstLameVbrmode

Specify bitrate mode.

Owner: GstLame

Flags: Read / Write

Default value: No VBR (Constant Bitrate)


The “vbr-hard-min” property

  “vbr-hard-min”             gint

Specify whether min VBR bitrate is a hard limit. Normally, it can be violated for silence.

Owner: GstLame

Flags: Read / Write

Allowed values: [0,1]

Default value: 0


The “vbr-max-bitrate” property

  “vbr-max-bitrate”          gint

Specify maximum VBR bitrate (8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 or 320).

Owner: GstLame

Flags: Read / Write

Allowed values: [0,320]

Default value: 0


The “vbr-mean-bitrate” property

  “vbr-mean-bitrate”         gint

Specify mean VBR bitrate.

Owner: GstLame

Flags: Read / Write

Allowed values: [0,320]

Default value: 128


The “vbr-min-bitrate” property

  “vbr-min-bitrate”          gint

Specify minimum VBR bitrate (8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 or 320).

Owner: GstLame

Flags: Read / Write

Allowed values: [0,320]

Default value: 0


The “vbr-quality” property

  “vbr-quality”              GstLameQuality

VBR Quality.

Owner: GstLame

Flags: Read / Write

Default value: 4


The “xingheader” property

  “xingheader”               gboolean

Output Xing Header (BROKEN, use xingmux instead).

Owner: GstLame

Flags: Read / Write

Default value: FALSE

See Also

lame, mad, vorbisenc