Announcement

Collapse
No announcement yet.

bitrate limiting of mp3 with lame/shineenc

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • bitrate limiting of mp3 with lame/shineenc

    I followed these steps to enable transcoding on my sheevaplug: http://wiki.slimdevices.com/index.ph...or_transcoding

    This works fine when transcoding FLACs.

    Unfortunately when trying to stream mp3s, Squeezebox-Server is clever tries to start LAME with the --mp3input flag.

    As shineenc does not support mp3s as inputfiles this flag is ignored by shineenc and thus it fails to transcode any mp3 stream to a lower bitrate.

    Can I force SB-Server to always pass PCM to Lame/ShineEnc, even if the input an mp3?

    I'm using 7.5.4 server right now.
    Did you know: SqueezePlayer will stream all your music to your Android device. Take your music everywhere!
    Remote Control + Streaming to your iPad? Squeezebox + iPad = SqueezePad
    Want to see a Weather Forecast on your Radio/Touch/Controller ? => why not try my Weather Forecast Applet
    Want to use the Headphones with your Controller ? => why not try my Headphone Switcher Applet

  • #2
    Funny. I've done the same thing with my Plug, but since 99.99% of my collection if FLAC, I never bothered to check MP3 sources until I saw your thread here.

    Sure enough, it doesn't work :-(

    Comment


    • #3
      bitrate limiting of mp3 with lame/shineenc

      On May 23, 2011, at 4:27 PM, SamS wrote:

      >
      > Funny. I've done the same thing with my Plug, but since 99.99% of my
      > collection if FLAC, I never bothered to check MP3 sources until I saw
      > your thread here.
      >
      > Sure enough, it doesn't work :-(


      You'd need to alter the transcoding line to add something before shine that decodes MP3 to PCM/WAV, maybe try mpg123 or madplay?

      Comment


      • #4
        Yeah, but I don't want Shine to transcode MP3 to something higher... When I use this functionality, I'm streaming to my iPhone via 3G.

        Comment


        • #5
          Originally posted by andyg
          You'd need to alter the transcoding line to add something before shine that decodes MP3 to PCM/WAV, maybe try mpg123 or madplay?
          What file would that be?
          The ominous convert.conf sometimes mentioned in this forum (which I never dared to look at yet) ?
          In there I guess will be something similar for FLAC is this gets converted to WAV as well before sending to lame/shine.
          Did you know: SqueezePlayer will stream all your music to your Android device. Take your music everywhere!
          Remote Control + Streaming to your iPad? Squeezebox + iPad = SqueezePad
          Want to see a Weather Forecast on your Radio/Touch/Controller ? => why not try my Weather Forecast Applet
          Want to use the Headphones with your Controller ? => why not try my Headphone Switcher Applet

          Comment


          • #6
            ok - it's convert conf indeed.

            Entered/replaced the following line
            Code:
            mp3 mp3 transcode *
                    [mpg123] -q -s $FILE$ | [lame] --silent -q $QUALITY$ -v $BITRATE$ $RESAMPLE - -
            but doesn't seem to work yet, songs are just skipping.

            Is there any log that would help me debug this stuff or where I could see an error message?

            Actually with the command above mpg123 will receive a stream from STDIN and route that to STDOUT into lame, working fine on the console.
            Or am I not allowed to write [mpg123] ?
            Last edited by bluegaspode; 2011-05-24, 23:46.
            Did you know: SqueezePlayer will stream all your music to your Android device. Take your music everywhere!
            Remote Control + Streaming to your iPad? Squeezebox + iPad = SqueezePad
            Want to see a Weather Forecast on your Radio/Touch/Controller ? => why not try my Weather Forecast Applet
            Want to use the Headphones with your Controller ? => why not try my Headphone Switcher Applet

            Comment


            • #7
              Using
              Code:
              madplay -Q --output=pcm:- $FILE$ | [lame] --silent -q $QUALITY$ -v $BITRATE$ $RESAMPLE - -
              I'm still not successful either.
              Tracks still skipping very fast.

              Using the
              madplay -Q --output=pcm:- $FILE$
              standalone I get white noise, which shows me, that madplay is called indeed and creates a lot of PCM data.

              Any more hints to get me on the right track?
              Last edited by bluegaspode; 2011-05-24, 23:49.
              Did you know: SqueezePlayer will stream all your music to your Android device. Take your music everywhere!
              Remote Control + Streaming to your iPad? Squeezebox + iPad = SqueezePad
              Want to see a Weather Forecast on your Radio/Touch/Controller ? => why not try my Weather Forecast Applet
              Want to use the Headphones with your Controller ? => why not try my Headphone Switcher Applet

              Comment


              • #8
                Got it: lame/shine want a wav as input, not pcm
                Thanks for watching me find the solution, sometime thinking loud helps a lot

                Right now I'm using the following, running fine on my sheeva

                Code:
                mp3 mp3 transcode *
                        madplay -Q --output=wave:- $FILE$ | [lame] --silent -q $QUALITY$ -v $BITRATE$ $RESAMPLE - -
                madplay taking 10% CPU
                shineenc 70% CPU


                Will update the Wiki tomorrow after trying to convince the faster mpg123 to output wav as well.
                Did you know: SqueezePlayer will stream all your music to your Android device. Take your music everywhere!
                Remote Control + Streaming to your iPad? Squeezebox + iPad = SqueezePad
                Want to see a Weather Forecast on your Radio/Touch/Controller ? => why not try my Weather Forecast Applet
                Want to use the Headphones with your Controller ? => why not try my Headphone Switcher Applet

                Comment


                • #9
                  Originally posted by bluegaspode
                  Right now I'm using the following, running fine on my sheeva

                  Code:
                  mp3 mp3 transcode *
                          madplay -Q --output=wave:- $FILE$ | [lame] --silent -q $QUALITY$ -v $BITRATE$ $RESAMPLE - -
                  I would think you'd want to keep the second line of the rule that defines $BITRATE$, otherwise your maximum bitrate in complex sections of audio could be as high as 320 kbps. Of course that will depend a lot on how closely shine emulates LAME and whether it supports the '-B <bitrate>' option.

                  Code:
                  mp3 mp3 transcode *
                  	# IFB:{BITRATE=-B %B}D:{RESAMPLE=--resample %D}
                          madplay -Q --output=wave:- $FILE$ | [lame] --silent -q $QUALITY$ -v $BITRATE$ $RESAMPLE - -
                  You might want to play with the encoding level, which could affect CPU usage, audio quality and outgoing bandwidth. The -v is equivalent to -V4, while -B <bitrate> caps the maximum encoding bitrate.

                  Comment


                  • #10
                    Originally posted by JJZolx
                    You might want to play with the encoding level, which could affect CPU usage, audio quality and outgoing bandwidth. The -v is equivalent to -V4, while -B <bitrate> caps the maximum encoding bitrate.
                    shine does not have much parameters - only the desired target bitrate.
                    So the lame command gets translated into
                    shinenc -q -b 96 - -

                    I found a working line for mpg123 now as well:

                    [mpg123] -q -s -w - $FILE$ | [lame] --silent -q $QUALITY$ -v $BITRATE$ $RESAMPLE - -


                    wiki has been update now: http://wiki.slimdevices.com/index.ph...or_transcoding
                    Last edited by bluegaspode; 2011-05-25, 20:49.
                    Did you know: SqueezePlayer will stream all your music to your Android device. Take your music everywhere!
                    Remote Control + Streaming to your iPad? Squeezebox + iPad = SqueezePad
                    Want to see a Weather Forecast on your Radio/Touch/Controller ? => why not try my Weather Forecast Applet
                    Want to use the Headphones with your Controller ? => why not try my Headphone Switcher Applet

                    Comment


                    • #11
                      Problems installing shine on Sheeva (Squeezeplug)

                      Hi there.

                      First I would like to thank all of you Linux-wizards for sharing the fruits of your efforts. I'm very pleased with Squeezeplayer on my HTC Desire.

                      I'm trying to install shine for transcoding on my Sheevaplug, following the instructions in the wiki mentioned above.

                      I'm just copy-pasting the commands in the wiki into my command shell from webmin.

                      I'm stuck at step 2. When I enter this command I get the following:

                      > svn co http://svn.slimdevices.com/repos/sli...or/shine-fixed
                      svn: 'shine-fixed' already exists and is not a directory

                      What am I doing wrong?

                      Kind regards,
                      Setup: Living room: 1 Raspberry Pi 2 with Max2Play as server and Squeezelite (Hifiberry), Kitchen: 1 Radio, Room: 1 Boom
                      Logitech Media Server Version: 8.0.0 - 1594451286 @ Sat Jul 11 09:20:48 CEST 2020
                      http://www.last.fm/user/adjunkten | http://www.lektoren.dk

                      Comment


                      • #12
                        Try removing the file shine-fixed with

                        rm shine-fixed

                        before running the svn command again.

                        Alternatively, you can follow the instructions from this post to download and install a prebuilt debian armel (squeezeplug) shinenc binary and lame script.
                        Ralphy

                        1-Touch, 5-Classics, 3-Booms, 2-UE Radio
                        Squeezebox client builds donations always appreciated.

                        Comment


                        • #13
                          I can report that I succesfully installed ralphy's (?) script and I'm now streaming a transcoded flac to 192 kbps mp3 remotely from my Squeezeplug. Sound quality is OK (i understand shine is inferior to lame ?)and no hickups so far.

                          Also works on my Desire - I guess I'm having my music library in my pocket!

                          Amazing - thanks ralphy.
                          Setup: Living room: 1 Raspberry Pi 2 with Max2Play as server and Squeezelite (Hifiberry), Kitchen: 1 Radio, Room: 1 Boom
                          Logitech Media Server Version: 8.0.0 - 1594451286 @ Sat Jul 11 09:20:48 CEST 2020
                          http://www.last.fm/user/adjunkten | http://www.lektoren.dk

                          Comment


                          • #14
                            frustrated

                            I can't get this to work. Tried calling shineenc directly, tried replacing it with a Ruby script that also writes out the arguments to a tmpfile, but it never gets called!

                            Please help me, I need this to have 3G streaming of my music...

                            Comment


                            • #15
                              Did you see the following wiki-page: http://wiki.slimdevices.com/index.ph...or_transcoding

                              It summarizes all steps needed.
                              The posts here on the forum all were about FLAC to mp3 transcoding. If you are having mp3s then additional steps (as described on the wiki) need to be taken.
                              Did you know: SqueezePlayer will stream all your music to your Android device. Take your music everywhere!
                              Remote Control + Streaming to your iPad? Squeezebox + iPad = SqueezePad
                              Want to see a Weather Forecast on your Radio/Touch/Controller ? => why not try my Weather Forecast Applet
                              Want to use the Headphones with your Controller ? => why not try my Headphone Switcher Applet

                              Comment

                              Working...
                              X
                              😀
                              🥰
                              🤢
                              😎
                              😡
                              👍
                              👎