Discussion:
[SlimDevices: SqueezeCenter] Streaming (Audio) from Enigma2 Receiver
Simon74
2015-09-19 15:01:08 UTC
Permalink
Hello i like play Radio Streams over DVB-S from my openPLI Enigma2 Box.

When i save the URL from Stream under Favorites then is the Problem the
empty extension:
-http://enigmabox:8001/1:0:2:3176:459:1:C00000:0:0:0:-

Ok i can get a URL with extension from openwebif, that URL can i save.
-http://user:***@enigmabox/web/stream.m3u?ref=1:0:2:3176:459:1:C00000:0:0:0:-

Then the next Problem, when i start the Audiostream becomes the error:
-Playlist is empty -

On VLC Player run the Audiostream.
Codec Info from VLC:
18838

Is this Codec the Problem ?
in Log i not see errors

LMS Version: -Logitech Media Server Version: 7.9.0 - 1442495939 @ Fri
Sep 18 04:05:04 UTC 2015-


+-------------------------------------------------------------------+
|Filename: 2015-09-19 16_57_39-Aktuelle Medieninformationen.png |
|Download: http://forums.slimdevices.com/attachment.php?attachmentid=18838|
+-------------------------------------------------------------------+

------------------------------------------------------------------------
Simon74's Profile: http://forums.slimdevices.com/member.php?userid=64210
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
bpa
2015-09-19 20:24:21 UTC
Permalink
The audio format of a stream is determined by LMS from the extension
and/or MIME.

Since you have no extension - what is the MIME type for the http stream
that is sent by your enigma2 (i.e. the value of Content-Type in the http
header )


------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
Simon74
2015-09-19 20:36:41 UTC
Permalink
my Test with simple wget command:

Code:
--------------------
wget http://enigmabox:8001/1:0:2:3349:45B:1:C00000:0:0:0:
--2015-09-19 22:31:36-- http://enigmabox:8001/1:0:2:3349:45B:1:C00000:0:0:0:
Auflösen des Hostnamen »enigmabox (enigmabox)«... 192.168.0.5
Verbindungsaufbau zu enigmabox (enigmabox)|192.168.0.5|:8001... verbunden.
HTTP-Anforderung gesendet, warte auf Antwort... 200 OK
Länge: nicht spezifiziert [video/mpeg]
In »»1:0:2:3349:45B:1:C00000:0:0:0:«« speichern.
1:0:2:3349:45B:1:C00000:0:0:0: [ <=> ] 0 --.-KB/s
--------------------


ok send false header "video/mpeg".
this the problem on all radio channels..

Can this correct via LMS ?


------------------------------------------------------------------------
Simon74's Profile: http://forums.slimdevices.com/member.php?userid=64210
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
Simon74
2015-09-19 23:44:14 UTC
Permalink
ffmpeg say:


Code:
--------------------
ffmpeg -i http://enigmabox:8001/1:0:2:3349:45B:1:C00000:0:0:0: -vcodec copy -acodec copy output.mpg
ffmpeg version 0.8.17-6:0.8.17-1, Copyright (c) 2000-2014 the Libav developers
built on Mar 15 2015 17:00:31 with gcc 4.7.2
The ffmpeg program is only provided for script compatibility and will be removed
in a future release. It has been deprecated in the Libav project to allow for
incompatible command line syntax improvements in its replacement called avconv
(see Changelog for details). Please use avconv instead.
[mpegts @ 0x219ad00] max_analyze_duration reached
[mpegts @ 0x219ad00] Estimating duration from bitrate, this may be inaccurate
Input #0, mpegts, from 'http://enigmabox:8001/1:0:2:3349:45B:1:C00000:0:0:0:':
Duration: N/A, start: 46775.073878, bitrate: 160 kb/s
Program 13101
Program 13102
Program 13103
Program 13104
Program 13106
Program 13107
Program 13110
Program 13111
Program 13113
Program 13121
Program 13122
Program 13123
Program 13124
Program 13125
Program 13126
Program 13127
Program 13128
Program 13129
Stream #0.0[0x1ad](ger): Audio: mp2, 48000 Hz, stereo, s16, 160 kb/s (clean effects)
Program 13130
Program 13131
Program 13133
Program 13134
Program 13136
Program 13140
Program 13141
Output #0, mpeg, to 'output.mpg':
Metadata:
encoder : Lavf53.21.1
Stream #0.0(ger): Audio: mp2, 48000 Hz, stereo, 160 kb/s (clean effects)
Stream mapping:
Stream #0.0 -> #0.0
Press ctrl-c to stop encoding
size= 3390kB time=171.58 bitrate= 161.9kbits/s
video:0kB audio:3351kB global headers:0kB muxing overhead 1.161002%
Received signal 2: terminating.
--------------------


------------------------------------------------------------------------
Simon74's Profile: http://forums.slimdevices.com/member.php?userid=64210
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
bpa
2015-09-20 09:18:12 UTC
Permalink
There are two issues

1. MIME is video/mpeg
2. Codec is MP2 in an MPEG-TS container - this is not simple http/MP3 -
I think the "proper way " to support this stream would to be to create a
plugin

There are two problems
1. Supporting MPEG-TS - I think only the LMS MP4 support handles this
but not sure if it can handle a non AAC codec.
2. Supporting MP2 - not sure if all players upport ddcoding MP2 - I know
the older IP3K based player such as SB2/SB3/Class/Boom can.

Suggestions

Is it not possible to get OpenPLi enigma2 to send a nicer formatted
stream (e.g. strip mpeg-ts and use "raw" plain http) ? as I understand
it, it is a highly customisable linux box

To tell LMS the video/mpeg is supported you can create a
custom-types.conf file in the same directory as the LMS types.conf. Try
creating the custom-types.conf file with ONE of the following lines and
restart LMS. And then try to play your stream - personally I don't
think ti will work.
mp4 m4a,mp4,m4b audio/m4a,audio/x-m4a,audio/mp4 audio,
video/mpeg
mp3 mp2,mp3
audio/mpeg,audio/mp3,audio/mp3s,audio/x-mpeg,audio/mpeg3,audio/mpg
audio, video/mpeg

Since VLC can play this stream you could install the playDASH plugin
(which uses VLC to play DASH streams) and then modify the PlayDASH
custom-types.conf file to support video/mpeg. However I haven't tested
playDASH but it is a mod of my playHLS plugin which couldbe similarly
modified if your stream can be played with ffmpeg.
If your


------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
Simon74
2015-09-20 09:33:51 UTC
Permalink
Hello bpa,

thank you for the details !
i testet with your posted lines in custom-types.conf, no function, my
squeezebox baby radio say not found.

I found no plugin that streams the radio channels as mp3. All plugins
a'la streaming, are clients.

I search a way over icecast2 that is installed on debian-box.
Icecast-Relay with on the fly transcode from "audio transport stream" to
"mp3".
Find at the moment but no instructions to this theme.

Regards


------------------------------------------------------------------------
Simon74's Profile: http://forums.slimdevices.com/member.php?userid=64210
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
bpa
2015-09-20 09:36:55 UTC
Permalink
Post by Simon74
Hello bpa,
thank you for the details !
i testet with your posted lines in custom-types.conf, no function, my
squeezebox baby radio say not found.
I found no plugin that streams the radio channels as mp3. All plugins
a'la streaming, are clients.
I search a way over icecast2 that is installed on debian-box.
Icecast-Relay with on the fly transcode from "audio transport stream" to
"mp3".
Find at the moment but no instructions to this theme.
Regards
What system does you LMS run on ?
The modded PlayDASH or PlayHLS seems to be the way the go.

Can you play your stream with ffmpeg ? If so I can help with changes to
playHLS.


------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
Simon74
2015-09-20 09:42:44 UTC
Permalink
LMS run on the self Debian-Box.
ffmpeg create a correct file, see attachment.

Code:
--------------------
ffmpeg -i http://enigmabox:8001/1:0:2:3349:45B:1:C00000:0:0:0: -vcodec copy -acodec copy output.mp3
--------------------


18841


+-------------------------------------------------------------------+
|Filename: output.zip |
|Download: http://forums.slimdevices.com/attachment.php?attachmentid=18841|
+-------------------------------------------------------------------+

------------------------------------------------------------------------
Simon74's Profile: http://forums.slimdevices.com/member.php?userid=64210
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
bpa
2015-09-20 09:48:30 UTC
Permalink
Post by Simon74
LMS run on the self Debian-Box.
ffmpeg create a correct file, see attachment.
Code:
--------------------
Post by Simon74
Post by Simon74
ffmpeg -i http://enigmabox:8001/1:0:2:3349:45B:1:C00000:0:0:0: -vcodec copy -acodec copy output.mp3
--------------------
Post by Simon74
18841
The format is still MP2 not MP3 - check if you can play this file on
your Squeezebox baby radio ? I think it should work.


------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
Simon74
2015-09-20 09:53:48 UTC
Permalink
yes, the baby radio squeezebox can play this output file.


------------------------------------------------------------------------
Simon74's Profile: http://forums.slimdevices.com/member.php?userid=64210
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
bpa
2015-09-20 10:14:58 UTC
Permalink
OK

Install PlayHLS plugin - and check that it works by playing a m3u8
stream. There are differences betrween various linux distro regarding
ffmpeg and avconv which may be the problem.

Down load the attached zip file. and unzip into the PlayHLS directory -
the 3 files should replace the existing PlayHS files.

Restart LMS and you should now have a ENM2 file type under
Setting/Advanced/Filetypes. It is setup to use ffmpeg. If diesbaled
then ffmpeg isnot on your system.

The custom-convert.conf file controls the ffmpeg options to use when
converting the input stream.
The PlayHLS custom-types.conf file now has the video/mpeg type - so you
shoudl remove any changes or files you made earlier.

I cant' get back to this this later today so you may prefer to wait.


+-------------------------------------------------------------------+
|Filename: enm2.zip |
|Download: http://forums.slimdevices.com/attachment.php?attachmentid=18842|
+-------------------------------------------------------------------+

------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
bpa
2015-09-20 10:17:17 UTC
Permalink
PlayHLS thread

http://forums.slimdevices.com/showthread.php?103158-Announce-PlayHLS-Plugin-plugin-to-play-Apple-HLS-m3u8-stream


------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
Simon74
2015-09-20 10:34:03 UTC
Permalink
Installed, copy your Files in the Plugin Folder.
Streaming running, greate, thanks :)

1 Problem with quit Stream, when i switch to another Favorite, the
Stream no quit on the Enigmabox.

Code:
--------------------
***@dvb ~ > sc
Aktive Streamclients:
tcp 0 0 enigmabox:8001 media.domain.net:34104 ESTABLISHED
tcp 0 0 enigmabox:8001 media.domain.net:34117 ESTABLISHED
tcp 0 0 enigmabox:8001 media.domain.net:34122 ESTABLISHED
tcp 0 0 enigmabox:8001 media.domain.net:34112 ESTABLISHED
--------------------


------------------------------------------------------------------------
Simon74's Profile: http://forums.slimdevices.com/member.php?userid=64210
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
bpa
2015-09-20 12:45:17 UTC
Permalink
LMS is using ffmpeg to play the stream. You should be able to see this
process and the command line when it is playing. When you stop playing
this ffmpeg process should die. When you start playing the new Favorite
is the original ffmpeg process running (i.e. do you have two ffmpeg
processes running ?) What is the difference between the two URLs ?
------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
Simon74
2015-09-20 15:07:53 UTC
Permalink
urls, see post 1, without your plugin must a favorit url the m3u
extension.
different by channels is the number, see m3u playlist from enigma2 box:

Code:
--------------------
#EXTM3U
#EXTINF:0,1LIVE
http://enigmabox:8001/1:0:2:6F3B:445:1:C00000:0:0:0:
#EXTINF:0,ANTENNE BAYERN
http://enigmabox:8001/1:0:2:AA:7:85:C00000:0:0:0:
#EXTINF:0,BAYERN 3
http://enigmabox:8001/1:0:2:6EF2:445:1:C00000:0:0:0:
#EXTINF:0,BR-KLASSIK
http://enigmabox:8001/1:0:2:6EF3:445:1:C00000:0:0:0:
--------------------


ffmpeg instances: each stream creates a new instance and will not be
terminated.


------------------------------------------------------------------------
Simon74's Profile: http://forums.slimdevices.com/member.php?userid=64210
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
bpa
2015-09-20 17:00:50 UTC
Permalink
Since you ffmpeg processes are not dying - I think the problem is with
the build of ffmpeg but IIRC there may be a LMS contributing factor. I
think there are a few workarounds - I'll see if I can find them. What
version of LMS are you using ?


------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
bpa
2015-09-20 17:08:51 UTC
Permalink
Before I chase solutions - are you sure there are two different parent
ffmpeg processes and not that one is a child of an ffmpeg process ?


------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
bpa
2015-09-20 20:35:35 UTC
Permalink
There are two solution proposed by different users about how to kill
persistent ffmpeg processes.

1. This one suggests changing LMS file bootstrap.pm
http://forums.slimdevices.com/showthread.php?103158-Announce-PlayHLS-Plugin-plugin-to-play-Apple-HLS-m3u8-stream&p=809208&viewfull=1#post809208
If this change works - remember it may need to be applied each time
LMS is updated.

2. The second solution relies on a wrapper around the ffmpeg program -
the wrapper makes sure ffmpeg processed is killed when playing has
stopped. In the plugins custom-convert.conf file - the name of the
program is with square brackets (i.e. [ffmpeg]). LMS looks for the
program in the Plugin Bin directory and then on the PATH. This solution
relies on putting a Perl script called playhls.pl into the Plugin Bin
directory (it is not a good idea to use /usr/local/bin as suggested)
and making it executable. Then change the "[ffmpeg]" into
"[playhls.pl]" in the custom-convert.conf file and then restart LMS.
The playhls.pl script and details can be found here.
http://forums.slimdevices.com/showthread.php?53229-Announce-BBCiPlayer-Plugin-(UK-only)&p=807217&viewfull=1#post807217


------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
Simon74
2015-09-21 15:23:44 UTC
Permalink
Hello bpa,
Thanks for your help !

i tested number 1.
the patch not function under debian jessie (actual 8.2).

Code:
--------------------
***@mirror /usr/share/perl5/Slim > *cat sigpipe.patch*
--- bootstrap.pm.old 2015-02-25 13:42:40.674616931 +0000 +++ bootstrap.pm 2015-02-25 13:42:40.666616859 +0000 @@ -254,7 +254,7 @@ don't work for you, ask
for help and/or
require Slim::Utils::PerfMon;
}

- $SIG{'PIPE'} = 'IGNORE'; + $SIG{'PIPE'} = \&ignoresigpipe;
$SIG{'TERM'} = \&sigterm;
$SIG{'INT'} = \&sigint;
$SIG{'QUIT'} = \&sigquit; @@ -423,6 +423,11 @@ sub ignoresigquit {
Slim::Utils::Log::logger('server')->info('Ignoring sigquit');
}

+sub ignoresigpipe { + + Slim::Utils::Log::logger('server')->info('Ignoring sigpipe'); +} +
sub sigquit {
Slim::Utils::Log::logger('server')->info('Got sigquit');

***@mirror /usr/share/perl5/Slim >*patch -p1 sigpipe.patch*
--------------------


test number 2.
I test in the evening when I 'm at home :)


------------------------------------------------------------------------
Simon74's Profile: http://forums.slimdevices.com/member.php?userid=64210
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
squeezebox_Fan
2018-09-17 18:53:29 UTC
Permalink
Post by bpa
OK
Install PlayHLS plugin - and check that it works by playing a m3u8
stream. There are differences betrween various linux distro regarding
ffmpeg and avconv which may be the problem.
Down load the attached zip file. and unzip into the PlayHLS directory -
the 3 files should replace the existing PlayHS files.
Restart LMS and you should now have a ENM2 file type under
Setting/Advanced/Filetypes. It is setup to use ffmpeg. If diesbaled
then ffmpeg isnot on your system.
The custom-convert.conf file controls the ffmpeg options to use when
converting the input stream.
The PlayHLS custom-types.conf file now has the video/mpeg type - so you
shoudl remove any changes or files you made earlier.
I cant' get back to this this later today so you may prefer to wait.
Hallo bpa,

your plugin for hls and for the ENIGMA2 based videorecorders is great!!!

It works also for DREAMBOX 920 devices.

Thanky you very much.

The SAT Radio streams are MP2 codec.

So I changed your custom-convert.conf from


Code:
--------------------

enm2 flc * *
# # RB:{BITRATE=-B %B}T:{START=-ss %s}
# [ffmpeg] -loglevel quiet -i $FILE$ -f flac -

--------------------


to


Code:
--------------------

enm2 mp3 * *
# RB:{BITRATE=-B %B}T:{START=-ss %s}
[ffmpeg] -loglevel quiet -i $FILE$ -vn -acodec copy -f mp2 -

--------------------



Greetings



*Controllers Hardware:* 1XTouch,2XRadio,1XBoom,1XSB3,piCorePlayer
*Controllers Software:* squeezelite, Squeeze Player
*Steuerung:* 'Squeeze Comander'
(https://play.google.com/store/apps/details?id=de.cedata.android.squeezecommander&hl=de)
*Plugins:* 'Dynamic Mix'
(http://penguinlovesmusic.de/wp-content/uploads/beta/pmplugins/DynamicMixPlugin.htm);
'Custom Browse' (http://wiki.slimdevices.com/index.php/Custom_Browse),
TrackStat; Custom Scan; 'MusicInfoSCR'
(http://www.herger.net/slim-plugins/***@nr=446&kategorie=slim-plugins);
'LazySearch 2' (http://www.hickinbottom.com/lazysearch)..

LMS 7.9 (UBUNTU 10.04) und 'MusicIP ' (http://www.spicefly.com/)Server
like:
http://powersat.de/showthread.php?4902-Musikstreaming-mit-Avantgarde-Squezeeslave-ein-L%C3%B6sungsvorschlag
------------------------------------------------------------------------
squeezebox_Fan's Profile: http://forums.slimdevices.com/member.php?userid=63027
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
bpa
2018-09-17 19:00:49 UTC
Permalink
Post by squeezebox_Fan
Hallo bpa,
your plugin for hls and for the ENIGMA2 based videorecorders is great!!!
It works also for DREAMBOX 920 devices.
Thanky you very much.
A blast from the past. Glad things are still applicable after 3 yrs.


------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=104324
Loading...