PDA

View Full Version : Any ideas why this stream won't play?



Nick_G
2012-12-12, 11:22
Danish Radio have recently upgraded to some 192k AAC streams. This is an example below:

http://ahls.gss.dr.dk/A/A03H.stream/Playlist.m3u8

I presume the Squeezebox doesn't like the playlist because it reports that there are no items in the playlist. I deleted the 8 at the end but still no joy. Any ideas please?

Thanks,
Nick

bpa
2012-12-12, 12:33
Danish Radio have recently upgraded to some 192k AAC streams. This is an example below:

http://ahls.gss.dr.dk/A/A03H.stream/Playlist.m3u8

I presume the Squeezebox doesn't like the playlist because it reports that there are no items in the playlist. I deleted the 8 at the end but still no joy. Any ideas please?

Thanks,
Nick
After trying to play the stream with mplayer which is usually more versatile than LMS - it failed.

The stream format may be unsupported by LMS

The playlist format has a MIME type of application/vnd.apple.mpegurl which is not supported by LMS and neither is the extension so I'm not sure LMS will know it is a playlist.

The contents of the m3u8 file


#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=213967,CODECS="mp4a.40.2"
playlist.m3u8?wowzasessionid=259730292

There isno full URL which I think LMS expects (i.e. it will not add http root from playlist) and secondly the format looks to be mp4 streaming which is not supported by LMS.

Mnyb
2012-12-12, 12:37
VLC and Exaile streams this .

So there is a difference between mp4 and AAC streaming ?

castalla
2012-12-12, 12:38
After trying to play the stream with mplayer which is usually more versatile than LMS - it failed.

The stream format may be unsupported by LMS

The playlist format has a MIME type of application/vnd.apple.mpegurl which is not supported by LMS and neither is the extension so I'm not sure LMS will know it is a playlist.

The contents of the m3u8 file


#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=213967,CODECS="mp4a.40.2"
playlist.m3u8?wowzasessionid=259730292

There isno full URL which I think LMS expects (i.e. it will not add http root from playlist) and secondly the format looks to be mp4 streaming which is not supported by LMS.

It won't play in VLC either - so how is anyone supposed to listen to this????!!!!

Mnyb
2012-12-12, 12:42
It won't play in VLC either - so how is anyone supposed to listen to this????!!!!

It plays on VLC on my desktop ?

bpa
2012-12-12, 13:43
VLC and Exaile streams this .

So there is a difference between mp4 and AAC streaming ?

I didn't try VLC as I found that if mplayer fails then LMS will also fail but it provide better diagnostics.

Most broadcast AAC streams use http with ADTS transport protocol - mp4 uses a MPEG4 transport and streaming MPEG4 is different to file based MPEG4 and it has different issues. I think similar issue to LMS playing MP4 podcasts.

Nick_G
2012-12-12, 13:52
It plays fine on VLC for me. In theory it should play on SB hardware because they play AAC natively. But it obviously uses some weird protocol as mentioned above. Thanks Danmarks Radio :rolleyes:

I can play the mp3 streams but these AAC streams would probably sound better through my hi-fi.

Regards,
Nick

Mnyb
2012-12-12, 13:53
I didn't try VLC as I found that if mplayer fails then LMS will also fail but it provide better diagnostics.

Most broadcast AAC streams use http with ADTS transport protocol - mp4 uses a MPEG4 transport and streaming MPEG4 is different to file based MPEG4 and it has different issues. I think similar issue to LMS playing MP4 podcasts.

Is this an old bug ? Would it be hard to make the server handle this , just wondering if there is any old bug on it or any change of a fix , or if OP should try to find an alternate stream in another format.

Triode
2012-12-12, 14:20
ffplay will play it. So you can probably create a custom-convert.conf file and have a way to manually play it with an external helper app like ffplay.

bpa
2012-12-12, 15:35
Is this an old bug ? Would it be hard to make the server handle this , just wondering if there is any old bug on it or any change of a fix , or if OP should try to find an alternate stream in another format.

See http://bugs.slimdevices.com/show_bug.cgi?id=17201 for MP4 podcast although my patch did not fix it fully. There is also a conf file for ffmpeg.

mitrih
2014-08-09, 23:36
See http://bugs.slimdevices.com/show_bug.cgi?id=17201 for MP4 podcast although my patch did not fix it fully. There is also a conf file for ffmpeg.

I noticed that a lot of the new streams with m3u8 extensions can be opened with ffplay and not with mplayer.
Thanks to Bpa xplayer I have been able to get most rtsp streams to play using mplayer.
( I am not by far advanced at this) , but I can certainly edit conf files etc... and follow instructions.
What do I need to do to make xplayer work with ffplay like it does with mplayer.
Do I just copy the whole Xplay folder and change the bin directory to add ffplay etc... If you can give me some instructions that would be helpful.
Also ffplay is not quiet ( even in the quiet mode) it wants to open a graphic window, and I do not know how to shut that down and make it work line mplayer.

Thanks in advance.

bpa
2014-08-10, 00:26
AFAICT ffplay is a media player built with ffmpeg libraries - i,e. it will play to the audio device and video of the host system not give access to decoded stream. You do not want that in LMS - you want to redirect decoded stream into LMS - so you have to use using ffmpeg not ffplay in any custom-convert.conf file

It is not possible ot give more specific advice without more detail on the streams/formats you are trying to play. The better/simpler solution might be to patch LMS to support m3u8

tfec
2014-08-10, 04:15
Danish Radio have recently upgraded to some 192k AAC streams.

I found the DR-streams at this website: http://www.listenlive.eu/denmark.html
Downloading a playlist with 192k, likely the first, http://live-icy.gss.dr.dk:8000/A/A03H.mp3.m3u, you will find inside a link to the mp3-stream, http://live-icy.gss.dr.dk:8000/A/A03H.mp3.

mitrih
2014-08-10, 08:55
AFAICT ffplay is a media player built with ffmpeg libraries - i,e. it will play to the audio device and video of the host system not give access to decoded stream. You do not want that in LMS - you want to redirect decoded stream into LMS - so you have to use using ffmpeg not ffplay in any custom-convert.conf file

It is not possible ot give more specific advice without more detail on the streams/formats you are trying to play. The better/simpler solution might be to patch LMS to support m3u8

I got few examples, the first two open up with ffplay but not with ffmpeg. The third one will only open up with VLC. This is getting more difficult. These days I got to admit that I am using mostly Wavein.
http://stream.lebanese-forces.com/live/RLL/playlist.m3u8
http://mobilestreaming.itworkscdn.com/radioorient/radioorient/playlist.m3u8
http://stream.radiotime.com/listen.m3u?streamId=35645745&rti=dihyG20zN0AUUgN3QBVQGE42R1tZGh0ySRFSQFFRJg9AER FxZFFfDAQGdHUQRl9gWwcVWwQTRGwQTAB1HxwNEgdGX3RqGAVC BUwFVVtUYQY%3d~~~

on the first two, I was able to get the rtsp equivalent and I am using XPLAY and that is working now. The third one I gave up.

bpa
2014-08-11, 02:55
I got few examples, the first two open up with ffplay but not with ffmpeg. The third one will only open up with VLC. This is getting more difficult. These days I got to admit that I am using mostly Wavein.
http://stream.lebanese-forces.com/live/RLL/playlist.m3u8
http://mobilestreaming.itworkscdn.com/radioorient/radioorient/playlist.m3u8
http://stream.radiotime.com/listen.m3u?streamId=35645745&rti=dihyG20zN0AUUgN3QBVQGE42R1tZGh0ySRFSQFFRJg9AER FxZFFfDAQGdHUQRl9gWwcVWwQTRGwQTAB1HxwNEgdGX3RqGAVC BUwFVVtUYQY%3d~~~

on the first two, I was able to get the rtsp equivalent and I am using XPLAY and that is working now. The third one I gave up.
Whoever is creating these streams need to get to a basic internet education. These streams seems to be DIY stream using some sort of Apple server but the user has chosen live video H.264/MPEG streaming technology to transmit low grade audio the first two stream are ulitmatley http mono mp3 22kHz 32kpbs and 48kbps (e.g. http://stream.lebanese-forces.com:80/live/RLL/media_19201.mp3 , http://mobilestreaming.itworkscdn.com/radioorient/radioorient/media_w141482671_623.mp3 ) . The 3rd stream is even weirder but again seem to be abusing formats. Allthese stream only need a simple http playlist but someone is choosing to set up the servers with unnecessary options.

In all 3 cases there are multiple layers of playlist ending up with standard http MP3 or AAC streams. The playlist have assigned mime and extension which often mislead rather than help and so often have to be ignored.

All 3 stream can be played with VLC 2.1.3 and since VLC output can be "piped" into LMS - I suggest using VLC for future work.

mitrih
2014-08-11, 07:48
Whoever is creating these streams need to get to a basic internet education. These streams seems to be DIY stream using some sort of Apple server but the user has chosen live video H.264/MPEG streaming technology to transmit low grade audio the first two stream are ulitmatley http mono mp3 22kHz 32kpbs and 48kbps (e.g. http://stream.lebanese-forces.com:80/live/RLL/media_19201.mp3 , http://mobilestreaming.itworkscdn.com/radioorient/radioorient/media_w141482671_623.mp3 ) . The 3rd stream is even weirder but again seem to be abusing formats. Allthese stream only need a simple http playlist but someone is choosing to set up the servers with unnecessary options.

In all 3 cases there are multiple layers of playlist ending up with standard http MP3 or AAC streams. The playlist have assigned mime and extension which often mislead rather than help and so often have to be ignored.

All 3 stream can be played with VLC 2.1.3 and since VLC output can be "piped" into LMS - I suggest using VLC for future work.

Thanks for the tip on VLC I was using an older version of VLC, seems 2.1.3 is better. I was able to play the first and third stream with it, but not second, it still gives an error. ( edited: sometimes stream 2 works and sometimes it gives an error, "VLC can't recognize the input's format:
The format of 'http://mobilestreaming.itworkscdn.com/radioorient/radioorient/playlist.m3u8' cannot be detected. Have a look at the log for details."
But as I said not important for this stream as I have a cross rtsp already.

If you have done the work already do you mind send me the mods to Xplay to use VLC (instead of mplayer)... This way I can make XplayM and XplayV plugins depending what plays the stream.

bpa
2014-08-12, 05:00
All below are quick hacks and am sure there is unnecessary code/rubbish there. With these files and the Xplay plugin the 3 stream played OK on LMS for 10 secs - they may break down on longer playing.

For command line/batch file use cvlc and not vlc - this avoids some console/video actions.

For windows you could try to use cvlc direect instead of an intermediate shell script/batch file xplay.sh . VLC doesn't like to die so the xplay.sh was necessary in linux to kill it once LMS has stopped the stream. Also for Windows you'll probably be using "dst=#PIPE#"

The command line below will transcode the audio stream into flac - it does not resample or change other aspects of the audio even though the params seems to indicate it will.




# Xplay - unix version
#
#
xplay flc * *
# F:{PATH=%f}R:{PATH=%F}
[xplay.sh] $PATH$ -I dummy -q --no-sout-video --sout '#transcode{acodec=flac,channels=2,ab=128,samplera te=44100}:standard{access=file,mux=dummy,dst=-}}' vlc://quit -


For Linxu the xplay.sh looks like


#!/bin/sh
scriptpid=$$
apppid=/tmp/.playxplay-app.$$.pid
app=cvlc

if [ -e "${11}" ] ; then
echo Local File: Launching $app "$@" >&2
"$app" "$@"
exit
fi

echo Streaming: Launching $app "$@" >&2
(
"$app" "$@" &

echo $! > $apppid
wait
rm -f $apppid
kill $scriptpid 2> /dev/null
) < /dev/null &

cat > /dev/null
if [ -s $apppid ] ; then
kill `cat $apppid` 2> /dev/null
fi

bpa
2014-08-12, 05:24
Just for the record the three streams are in HLS format - HTTP Live Streaming a method developed by Apple originally intended to allow live video stream to be sent over standard http port 80 (i.e. no firewalls, no special protocols). The stream is broken into chunks of short duration 5-10sec and player plays this endless playlist of small "files". It is being formalised in IETF as a multi media streaming protocol.

That said, using HLS for low grade audio is not appropriate.

See Wiki entry for details on players and servers http://en.wikipedia.org/wiki/HTTP_Live_Streaming#Supported_players_and_servers

mitrih
2014-08-12, 14:29
All below are quick hacks and am sure there is unnecessary code/rubbish there. With these files and the Xplay plugin the 3 stream played OK on LMS for 10 secs - they may break down on longer playing.

For command line/batch file use cvlc and not vlc - this avoids some console/video actions.

For windows you could try to use cvlc direect instead of an intermediate shell script/batch file xplay.sh . VLC doesn't like to die so the xplay.sh was necessary in linux to kill it once LMS has stopped the stream. Also for Windows you'll probably be using "dst=#PIPE#"

The command line below will transcode the audio stream into flac - it does not resample or change other aspects of the audio even though the params seems to indicate it will.




# Xplay - unix version
#
#
xplay flc * *
# F:{PATH=%f}R:{PATH=%F}
[xplay.sh] $PATH$ -I dummy -q --no-sout-video --sout '#transcode{acodec=flac,channels=2,ab=128,samplera te=44100}:standard{access=file,mux=dummy,dst=-}}' vlc://quit -




I am running Window XP and 7. I saw a couple of files custom-convert.conf and redxii-custom-convert.conf. I did not see xplay.sh file ( you said this is only unix),so we are ok so far ;)
I created a VLC window link in the bin directory ( under xplay). Window calls it "VLC media player.lnk" and changed the following in both convert files from



xplay flc * *
# F:{PATH=%f}R:{PATH=%F}
[mplayer] -really-quiet -vc null -vo null -rtsp-stream-over-tcp -ao pcm:waveheader:file=#PIPE# $PATH$ | [flac] -cs --totally-silent --compression-level-0 --ignore-chunk-sizes -


to


xplay flc * *
# F:{PATH=%f}R:{PATH=%F}
["VLC media player.lnk"] -I dummy -q --no-sout-video --sout '#transcode{acodec=flac,channels=2,ab=128,samplera te=44100}:standard{access=file,mux=dummy,dst=-}}' $PATH$ vlc://quit -


note I had to change the position of $PATH$ from what you had ?
I tried the basic command on command line and seems to work without the transcode.
But I could not get it to play in squeezeserver and there were no error logged... So after few hours of fiddling, I thought I would ask for help...
VLC itself is under "c:\program files (x86)\videolan\vlc\" but the link works ok from bin. ( unless Squeezecenter shell has issues with the spaces in the name ?)
also for windows, cvlc is really a batch file with one command VLC -I dummy which you are using... So that is all the same. Any hint to progress me would be appreciated.

Also once we push through the first hurdle... ( if we do ;) what would be the changes I need to do to make a folder XplayV ( so Squeezecenter sees it as a new plugin XplayV, and that responds to XplayV:// commands). We can keep all the internal variables and html the same, I am only interested in declaring it as a new plug in that responds to a new command. This way I can load both of them. ( if it is easier for you than explaining it... just send me an XplayV folder )

( all of this is low priority, so if you are busy I can totally get it... But seems like VLC is very powerful going forward and the way to go.)
Also on the stream format, I totally get that this is a video format totally inappropriate, but seems like it is easy to build a radio streaming service with it, maybe that is why they use it ?
Thanks again.

bpa
2014-08-12, 15:24
Why didn't you change the "dst=#PIPE"#" like I suggested ?

mitrih
2014-08-12, 23:15
Why didn't you change the "dst=#PIPE"#" like I suggested ?

Sorry missed that one, now it looks like this, also removed spaces from the link name, and after researching put the $PATH$ where you had it ( sorry).
You also had two }} after dst, I corrected to one }. ALso changed ' to " (windows did not like ')



xplay flc * *
# F:{PATH=%f}R:{PATH=%F}
[VLCmediaplayer.lnk] -I dummy -q --no-sout-video $PATHS$ --sout "#transcode{acodec=flac,channels=2,ab=128,samplerat e=44100}:standard{access=file,mux=dummy,dst=#PIPE# }" vlc://quit -


I am not sure if I need the - at the end of the command in windows ?
I tried it with both - and no - options, it still did not work. The problem is that VLC is not even starting. I think the parser in Squeezecenter does not like the . in VLCmediaplayer.lnk ?? Not sure if anybody has experience with using link. But it works fine on the command line.

Also ( and that is minor), instead -q we might want to use --dummy-quiet it is quieter and does not open a window

bpa
2014-08-13, 15:16
Linking just the vlc.exe to a file in the Xplay Bin directory will not work because vlc uses a number of DLL and other files which must be in the same directory as vlc.exe.

I think you can either install VLC into the Bin directoruy of Xplay plugin or else delete the Xplay Bin directory and make a directory link called Bin to the VLC directory which has vlc.exe - I used "mklink /D" command. A shortcut may or may not work but I didn't try.

The custom-convert.conf file should look like:


# Xplay - windows VLC version
#
#
# XPlay
xplay flc * *
# F:{PATH=%f}R:{PATH=%F}
[vlc] -I dummy --dummy-quiet $PATH$ :sout=#transcode{acodec=flac,channels=2,ab=128,sam plerate=44100}:standard{access=file,mux=dummy,dst=-}



The third URL (i.e. the radiotime one) should be played as http://stream.arabiacell.biz:1935/sawtalghad/audio128/playlist.m3u8
I think there is something in the radiotime URL (perhaps the tildes) which causes problems but the above URL didn't always play so the problem may be with the broadcaster.

You must play to a player can supports Flac natively - otherwise LMS will abort as it will try to do transcoding to PCM.

mitrih
2014-08-13, 16:27
# XPlay
xplay flc * *
# F:{PATH=%f}R:{PATH=%F}
[vlc] -I dummy --dummy-quiet $PATH$ :sout=#transcode{acodec=flac,channels=2,ab=128,sam plerate=44100}:standard{access=file,mux=dummy,dst=-}

[/code]

The third URL (i.e. the radiotime one) should be played as http://stream.arabiacell.biz:1935/sawtalghad/audio128/playlist.m3u8
I think there is something in the radiotime URL (perhaps the tildes) which causes problems but the above URL didn't always play so the problem may be with the broadcaster.

You must play to a player can supports Flac natively - otherwise LMS will abort as it will try to do transcoding to PCM.

I made some slight progress! I made the link to bin, but that did not do it... vlc was not even being called. So I made the same VLC line change to all the sections in the custom-convert file (PCM, WAV, MP3, FLC). Then VLC was called when I open the stream and was closed properly when I closed the stream ( but I get noise or nothing, but on/off plays properly). So in a nutshell those streams were not calling the FLC section ?? ( as I said this area is beyond me, all I can do is debug ;). But now we are much closer. just for completeness, I will try to revert back to the window link vlcmediaplayer.lnk and see if it is all the same. However now the issue is in the transcoding ( and the section being called)... Maybe we transcode to something that mplayer did and used to work. Note that I am running still 7.3.3 and have a VERY old squeesebox V2 ( that I am still trying to hold on to ;)
I must love this box!! anyways, please see questions below. also (just FYI ) the change you made to transcode format both work for windows
:sout#transcode works
--sout "#transcode works
--sout '#transcode DOES NOT work in windows ( just FYI)

Just few clarifications before I attempt more changes
1) You changed back to dst=- should not that be dst=#PIPE# per what you recommended ( not sure if this relates to your last comment, but wanted to make sure)
2) do I need to modify at all the WMA and MP3 sections of the custom-convert file or just the flac line
3) do I need to modify both custom-convert.conf and redxii--custom-convert conf or just the first one
4) in the old convert file in the flac section the mplayer output was piped to a flac process, is that needed here or the transcoding takes care of that ( you know by now that I am no expert in this ;)
[mplayer] -really-quiet -vc null -vo null -rtsp-stream-over-tcp -ao pcm:waveheader:file=#PIPE# $PATH$ | [flac] -cs --totally-silent --compression-level-0 --ignore-chunk-sizes -

I will continue working and thanks as always!

bpa
2014-08-13, 18:04
Please read the post - the Bin directory must be linked to the VLC directory and it is a directory link not a shortcut lnk type link. - using just a link to vlc.exe will not work anmds is a waster to time. If the directory link did not work for you then you have made a mistake


Just few clarifications before I attempt the changes
1) You changed back to dst=- should not that be dst=#PIPE# per what you recommended ( not sure if this relates to your last comment, but wanted to make sure)
Yes , I was working wholly from memory before. I have looked at some other conf files and I now think #PIPE# is not needed since VLC will output in Flac and there is no other process but I cannot remember when #PIPE# is needed so if there are still problems it may need to be revisited but I don't want to spend much time on it - I have found that getting vlc / Windows / LMS to work is very time consuming and frustrating due to quirks of Windows and Windows version of VLC and the special tools LMS had to created to get around shortcomings of Windows.



2) do I need to modify at all the WMA and MP3 sections of the custom-convert file or just the flac line

The text is the complete file .
There are no wav, pcm or mp3 sections.
There should never be any WMA section.
This XPlay setup will only produce a Flac stream. This is because a header is necessary as the format of the stream being input to vlc is unknown and the plugin has to rely on vlc generate an audio format header (e.g. 1ch v 2 ch) so that LMS can play the stream correctly as VLCX is not wholly transcoding the audio stream.


3) do I need to modify both custom-convert.conf and redxii--custom-convert conf or just the first one

LMS only loads custom-convert.conf file. I can't remember the purpose of redxii--custom-convert conf file perhaps it is error and supplied as an alternative but it can only become "active" if it is renamed custom-convert.conf


4) in the old convert file in the flac section the mplayer output was piped to a flac process, is that needed here or the transcoding takes care of that ( you know by now that I am no expert in this ;)
[mplayer] -really-quiet -vc null -vo null -rtsp-stream-over-tcp -ao pcm:waveheader:file=#PIPE# $PATH$ | [flac] -cs --totally-silent --compression-level-0 --ignore-chunk-sizes -

VLC does the transcoding to flac . no other process is needed.

Please be exact - what model Squeezebox have you got ? If it a SlIMP3 or Squeezebox 1 then this setup will not work as it output Flac. If you have a Squeezebox 2 it shold be OK but some users have bought 2nd hand Squeezebox1 and think it is a Squeezebox 2 as they have the same case. What does label say on bottom of player or LMS Web UI Settings/ Information say ?

mitrih
2014-08-13, 20:09
Please read the post - the Bin directory must be linked to the VLC directory and it is a directory link not a shortcut lnk type link. - using just a link to vlc.exe will not work anmds is a waster to time. If the directory link did not work for you then you have made a mistake


Sorry for diverging... You are right on, I did the bin link as you requested, and I can call VLC correctly and I saw it coming up ( tried back the other way just for the hell of it and you are absolutely right does not work)....
My model: Squeezebox
firmware 40
Squeezecenter 7.3.3
That is why the Flac did not work.. But I had no idea... What confused me is that the file that you gave me a while ago ( and is working) for XPLAY is


# Xplay - unix version
#
#
# XPlay
xplay pcm * *
# F:{PATH=%f}R:{PATH=%F}
[mplayer] -really-quiet -vc null -vo null -rtsp-stream-over-tcp -af format=s16le,volume=0,resample=44100:0:1,channels= 2 -ao pcm:nowaveheader:file=#PIPE# $PATH$
xplay wav * *
# F:{PATH=%f}R:{PATH=%F}
[mplayer] -really-quiet -vc null -vo null -rtsp-stream-over-tcp -af format=s16le,volume=0,resample=44100:0:1,channels= 2 -ao pcm:nowaveheader:file=#PIPE# $PATH$
xplay mp3 * *
# F:{PATH=%f}R:{PATH=%F}B:{BITRATE=-B %B}
[mplayer] -really-quiet -vc null -vo null -rtsp-stream-over-tcp -af format=s16le,volume=0,resample=44100:0:1,channels= 2 -ao pcm:nowaveheader:file=#PIPE# $PATH$ | [lame] --silent -q -r -s 44.1 --bitwidth 16 -m s $QUALITY$ $BITRATE$ - -
xplay flc * *
# F:{PATH=%f}R:{PATH=%F}
[mplayer] -really-quiet -vc null -vo null -rtsp-stream-over-tcp -ao pcm:waveheader:file=#PIPE# $PATH$ | [flac] -cs --totally-silent --compression-level-0 --ignore-chunk-sizes -


I modified the flac line in the above file, per your instructions, but it was not calling that section ( like you said this box does not support flac)! I tested the file just to see what is calling VLC ( by eliminating sections), and the only two options that worked were Wav and mp3. I changed the file to the following below, it started working! However station 1 and sometimes station 3 crashes VLC when it is called from LMS ( stations 2 works). All stations work though when I open them directly in VLC GUI. However when I try command line VLC I see the same VLC crash behavior, so this has nothing to do with LMS. I upgraded to VLC 2.1.5 same issue. Not sure if I am doing something wrong with the conversion. Also if I add the WAV section using the S161 codec, the sound comes out at twice the rate ?? Need your advice if I should stick to MP3 or add the other section(s). So hope you can suggest some minor edits to take us home!! also if you do not mind let me know the changes to create a new XplayV plugin from XPLAY if this is not a monsterous job.



xplay mp3 * *
# F:{PATH=%f}R:{PATH=%F}B:{BITRATE=-B %B}
[VLC] -I dummy --dummy-quiet $PATH$ :sout=#transcode{acodec=mp3,channels=2,ab=$BITRATE $,samplerate=44100}:standard{access=file,mux=dummy ,dst=-}

bpa
2014-08-14, 09:53
This is a nightmare setup between the HLS streams, Windows and VLC bugs complicated by you SB player. I have wasted too much time on this and have to had to setup a window system to verify what is going on. Please email the broadcasters and then tell to use normal streams formats - they will get far more listeners and not just iPhone users and probably save network charges.

Firmware 40 means you have a SB1 - it can only play MP3 and PCM/AIFF. No Flac or WAV formats.

VLC has a transcode bug where it does not convert a single channel stream into 2 identical channels even when it is requested. Normally this wouldn't matter (which is why is it a very old bug) but 2 of your streams are single channel.

VLC transcode to MP3 on Windows seems to crash - not sure why - so MP3 streams cannot be used.

The previous conf files only provided a Flac format which provides a headers to get around the single channel issue but your player can't play PCM and VLV crash if a MP3 stream is generated, therefore the only format left is PCM but an additional stage is needed to handle the singel channel to 2 channel conversion - I have added sox.

This is complete custom-convert.conf file.


# Xplay - windows VLC version
#
#
# XPlay
xplay flc * *
# F:{PATH=%f}R:{PATH=%F}
[vlc] -I dummy --dummy-quiet $PATH$ :sout=#transcode{acodec=flac,channels=2,ab=128,sam plerate=44100}:standard{access=file,mux=dummy,dst=-}
xplay pcm * *
# F:{PATH=%f}R:{PATH=%F}
[vlc] -I dummy --dummy-quiet $PATH$ :sout=#transcode{acodec=flac,channels=2,ab=128,sam plerate=44100}:standard{access=file,mux=dummy,dst=-} | [sox] -q -t flac - -c 2 -t s2 -


Why do you need another plugin - this plugin with VLC should be able to handle all you can throw at it.

mitrih
2014-08-14, 12:43
This is a nightmare setup between the HLS streams, Windows and VLC bugs complicated by you SB player. I have wasted too much time on this and have to had to setup a window system to verify what is going on. Please email the broadcasters and then tell to use normal streams formats - they will get far more listeners and not just iPhone users and probably save network charges.

Firmware 40 means you have a SB1 - it can only play MP3 and PCM/AIFF. No Flac or WAV formats.

VLC has a transcode bug where it does not convert a single channel stream into 2 identical channels even when it is requested. Normally this wouldn't matter (which is why is it a very old bug) but 2 of your streams are single channel.


Thanks soooooo much for the wonderful work! Turns out that SB1 supports WAV instead of PCM, all I had to do is change those two words and the script worked... Just for the forum here this is what the final one looked like. Pretty smart to use sox...


xplay flc * *
# F:{PATH=%f}R:{PATH=%F}
[vlc] -I dummy --dummy-quiet $PATH$ :sout=#transcode{acodec=flac,channels=2,ab=128,sam plerate=44100}:standard{access=file,mux=dummy,dst=-}
xplay wav * *
# F:{PATH=%f}R:{PATH=%F}
[vlc] -I dummy --dummy-quiet $PATH$ :sout=#transcode{acodec=flac,channels=2,ab=128,sam plerate=44100}:standard{access=file,mux=dummy,dst=-} | [sox] -q -t flac - -c 2 -t s2 -


Regarding the VLC MP3 transcoding bug, here is more info about it (?). Note this is for VLC Command line only bug.
https://forum.videolan.org/viewtopic.php?f=14&t=105623

The reason I am trying to setup 2 XPLAY plugins is these stations keep changing every 6 months ;) mplayer ( with your -tcp change) is better at opening rtsp streams. VLC is better at m3u8.. This way I have Xplay as is working now using mplayer ( and I have few stations on it). For the ones that need .m3u8 I would move them over to XplayV.

For example the same station 1, mplayer ( with tcp change) opens rtsp stream, and VLC open the .m3u8 stream
http://stream.lebanese-forces.com/live/RLL/playlist.m3u8
rtsp://stream.lebanese-forces.com:1935/live/RLL/

But in the end, I am totally aware of your valuable time. If this is work is for example going to the custom-types.conf and changing the two names, then that is my hope. Alternately, if Xplay can take two commands XplayM and XplayV, that would work. If it is involved, I think we are done, I wasted so much of your valuable time already!! Many thanks!

bpa
2014-08-14, 14:50
Thanks soooooo much for the wonderful work! Turns out that SB1 supports WAV instead of PCM, all I had to do is change those two words and the script worked... Just for the forum here this is what the final one looked like. Pretty smart to use sox...

That makes no sense because the "-t s2" command on SOX tell it to output PCM S16le without a WAV header (this would be "-t wav") but I'm beyond worrying about this setup.

To create another plugin you need to change "XPLAY" in every single directory name, filename in all subdirectories and any text XPLAY in all files (e.g. pm, html, conf, xml, txt, png, ...) keeping the upper/lower case exactly. So to create a plugin call Xplayv, XPLAY goes to XPLAYV, Xplay goes to Xplayv and xplay gores to xplayv. When done - you'll see a new File type and also use "xplayv://" in URLs.

mitrih
2014-08-15, 08:03
That makes no sense because the "-t s2" command on SOX tell it to output PCM S16le without a WAV header (this would be "-t wav") but I'm beyond worrying about this setup.


If you look at the original config file ( Message #25) you will see that it is all the same output for PCM and Wav. SB1 takes PCM with nowave header. In fact outside MP3, this is the only format it takes. However the section that gets called is WAV and not PCM ( I am not sure why). For MP3 , they pipe this to LAME for compression.



To create another plugin you need to change "XPLAY" in every single directory name, filename in all subdirectories and any text XPLAY in all files (e.g. pm, html, conf, xml, txt, png, ...) keeping the upper/lower case exactly. So to create a plugin call Xplayv, XPLAY goes to XPLAYV, Xplay goes to Xplayv and xplay gores to xplayv. When done - you'll see a new File type and also use "xplayv://" in URLs.
[/QUOTE]

Thanks! perfect instructions! Got it working on T430 ( I5) and an old T40 ( very old centrino dual core). What I found out is that is on T430 VLC takes 25% of CPU time. on T40 it take 100% of CPU time and the stream stops while VLC is rebuffering ;) I was surprised how inefficient VLC was in playing HLS. ffplay takes 1% T40 CPU time playing the same m3u8 stream, using the same ffmpeg! mplayer takes 1% of T40 to play the same stream in rtsp!! Then I googled "VLC 100% CPU usage for HLS streams" and then you get the picture ;)
I downloaded the latest ffmpeg, and sure enough I was able to convert m3u8 to mp3 nicely, with 1% CPU usage. it has similar options to mplayer
ffmpeg -i input_stream -ac 2 -ab 128K -acodec mp3 output_file.mp3
What was confusing me is that it does not play the stream like mplayer does by default, but the mp3 output was perfect.
I will try to play with this a bit later to see if this works.
as always, thanks for wrapping this up and all the time you spent on this!

bpa
2014-08-15, 09:56
If you look at the original config file ( Message #25) you will see that it is all the same output for PCM and Wav. SB1 takes PCM with nowave header. In fact outside MP3, this is the only format it takes. However the section that gets called is WAV and not PCM ( I am not sure why). For MP3 , they pipe this to LAME for compression.

Since the SB1 doesn't support WAV only PCM section should be invoked. The conf file I sent you was edited for Windows but never tested. Technically the "nowaveheader" should be "waveheader" on the WAV section. I suspect there is some backward compatibility for SB1 as the SB1 firmware was frozen before the change in 7.4 (2009 http://forums.slimdevices.com/showthread.php?57918-Transcoding-changes-wav-gt-pcm&p=381628&viewfull=1#post381628 ) changing WAV section to PCM and adding a true WAV section in config.


I was surprised how inefficient VLC was in playing HLS.

Play the stream in VLC GUI and look at message windows set to level 2 - VLC sepnds loads of time just trying to figure out how these stream should be played as they are not what HLS was intended. ffplay is not transcoding MP3 into flac nor fixing mono/stereo bug (after having to decode from flac and then sending through sox) so it is missing some CPU processing there. HLS was intended to plays 5-10 sec chunks of HD video - these broadcaster are doing 5-10 secs chunks of mono MP3 (each chunk requires about 3 HTTP request with playlists) - there must be more time spent processing headers and playlists than actual audio. The amount of data in mono audio compared to HD video is tiny.

mitrih
2014-08-16, 15:17
Play the stream in VLC GUI and look at message windows set to level 2 - VLC sepnds loads of time just trying to figure out how these stream should be played as they are not what HLS was intended. ffplay is not transcoding MP3 into flac nor fixing mono/stereo bug (after having to decode from flac and then sending through sox) so it is missing some CPU processing there. HLS was intended to plays 5-10 sec chunks of HD video - these broadcaster are doing 5-10 secs chunks of mono MP3 (each chunk requires about 3 HTTP request with playlists) - there must be more time spent processing headers and playlists than actual audio. The amount of data in mono audio compared to HD video is tiny.

I ended up downloading ffmpeg static from http://ffmpeg.zeranoe.com/builds/
I tried it and I was so surprised that it supports conversion of all sorts of formats including m3u8 and rtsp.. with a CPU load of 1-3%... So I fiddled around with it and sure enough I was able to get this config file to play well, for all the streams I have. So now I am back to a single Xplay running everything with 2% CPU load! Here is the file, hope you find it interesting. and thanks again for your guidance.


xplay wav * *
# F:{PATH=%f}R:{PATH=%F}
[ffmpeg] -loglevel quiet -i $PATH$ -vn -ar 44100 -ac 2 -ab 128k -f s16le -acodec pcm_s16le -
xplay mp3 * *
# F:{PATH=%f}R:{PATH=%F}B:{BITRATE=-B %B}
[ffmpeg] -loglevel quiet -i $PATH$ -vn -ar 44100 -ac 2 -ab 128k -f mp3 -acodec mp3 -

You can certainly add a flac section by swapping mp3 with flac.