## lamemp3enc lamemp3enc — High-quality free MP3 encoder |

## Synopsis

    struct              GstLameMP3Enc;

## Object Hierarchy

      GObject
       +----GstObject
             +----GstElement
                   +----GstLameMP3Enc

## Implemented Interfaces

GstLameMP3Enc implements GstPreset.

## Properties

      "bitrate"                  gint                  : Read / Write
      "cbr"                      gboolean              : Read / Write
      "encoding-engine-quality"  GstLameMP3EncEncodingEngineQuality  : Read / Write
      "mono"                     gboolean              : Read / Write
      "quality"                  gfloat                : Read / Write
      "target"                   GstLameMP3EncTarget   : 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.

### 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.

### Example pipelines

    1
    gst-launch -v audiotestsrc wave=sine num-buffers=100 ! audioconvert ! lamemp3enc ! filesink location=sine.mp3

Encode a test sine signal to MP3.

    1
    gst-launch -v alsasrc ! audioconvert ! lamemp3enc target=bitrate bitrate=192 ! filesink location=alsasrc.mp3

Record from a sound card using ALSA and encode to MP3 with an average bitrate of 192kbps

    1
    gst-launch -v filesrc location=music.wav ! decodebin ! audioconvert ! audioresample ! lamemp3enc target=quality quality=0 ! id3v2mux ! filesink location=music.mp3

Transcode from a .wav file to MP3 (the id3v2mux element is optional) with best VBR quality

    1
    gst-launch -v cdda://5 ! audioconvert ! lamemp3enc target=bitrate cbr=true bitrate=192 ! filesink location=track5.mp3

Encode Audio CD track 5 to MP3 with a constant bitrate of 192kbps

    1
    gst-launch -v audiotestsrc num-buffers=10 ! audio/x-raw-int,rate=44100,channels=1 ! lamemp3enc target=bitrate cbr=true bitrate=48 ! filesink location=test.mp3

Encode to a fixed sample rate

## Synopsis

### Element Information

plugin | lame
author | Sebastian Dröge <sebastian.droege@collabora.co.uk>
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 GstLameMP3Enc

    struct GstLameMP3Enc;

Opaque data structure.

## Property Details

### The `"bitrate"` property

      "bitrate"                  gint                  : Read / Write

Bitrate in kbit/sec (Only valid if target is bitrate, for CBR one of 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 or 320).

Allowed values: [8,320]

Default value: 128

### The `"cbr"` property

      "cbr"                      gboolean              : Read / Write

Enforce constant bitrate encoding (Only valid if target is bitrate).

Default value: FALSE

### The `"encoding-engine-quality"` property

      "encoding-engine-quality"  GstLameMP3EncEncodingEngineQuality  : Read / Write

Quality/speed of the encoding engine, this does not affect the bitrate!.

Default value: Standard

### The `"mono"` property

      "mono"                     gboolean              : Read / Write

Enforce mono encoding.

Default value: FALSE

### The `"quality"` property

      "quality"                  gfloat                : Read / Write

VBR Quality from 0 to 10, 0 being the best (Only valid if target is quality).

Allowed values: [0,9.999]

Default value: 4

### The `"target"` property

      "target"                   GstLameMP3EncTarget   : Read / Write

Optimize for quality or bitrate.

Default value: Quality

## See Also

lame, mad, vorbisenc