<?sphp $this->text('pagetitle') ?>
 
Home of the Squeezebox™ & Transporter® network music players.

Shine for transcoding

From SqueezeboxWiki

Jump to: navigation, search

To use the bitrate limiting feature or to stream music as MP3 from your Squeezebox Server to 3rd-party music players like Winamp, LAME is usually used. However, on devices like the SheevaPlug, LAME is much too slow, since these devices lack a floating point unit. There is however an application called shine, which can be used instead of LAME to achieve the same functionality. This article describes how to install shine and integrate it with Squeezebox Server.

Note that the quality of the mp3s generated with shinenc is worse than with LAME, since it is a very simple encoder. On the other hand it is fast enough to run on the SheevaPlug, so it is the best option available. It is recommended to use the highest possible bitrate to minimize the additional quality loss in comparison to LAME.

Installing Shine

Unfortunately, there don't seem to be any packages for shine, so you have to compile it yourself as follows:

  • Install build tools and subversion
    • Ubuntu/Debian (run as root):
apt-get install build-essential subversion
  • Download shine:
svn co http://svn.slimdevices.com/repos/slim/7.6/trunk/vendor/shine-fixed
  • Compile it:
cd shine-fixed
make
  • Copy shineenc to the right location:
    • Ubuntu/Debian (run as root):
cp shineenc /usr/share/squeezeboxserver/Bin/arm-linux
  • Download shineenc wrapper script:
wget http://zoopnet.de/shineenc-wrapper/lame
chmod 755 lame
  • Copy wrapper to the right location:
    • Ubuntu/Debian (run as root):
cp lame /usr/share/squeezeboxserver/Bin/arm-linux

enable mp3 transcoding

if you only have FLAC files then the above steps will be sufficient. If you need transcoding of mp3 some more steps are required, as the Squeezebox-Server tries to hand the mp3s over to Shine (which only understands WAV).

So lets first install a decoder, that can convert our mp3 into WAV.

apt-get install mpg123

Now we need to update the file /etc/squeezeboxserver/convert.conf. I typically use the 'nano' tool

nano /etc/squeezeboxserver/convert.conf

Scroll down until you find (quite at the end of that file) the following lines (Strg-v will scroll down in pages in nano)

# special case for smart bitrates on mp3 input
mp3 mp3 transcode *
      # IFB:{BITRATE=-B %B}D:{RESAMPLE=--resample %D}
      [lame] --silent -q $QUALITY$ -v $BITRATE$ $RESAMPLE$ --mp3input $FILE$ -

and change these to

# special case for smart bitrates on mp3 input
mp3 mp3 transcode *
      # IFB:{BITRATE=-B %B}D:{RESAMPLE=--resample %D}
      [mpg123] -q -s -w - $FILE$ | [lame] --silent -q $QUALITY$ -v $BITRATE$ $RESAMPLE - -

(only the last line changed). Leave nano with STRG-x and answer 'yes' to save the changes. Restart Squeezebox-Server

/etc/init.d/squeezeboxserver restart
 

Now also your mp3 will be transcoded to the desired bitrate.

Configuration

No special configuration should be necessary. When a bitrate limit is set, shineenc will be used to reencode stream to mp3 with the desired bitrate (if they otherwise would exceed the bitrate limit). It will also be used to reencode non-mp3 files that get streamed via the stream.mp3 URL.