PDA

View Full Version : Transcoding from MP3 to PCM



lvkuznetsov
2015-01-28, 08:08
I am using LMS with SqueezeWRT player (which is essentially a router with OpenWRT firmware and squeezelite). This player does not include any mp3 decoder. So I had to set up my LMS to transcode from mp3 to pcm. After some research, I had found a solution:


mp3 pcm * *
# F
[lame] --decode -t --mp3input --silent $FILE$ -

in custom-convert.conf. That helped, but now I have two problems:

1) LMS does transcode mp3 files, but does not transcode mp3 radio streams, giving an error: "Slim::Player::Song::open (409) Error: Couldn't create command line for mp3 playback for "

2) the seek function doesn't work.

How can I fix that on my LMS?

Thanks in advance.

bpa
2015-01-28, 08:31
The custom-convert.conf file has a format which is detailed at the start of the convert.conf file.

The "# F" says the conversion only deal wioth files. The info in the convert.,conf file is as follows


#
# Capabilities
# I - can transcode from stdin
# F - can transcode from a named file
# R - can transcode from a remote URL (URL types unspecified)


So you probably need "# IF" but only if you don't use $FILE$ - so there are other changes needed.

I don't think lame support seeks - you may need to use another application to transcode MP3 to PCM which can seek (e.g. possibly ffmpeg using -ss) but this will also depend on LMS server.

I suspect ffmpeg instead of lame might solve both issues but depends on the server.

lvkuznetsov
2015-01-28, 13:09
Thanks for the answer. I am using LMS 7.9 on Mac OS X 10.8.5. Where can I find instructions about installing ffmpeg on OS X and using it with LMS? I tried to google that, but no luck :(

bpa
2015-01-28, 15:36
All I did was google "ffmpeg" and it produced this

https://www.ffmpeg.org/download.html#build-mac

You'll need to study command line options to create new custom-convert.conf line. I know noting about ffmpeg on OSX.

I created the following for handle remote streams to PCM (not sure if it actually works for PCM as I use ffmpeg to Flac) - you may need to change to play files as well. Since you are streaming PCM - output has to be converted to 44.1/16


# RB:{BITRATE=-B %B}
[ffmpeg] -loglevel quiet -i $FILE$ -f u16le -ar 44100 -ac 2 -