1

I'm trying to use gstreamer at odroid C1+. I installed gstreamer, base, good, ugly, bad, libav getting from here https://gstreamer.freedesktop.org/modules/

following here http://linuxfromscratch.org/blfs/view/svn/index.html

But when I run like this

gst-launch-1.0 -e pulsesrc device="alsa_input.usb-046d_0809_52A63768-02.analog-mono" ! audioconvert !    lamemp3enc target=1 bitrate=64 cbr=true ! filesink location=audio.mp3

I get error

WARNING: erroneous pipeline: no element "lamemp3enc"

How should I do?

++

I run

GST_PLUGIN_PATH=/usr/lib/gstreamer-1.0/ gst-inspect-1.0 lamemp3enc

and get

Factory Details:
  Rank                     primary (256)
  Long-name                L.A.M.E. mp3 encoder
  Klass                    Codec/Encoder/Audio
  Description              High-quality free MP3 encoder
  Author                   Sebastian Dröge <sebastian.droege@collabora.co.uk>

Plugin Details:
  Name                     lame
  Description              Encode MP3s with LAME
  Filename                 /usr/lib/gstreamer-1.0/libgstlame.so
  Version                  1.8.1
  License                  LGPL
  Source module            gst-plugins-ugly
  Source release date      2016-04-20
  Binary package           GStreamer Ugly Plugins 1.8.1 BLFS
  Origin URL               http://www.linuxfromscratch.org/blfs/view/svn/

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstAudioEncoder
                         +----GstLameMP3Enc

Implemented Interfaces:
  GstPreset

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      audio/x-raw
                 format: S16LE
                 layout: interleaved
                   rate: { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }
               channels: 1
      audio/x-raw
                 format: S16LE
                 layout: interleaved
                   rate: { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }
               channels: 2
           channel-mask: 0x0000000000000003

  SRC template: 'src'
    Availability: Always
    Capabilities:
      audio/mpeg
            mpegversion: 1
                  layer: 3
                   rate: { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }
               channels: [ 1, 2 ]


Element Flags:
  no flags set

Element Implementation:
  Has change_state() function: gst_audio_encoder_change_state

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SINK: 'sink'
    Pad Template: 'sink'
  SRC: 'src'
    Pad Template: 'src'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "lamemp3enc0"
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  perfect-timestamp   : Favour perfect timestamps over tracking upstream timestamps
                        flags: readable, writable
                        Boolean. Default: false
  mark-granule        : Apply granule semantics to buffer metadata (implies perfect-timestamp)
                        flags: readable
                        Boolean. Default: false
  hard-resync         : Perform clipping and sample flushing upon discontinuity
                        flags: readable, writable
                        Boolean. Default: false
  tolerance           : Consider discontinuity if timestamp jitter/imperfection exceeds tolerance (ns)
                        flags: readable, writable
                        Integer64. Range: 0 - 9223372036854775807 Default: 40000000 
  target              : Optimize for quality or bitrate
                        flags: readable, writable
                        Enum "GstLameMP3EncTarget" Default: 0, "quality"
                           (0): quality          - Quality
                           (1): bitrate          - Bitrate
  bitrate             : 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)
                        flags: readable, writable
                        Integer. Range: 8 - 320 Default: 128 
  cbr                 : Enforce constant bitrate encoding (Only valid if target is bitrate)
                        flags: readable, writable
                        Boolean. Default: false
  quality             : VBR Quality from 0 to 10, 0 being the best (Only valid if target is quality)
                        flags: readable, writable
                        Float. Range:               0 -           9.999 Default:               4 
  encoding-engine-quality: Quality/speed of the encoding engine, this does not affect the bitrate!
                        flags: readable, writable
                        Enum "GstLameMP3EncEncodingEngineQuality" Default: 1, "standard"
                           (0): fast             - Fast
                           (1): standard         - Standard
                           (2): high             - High
  mono                : Enforce mono encoding
                        flags: readable, writable
                        Boolean. Default: false

Presets:
  "Ubuntu"
Potato
  • 181
  • 1
  • 2
  • 13

1 Answers1

0

what OS are you running on odroid (Android/Ubuntu?) what gives gst-inspect-1.0 lamemp3enc.. there is library path .. you can ldd it:

ldd /usr/local/lib/gstreamer-1.0/libgstlame.so

linux-vdso.so.1 =>  (0x00007ffc7dbed000)
libgstaudio-1.0.so.0 => /usr/local/lib/libgstaudio-1.0.so.0 (0x00007f4a97faa000)
libgstbase-1.0.so.0 => /usr/local/lib/libgstbase-1.0.so.0 (0x00007f4a97d4c000)
libgstreamer-1.0.so.0 => /usr/local/lib/libgstreamer-1.0.so.0 (0x00007f4a97a31000)
libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f4a977e0000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f4a974d8000)
libmp3lame.so.0 => /usr/lib/x86_64-linux-gnu/libmp3lame.so.0 (0x00007f4a9724a000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4a9702c000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4a96c67000)
libgsttag-1.0.so.0 => /usr/local/lib/libgsttag-1.0.so.0 (0x00007f4a96a2d000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4a96727000)
liborc-0.4.so.0 => /usr/local/lib/liborc-0.4.so.0 (0x00007f4a964a4000)
libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f4a9629f000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f4a96097000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4a95e93000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f4a95c8a000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f4a95a4c000)
/lib64/ld-linux-x86-64.so.2 (0x0000558c95a32000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f4a95833000)

Check if you have all libs .. you need especially libmp3lame.so ..

You can always use apt-file tool to check which package provides this lib.. but its quite apparent that its this package (run as root or sudo):

apt-get install libmp3lame-dev

If you did not have it at compile time (I guess you compiled as you linked linuxfromscratch..) you need to recomiple gst-plugins-ugly after installing this lib..

Then check the last part at when you rerun configure at ugly (I would suggest using autogen.sh instead.. but I dont know your environment..) which should mention if you will have mp3 builded..

UPDATE

So you just need to set the env variable GST_PLUGIN_PATH. Gstreamer just haven't known where to look for the gstreamer mp3 plugin..

you can export the env variable.. say in ~/.basrhc:

export GST_PLUGIN_PATH=/usr/lib/gstreamer-1.0/

and then just the same pipe will work perfectly, this is simpler one (tested, works):

gst-launch-1.0 -e audiotestsrc ! audioconvert ! lamemp3enc ! filesink location=audio.mp3

HTH

nayana
  • 3,787
  • 3
  • 20
  • 51
  • Thank you for answering me. I'm running Ubuntu. I got "No such element or plugin 'lamemp3enc'" when I commanded `gst-inspect-1.0 lamemp3enc`. And there is no libgstlame.so file in /usr/lib/gstreamer-1.0. You mean I should install libgstlame.so, or libmpelame.so. Could you tell me what is the best way to install it? – Potato Jun 03 '16 at 10:58
  • check the presence of libmp3lame.. the libgstlame.so you are going to compile .. so check if you have it and then recompile ugly.. and dont search there - its my specific location (the /usr/local/lib .. you probably will have it in /usr/lib/something/gstreamer-1.0/ ) – nayana Jun 03 '16 at 11:30
  • Yeah, mine is /usr/lib/gstreamer-1.0. And there is no libmp3lame and libgstlame.so. – Potato Jun 03 '16 at 11:42
  • @Potato no.. the libmp3lame is system-wide lib .. you should search system dirs.. try `locate libmp3lame.so` .. I have it in `/usr/lib/x86_64-linux-gnu/libmp3lame.so` .. but my guess is you really do not have it so you may install it with apt-get .. I will update the answer soon how to do this.. – nayana Jun 03 '16 at 13:08
  • Aha, I checked it and it is in `/usr/lib/x86_64-linux-gnu/libmpelame.so. And also checked libgstlame.so is in /usr/lib/gstreamer-1.0/libgstlame.so. – Potato Jun 04 '16 at 03:09
  • @Potato ok so there must bu some other problem.. and it must be libmp3lame.so not mpelame.. but I think its just typo.. what trying this: `GST_PLUGIN_PATH=/usr/lib/gstreamer-1.0/ gst-inspect-1.0 lamemp3enc` .. also check [this](https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gst-running.html) – nayana Jun 06 '16 at 06:35
  • Ok, I plussed result of `GST_PLUGIN_PATH=/usr/lib/gstreamer-1.0/ gst-inspect-1.0 lamemp3enc` to my post. – Potato Jun 07 '16 at 04:05
  • @Potato well then you have your answer :) just set the environment variable GST_PLUGIN_PATH and you are good to go, I will update the answer – nayana Jun 07 '16 at 06:39
  • 1
    Oh god, thank you. After `export GST_PLUGIN_PATH=/usr/lib/gstreamer-1.0/`, it works. Thank you so much. – Potato Jun 07 '16 at 08:09