## lame lame — High-quality free MP3 encoder (deprecated) |

## Synopsis

    struct              GstLame;

## Object Hierarchy

      GObject
       +----GstObject
             +----GstElement
                   +----GstLame

## Implemented Interfaces

GstLame implements GstTagSetter and GstPreset.

## Properties

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

## 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 lamemp3enc 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)

## Synopsis

### Element Information

plugin | lame
author | Erik Walthinsen <omega@cse.ogi.edu>, Wim Taymans <wim@fluendo.com>
class | Codec/Encoder/Audio

### Element Pads

name | sink
direction | sink
presence | always
details | audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int){ 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }, channels=(int)[ 1, 2 ]

name | src
direction | source
presence | always
details | audio/mpeg, mpegversion=(int)1, layer=(int)3, rate=(int){ 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }, channels=(int)[ 1, 2 ]

## Details

### struct GstLame

    struct GstLame;

Opaque data structure.

## Property Details

### The `"allow-diff-short"` property

      "allow-diff-short"         gboolean              : Read / Write

Allow diff short.

Default value: FALSE

### The `"ath-lower"` property

      "ath-lower"                gint                  : Read / Write

lowers ATH by x dB.

Default value: 3

### The `"ath-only"` property

      "ath-only"                 gboolean              : Read / Write

Ignore GPSYCHO completely, use ATH only.

Default value: FALSE

### The `"ath-short"` property

      "ath-short"                gboolean              : Read / Write

Ignore GPSYCHO for short blocks, use ATH only.

Default value: FALSE

### The `"bitrate"` property

      "bitrate"                  gint                  : Read / Write

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

Allowed values: [0,320]

Default value: 128

### The `"compression-ratio"` property

      "compression-ratio"        gfloat                : Read / Write

let lame choose bitrate to achieve selected compression ratio.

Allowed values: [0,200]

Default value: 0

### The `"copyright"` property

      "copyright"                gboolean              : Read / Write

Mark as copyright.

Default value: FALSE

### The `"cwlimit"` property

      "cwlimit"                  gint                  : Read / Write

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

Allowed values: [0,50000]

Default value: 0

### The `"disable-reservoir"` property

      "disable-reservoir"        gboolean              : Read / Write

Disable the bit reservoir.

Default value: TRUE

### The `"emphasis"` property

      "emphasis"                 gboolean              : Read / Write

Emphasis.

Default value: FALSE

### The `"error-protection"` property

      "error-protection"         gboolean              : Read / Write

Adds 16 bit checksum to every frame.

Default value: FALSE

### The `"extension"` property

      "extension"                gboolean              : Read / Write

Extension.

Default value: FALSE

### The `"force-ms"` property

      "force-ms"                 gboolean              : Read / Write

Force ms_stereo on all frames.

Default value: FALSE

### The `"free-format"` property

      "free-format"              gboolean              : Read / Write

Produce a free format bitstream.

Default value: FALSE

### The `"highpass-freq"` property

      "highpass-freq"            gint                  : Read / Write

frequency(kHz), highpass filter cutoff below freq.

Allowed values: [0,50000]

Default value: 0

### The `"highpass-width"` property

      "highpass-width"           gint                  : Read / Write

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

Allowed values: >= G_MAXULONG

Default value: -1

### The `"lowpass-freq"` property

      "lowpass-freq"             gint                  : Read / Write

frequency(kHz), lowpass filter cutoff above freq.

Allowed values: [0,50000]

Default value: 17000

### The `"lowpass-width"` property

      "lowpass-width"            gint                  : Read / Write

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

Allowed values: >= G_MAXULONG

Default value: -1

### The `"mode"` property

      "mode"                     GstLameMode           : Read / Write

Encoding mode.

Default value: Joint Stereo

### The `"no-ath"` property

      "no-ath"                   gboolean              : Read / Write

turns ATH down to a flat noise floor.

Default value: FALSE

### The `"no-short-blocks"` property

      "no-short-blocks"          gboolean              : Read / Write

Do not use short blocks.

Default value: FALSE

### The `"original"` property

      "original"                 gboolean              : Read / Write

Mark as original.

Default value: TRUE

### The `"padding-type"` property

      "padding-type"             GstLamePadding        : Read / Write

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

Default value: No Padding

### The `"preset"` property

      "preset"                   GstLamePreset         : Read / Write

Lame Preset.

Default value: None

### The `"quality"` property

      "quality"                  GstLameQuality        : Read / Write

Quality of algorithm used for encoding.

Default value: 3

### The `"strict-iso"` property

      "strict-iso"               gboolean              : Read / Write

Comply as much as possible to ISO MPEG spec.

Default value: TRUE

### The `"vbr"` property

      "vbr"                      GstLameVbrmode        : Read / Write

Specify bitrate mode.

Default value: No VBR (Constant Bitrate)

### The `"vbr-hard-min"` property

      "vbr-hard-min"             gint                  : Read / Write

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

Allowed values: [0,1]

Default value: 0

### The `"vbr-max-bitrate"` property

      "vbr-max-bitrate"          gint                  : Read / Write

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

Allowed values: [0,320]

Default value: 0

### The `"vbr-mean-bitrate"` property

      "vbr-mean-bitrate"         gint                  : Read / Write

Specify mean VBR bitrate.

Allowed values: [0,320]

Default value: 128

### The `"vbr-min-bitrate"` property

      "vbr-min-bitrate"          gint                  : Read / Write

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

Allowed values: [0,320]

Default value: 0

### The `"vbr-quality"` property

      "vbr-quality"              GstLameQuality        : Read / Write

VBR Quality.

Default value: 4

### The `"xingheader"` property

      "xingheader"               gboolean              : Read / Write

Output Xing Header (BROKEN, use xingmux instead).

Default value: FALSE

## See Also

lamemp3enc, mad, vorbisenc