Forums » Kodi (XBMC) as frontend »
How to use the LibreElec/Kodi addon "Lame MP3 Audio Encoder" from TVH?
Added by Dan G over 6 years ago
Hi - It's my first time here, although I've been using TVH for many years to record TV on my Kodi system. It works a treat - thank you.
I am now trying to transcode an Interent radio station stream (http://209.133.216.3:7048), from HE-AACv2 to MP3 using TVH. This is a radio station that I used to play on my Roku Soundbridge M1001, but they recently changed the codec to HE-AACv2 and my trusty old Soundbridge cannot hack it! Hence the transcoding to MP3 via TVH.
My set up: Raspberry Pi 1-B running LibreELEC v8.2.5 (Kodi v17.6 - Krypton) and TVH (HTS Tvheadend 4.2.6-7 ~ LibreELEC Tvh-addon v8.2.113). The Pi is overclocked.
In TVH, I set up an IPTV network and a mux (channel 5000) for the radio station and was hoping to use the following URL within the mux setup:
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://209.133.216.3:7048 -vn -acodec libmp3lame -flags +global_header -strict -2 -metadata service_provider=GFMSL -metadata service_name=GoldFM_SL -f mpegts -mpegts_service_type digital_radio pipe:1
Using the above mux URL, I was getting the error "Unknown encoder 'libmp3lame'". I quickly confirmed that lame was not configured into ffmpeg on LibreElec.
[ Aside: if I replace 'libmp3lame' with 'aac' in the above URL, it works, and I can access the transcoded stream from VLC on my PC using http://ip address of Pi:9981/stream/channelnumber/5000 ]
Fortunately (?), I found that LibreELEC comes with the 'Lame MP3 Audio Encoder v1.2.0.1' addon, so I installed this via Kodi.
Unfortunately, I still get the same error - "Unknown encoder 'libmp3lame'", even after re-booting.
How can I get TVH to use the installed and enabled 'Lame MP3 Audio Encoder v1.2.0.1' addon in the mux URL specified above?
Hope you can please help with this.
Many thanks!
EDIT: It struck me that maybe I can't use 'libmp3lame' as an argument to ffmpeg in the above manner, as libmp3lame isn't a part of this particular implementation of ffmpeg and hence would be 'out of scope' - correct? Or does installing the Lame addon make 'libmp3lame' available globally?
Maybe I have to get the input stream into Lame first and then pipe the output to ffmpeg? If piping is the way to go, I don't know the syntax of the pipe command or how to fit that into the URL field of the mux. I shall investigate further. However, my grasp of Linux is pretty basic, so if anyone could give me some pointers, or even the full syntax to put into the mux's URL field, that would be very much appreciated! :-)
UPDATE: Entering 'lame --h' at an SSH prompt resulted in 'lame: not found'. I wonder how to access the Lame addon on the RPi running LibreElec/Kodi?
Replies (2)
RE: How to use the LibreElec/Kodi addon "Lame MP3 Audio Encoder" from TVH? - Added by Thomas Klein over 6 years ago
Hi Dan,
sorry but I don't get it... what do you actually want to achieve? Playback on the Roku? And which system will do the transcoding: Kodi or TVH?
From what I understand, you are receiving a radio station stream with TVH as HE-AACv2 and want to playback this as mp3on the Roku?
Needless to say: I have no clue about the features and the connectivity of the Roku device. Sorry.
Did you try to just use a transcoding, audio-only stream profile on TVH which the Roku can use?
I mean, skip the Kodi part (or is that required for the Roku to access the stream?)
Then again, I am not perfectly sure if the blend of TVH you are running on the RPi supports mp3 output codec at all. I'm afraid it doesn't.
Nevertheless, maybe you can dig out a codec of good quality which both your Roku and TVH/ffmpeg support?
Check ffmpeg -encoders
to see what can match and use the according encoder name in the -acodec
parameter of your pipe command line.
Again, I'm very sorry to not be able to better help you here. The thing is I don't understand how the end-to-end chain is supposed to work.
From TVH to Kodi to Roku ... and therefor can't come up with a suggestion on HOW and WHERE to do the transcoding (because I don't know the Roku).
Cheers, Thomas
RE: How to use the LibreElec/Kodi addon "Lame MP3 Audio Encoder" from TVH? - Added by Thomas Klein over 6 years ago
Ah. Hold it.
Going over your post again, I think I now get it.
You want the Roku to be served the transcoded stream from TVH.
But as this is lacking an MP3 "output", your intention is to do ffmpeg-transcoding on the fly to that specific mux.
In order to have ffmpeg support mp3 codec, you install the Kodi addon, hoping that this will provide a solution that is available system-wide, meaning also available to the ffmpeg TVH is using.
That, however, won't work I'm afraid.
If the Kodi addon indeed comes with a lame library, it won't be installed in a directory that is in the "path", but rather buried deep down inside some kodi /addons/ directory. This leaves ffmpeg unable to use it.
Unless you didn't already do so, get in contact with the LibreEelec forums, I think this is a better place to ask that question.
The TVH flavors differ in scope of transcoding capabilities, also does ffmepg across different OS, devices and platforms.
I have no clue how to install a system-wide lame library on LibreElec. Using a Kodi addon probably isn't the right approach.
FWIW, that kind of limitations to the underlying linux was the main reason for me shifting from LibreElec to xbian.
Sorry I couldn't help - keeping fingers crossed for you. Cheers, Thomas