Problem streaming intenet radio

Help
2011-05-16
2013-05-30
  • Pollenfresser

    Pollenfresser - 2011-05-16

    Hello,
    I am trying to stream the following radio stations across mediatomb to my Ipad:

    mms://streaming.sbsradio.se/03872_MixMegapol_mid
    http://www.wdr.de/wdrlive/media/wdr2.m3u
    http://ndrstream.ic.llnwd.net/stream/ndrstream_ndr2_hi_mp3.m3u

    I am using mediatomb 0.12.0, cvlc 1.0.6, ubuntu 10.04 (also tried cvlc 1.1.9).

    In the config file I added the lines:

        <mimetype-profile-mappings>
          <transcode mimetype="audio/radiostation" using="mp3_128"/>
          <transcode mimetype="audio/mixmegapol" using="mp3_96"/>
         ....
        </mimetype-profile-mappings> 
          <!-- Profil for NDR2, WDR 2 und 1live. These are streaming in mp3 format with 128 kb -->
          <profile name="mp3_128" enabled="yes" type="external">
            <use-chunked-encoding>no</use-chunked-encoding>
            <mimetype>audio/mpeg</mimetype>
            <accept-url>yes</accept-url>
            <first-resource>yes</first-resource>
            <agent command="/usr/share/mediatomb/vlcaudio" arguments="%in %out 128kb raw"/>
            <buffer size="512000" chunk-size="32000" fill-size="64000"/>
          </profile>
    <!-- Profil for Mix Megapol. This is streaming in mms format with 96 kb -->
          <profile name="mp3_96" enabled="yes" type="external">
            <use-chunked-encoding>no</use-chunked-encoding>
            <mimetype>audio/mpeg</mimetype>
            <accept-url>yes</accept-url>
            <first-resource>yes</first-resource>
            <agent command="/usr/share/mediatomb/vlcaudio" arguments="%in %out 96kb raw"/>
            <buffer size="512000" chunk-size="32000" fill-size="64000"/>
          </profile>
    

    The script "/usr/share/mediatomb/vlcaudio"  contains the following:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    #!/bin/bash
    INPUT="$1"
    OUTPUT="$2"
    AUDIO_BITRATE="$3"
    FORMAT="$4"
    AUDIO_CODEC="mp3"
    AUDIO_SAMPLERATE="44100"
    AUDIO_CHANNELS="2"
    exec /usr/bin/cvlc "${INPUT}" -v --sout="#transcode{acodec=${AUDIO_CODEC},\
    ab=${AUDIO_BITRATE},channels=${AUDIO_CHANNELS},samplerate=${AUDIO_SAMPLERATE}}:\
    standard{access=file,mux=${FORMAT},dst=${OUTPUT}}" vlc://quit
    [code]
    The streaming of the first (mms based) radiostation is working fine, but the other ones fail, no audio and the player (PlugPlayer installed on Ipad)  reports an error. To check this I have sniffed the interface of the server which shall deliver the streaming: 
    When I access the first (mms based) radiostation I can see a "HTTP Get" from the Ipad followed by a HTTP response including the streaming data. For the other two (not working) radio stations I see the same BUT without the streaming data. Therefore I believe that the problem is related to the transcoding within mediatomb resp. cvlc.
    After trying a lot of different settings (specially for the mux parameter of cvlc) without success I have no further ideas. Is cvlc not able to transcode from mp3 to mp3? Or are some settings wrong?
    BTW, at the beginning I used the ffmpeg transcoder for the mp3 streams: they were working in most cases, but I observed a very long delay when I tried to access the stream, so I moved to cvlc, also because ffmpeg isn't able to transcode the mms stream.  And at least using ffmpeg (as far as I remember), I had to switch transcoding on to get results.
    I would be very happy to get some help.
    Greetings
     Peter
    
     
  • Erik

    Erik - 2011-05-18

    Hi!

    I don't have an Ipad but I'd like to get Internet radio to work for Samsungs Allshare. As soon as I can I'll try these scripts in my server and see what I'll come up with.

    I haven't tried cvlc before… but have you tried to "write to file" instead? To verify mp3…
    http://www.ubuntugeek.com/how-to-record-internet-radio-using-vlc.html

    /Erik

     
  • Pollenfresser

    Pollenfresser - 2011-05-19

    It's working now. First of all I had to learn that the mentioned streams  *.m3u are just playlists which contains the real urls of the streams. So, I downloaded and saved the *.m3u files, opened them with an text editor and found the streaming urls.

    On the webpage I added individual entries for each radio station, for example:

    External Link (url)
    Title:  NDR 2
    URL: http://sc24.frf.llnw.net:80/stream/ndrstream_ndr2_hi_mp3
    Protocol: http-get
    Class: object.item.audioItem
    Description: NDR 2
    Mimetype: audio/mp3radio-128kb

    In config.xml I added:

    <transcoding enabled="yes">
        <mimetype-profile-mappings>
          <transcode mimetype="audio/mmsradio-96kb" using="mms_96"/>
          <transcode mimetype="audio/mmsradio-128kb" using="mms_128"/>
          <transcode mimetype="audio/mp3radio-128kb" using="mp3_128"/>
          …..
        </mimetype-profile-mappings>

    and in the profiles section:

    <profile name="mp3_128" enabled="yes" type="external">
            <use-chunked-encoding>no</use-chunked-encoding>
            <mimetype>audio/mpeg</mimetype>
            <first-resource>yes</first-resource>
            <accept-url>yes</accept-url>
            <sample-frequency>44100</sample-frequency>
            <audio-channels>2</audio-channels>
            <hide-original-resource>yes</hide-original-resource>
            <agent command="/usr/share/mediatomb/vlcaudio" arguments="%in %out 128kb raw"/>
            <buffer size="512000" chunk-size="32000" fill-size="64000"/>
          </profile>

          <profile name="mms_96" enabled="yes" type="external">            
            <use-chunked-encoding>no</use-chunked-encoding>                  
            <mimetype>audio/mpeg</mimetype>                                   
            <first-resource>yes</first-resource>
            <accept-url>yes</accept-url>                                     
            <sample-frequency>44100</sample-frequency>
            <audio-channels>2</audio-channels>
            <hide-original-resource>yes</hide-original-resource>
            <agent command="/usr/share/mediatomb/vlcaudio" arguments="%in %out 96kb raw"/>                 
            <buffer size="512000" chunk-size="32000" fill-size="64000"/>     
          </profile>

          <profile name="mms_128" enabled="yes" type="external">
            <use-chunked-encoding>no</use-chunked-encoding>
            <mimetype>audio/mpeg</mimetype>
            <first-resource>yes</first-resource>
            <accept-url>yes</accept-url>
            <sample-frequency>44100</sample-frequency>
            <audio-channels>2</audio-channels>
            <hide-original-resource>yes</hide-original-resource>
            <agent command="/usr/share/mediatomb/vlcaudio" arguments="%in %out 128kb raw"/>
            <buffer size="512000" chunk-size="32000" fill-size="64000"/>
          </profile>

    The script "/usr/share/mediatomb/vlcaudio" :

    #!/bin/bash

    INPUT="$1"
    OUTPUT="$2"
    AUDIO_BITRATE="$3"
    FORMAT="$4"
    AUDIO_CODEC="mp3"
    AUDIO_SAMPLERATE="44100"
    AUDIO_CHANNELS="2"

    exec /usr/bin/cvlc "${INPUT}" -v -sout="#transcode{acodec=${AUDIO_CODEC},\
    ab=${AUDIO_BITRATE},channels=${AUDIO_CHANNELS},samplerate=${AUDIO_SAMPLERATE}}:\
    standard{access=file,mux=${FORMAT},dst=${OUTPUT}}" vlc://quit

    When I start the webradio stream in PlugPlayer it takes 10 sec to hear the music when using mp3 streams, and 20 sec for the mms stream - no idea what the reason for the different delays is. From Plugplayer I forward the stream to my WDTV Live which is connection to my Audio amplifier. This box seems to also add some delay.

    I did some trials also to apply the ffmpeg transcoder instead of the cvlc. I tried to use the following call of ffmpeg within the profile section:

    <agent command="/usr/local/bin/ffmpeg" arguments="-f mp3 -acodec mp3 -ac 2 -ab 128000 -ar 44100 -y -i %in" %out"/>

    but I had no success on this (PlugPlayer showed "error 8"). But when I start ffmpeg from the console with quite the same options

    /usr/local/bin/ffmpeg -f mp3 -acodec mp3 -ac 2 -ab 128000 -ar 44100 -y -i "http://sc24.frf.llnw.net:80/stream/ndrstream_ndr2_hi_mp3"  test1.mp3

    I get a valid (playable) mp3 file.

    BTW, Mediatomb 0.12.0  seems to have a bug: If I add a comment <!-  comment für  ->   in config.xml, that contains a German umlaut (ü,ä,ö), the comment is parsed (!) and error messages occurs.

    Peter

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks