Record Live Streaming Radio to MP3


Hits: 592  

Sometime you want to record Live Radio Stream to MP3 file, you can find many online linux tools for recording radio stream to server and then download to your local computer.

You can use Linux “wget” or “curl”

CURL

# curl -sS -o stream.mp3 –max-time 150 http://Radio-Server:Port/stream
Bitrate: 128 kb/s [it will make approx 2MB MP3 file]

# curl -sS -o stream.mp3 –max-time 150 http://Radio-Server:Port/stream
Bitrate: 64 kb/s [it will make approx 1MB MP3 file]

FFMPEG

# ffmpeg -y -i http://Radio-Server:Port/stream stream.mp3

# ffmpeg -i http://Radio-Server:Port/stream -t 00:00:40 -acodec copy stream.mp3
[It will record MP3 file stream.mp3 of duration of 40 sec with same Radio Stream Codec Info & Bitrate]

MPLAYER & LAME

# mplayer ‘http://Radio-Server:Port/stream’ -endpos ’00:01:00′ -vo null -ao pcm:waveheader:file=stream.wav &> /dev/null
# lame stream.wav stream.mp3 &> /dev/null

WGET

# wget -O stream.mp3 “http://Radio-Server:Port/stream”

PHP Get Radio Stream Type Version


Hits: 3433  

Live Audio Streaming, Internet Radio Player

Shoutcast1 Stream: http://shoutcast-server:port/;audio.mp3
Shoutcast2 Stream: http://shoutcast-server:port/streamname;audio.mp3
Icecast2 Stream: http://icecast-server:port/streamname

Shoutcast server stream need “;” OR “;audio.mp3” at end of stream URL, so change accordingly

 

<?php

function radioStreamType($stream)
{

$pp = parse_url($stream);
$type = strstr($pp[‘path’], ‘;audio.mp3’);

if($type==’;audio.mp3′)
{
if($pp[‘path’]==”/;audio.mp3″ || $pp[‘path’]==”;audio.mp3″) return “shoutcast1”;
return “shoutcast2”;
}
else
{
return “icecast”;
}
}

?>

 

shoutcast-version-1

radioStreamType(“http://shoutcast-server:port/;audio.mp3”);

shoutcast-version-2

radioStreamType(“http://shoutcast-server:port/streamname;audio.mp3”);

icecast

radioStreamType(“http://icecast-server:port/streamname”);

ICECAST SHOUTCAST METADATA

Re Stream Radio Shoutcast / Icecast using Node JS


Hits: 5946  

Re-stream Radio (Shoutcast/Icecast) Stream using Node.JS and get Metadata current playing song title… Use port forwarding to hide real shoutcast IP …. Avoid PHP script to damage Server with too many calls on radio server

Start Restream

> node radio.js

node.js>node radio.js
Server running at http://192.168.1.4:8007

Radio Stream connected!
{ ‘icy-notice1’: ‘<BR>This stream requires <a href=”http’,
‘icy-notice2’: ‘SHOUTcast Distributed Network Audio Server/Linux v1.9.8<BR>’,
‘icy-name’: ‘Radio HSL – Hit Hai Toh Bajega!’,
‘icy-genre’: ‘Indian Hindi Top40’,
‘icy-url’: ‘http’,
‘content-type’: ‘audio/mpeg’,
‘icy-pub’: ‘1’,
‘icy-metaint’: ‘32768’,
‘icy-br’: ’64’ }
StreamTitle=’Bullett Raja – Tamanche Pe Disco [1e92]’;StreamUrl=”;

Get MetaData

> node radio-metadata.js

node.js>node radio-metadata.js
Server listening on port 8079
Radio Stream connected!
StreamTitle=’Bullett Raja – Tamanche Pe Disco [1e92]’;StreamUrl=”;

Output in browser:
“StreamTitle=’Bullett Raja – Tamanche Pe Disco [1e92]’;StreamUrl=”;\u0000\u0000\u0000\u0000\u0000″

Install Airtime – open source radio automation software


Hits: 8142  

Airtime is open source radio automation software (GPL v3) for GNU/Linux platforms. It’s recommend installing on Ubuntu Linux 12.04 LTS or Debian Squeeze on a computer with at least a 1 GHz processor and 512 MB of RAM for a Server Edition OS or 1GB of RAM for a Desktop Edition OS.

Download airtime-easy-setup

$ sudo wget http://apt.sourcefabric.org/misc/airtime-easy-setup.deb
$ sudo apt-get install gdebi

$ sudo gdebi airtime-easy-setup.deb

Airtime-Icecast
Airtime-Icecast

Unpacking airtime-easy-setup (from airtime-easy-setup.deb) …
Setting up airtime-easy-setup (2.3.0-1) …
Installing Sourcefabric package signing key…
OK
Setting up Airtime for Etc/UTC timezone…
Setting Icecast and Airtime domain names to ip-10-xxx-yy-74.ec2.internal…
Setting defaults for non-interactive installation…
Checking that the server has a UTF-8 locale…
en_US.UTF-8 is the default locale on this server and appears to support UTF-8 encoding.

Now please run the commands:

sudo apt-get update
sudo apt-get install airtime

After that, installation of Airtime should be complete in a couple of minutes.

You should then be able to log in to Airtime at http://ip-10-xxx-yy-74.ec2.internal/
Processing triggers for man-db …

Install Airtime

$ sudo apt-get update
$ sudo apt-get install airtime

*** Verifying your system environment, running airtime-check-system ***
AIRTIME_STATUS_URL = http://ip-10-xxx-yy-74.ec2.internal:80/api/status/format/json/api_key/%%api_key%%
AIRTIME_SERVER_RESPONDING = OK
KERNEL_VERSION = 3.5.0-21-generic
MACHINE_ARCHITECTURE = x86_64
TOTAL_MEMORY_MBYTES = 604072
TOTAL_SWAP_MBYTES = 0
AIRTIME_VERSION = 2.3.0
OS = Ubuntu 12.10 x86_64
CPU = Intel(R) Xeon(R) CPU E5430 @ 2.66GHz
WEB_SERVER = Apache/2.2.22 (Ubuntu)
PLAYOUT_ENGINE_PROCESS_ID = 19766
PLAYOUT_ENGINE_RUNNING_SECONDS = 32
PLAYOUT_ENGINE_MEM_PERC = 2.6%
PLAYOUT_ENGINE_CPU_PERC = 0.9%
LIQUIDSOAP_PROCESS_ID = 19801
LIQUIDSOAP_RUNNING_SECONDS = 31
LIQUIDSOAP_MEM_PERC = 3.4%
LIQUIDSOAP_CPU_PERC = 7.9%
MEDIA_MONITOR_PROCESS_ID = 19701
MEDIA_MONITOR_RUNNING_SECONDS = 38
MEDIA_MONITOR_MEM_PERC = 2.4%
MEDIA_MONITOR_CPU_PERC = 0.0%
RABBITMQ_PROCESS_ID = 16705
RABBITMQ_RUNNING_SECONDS = 427
RABBITMQ_MEM_PERC = 4.8%
RABBITMQ_CPU_PERC = 0.9%
— Your installation of Airtime looks OK!

******************************* Install Complete *******************************
Setting up liquidsoap-plugin-faad (1.0.1+repack1-1) …
Processing triggers for libc-bin …
ldconfig deferred processing now taking place

Airtime
Airtime

Help: http://en.flossmanuals.net/airtime-en-2-3/easy-setup/

Install Streaming Audio Server With Icecast 2.3.3


Hits: 10866  

I need to install streaming audio server with Icecast (OGG/MP3) for one of my great client in service of http://html5.svnlabs.com/. Icecast was designed to stream any audio file using ices and icegenerator for MP3 and OGG/Vorbis audio files.

HTML5 MP3 Player with Playlist
HTML5 MP3 Player with Playlist

I already did lot of work using Shoutcast, SAMCast and SAM Broadcaster, Its very easy to use audio casting server online.

Today we will try to install Icecast 2.3.3 on CentOS x86_64 Server…

icecast is free server software for streaming multimedia.
icecast is free server software for streaming multimedia.

Setup Icecast Server

Download source and rpm needed

# yum groupinstall “Development Tools”
# yum install -y curl-devel libtheora-devel libvorbis-devel libxslt-devel speex-devel libxslt
# rpm –import http://apt.sw.be/RPM-GPG-KEY.dag.txt
# cd /home
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
# mkdir -p /usr/src/icecast
# cd /usr/src/icecast
# wget http://downloads.xiph.org/releases/icecast/icecast-2.3.3.tar.gz

Unzip Icecast source

# tar xf icecast-2.3.3.tar.gz
# cd icecast-2.3.3

Configure, Compile and Install

# ./configure –prefix=/opt/icecast/2.3.3
# make
# make install

You might find icecast binary .. please confirm 😉

# ls /opt/icecast/2.3.3/bin/

Configure icecast with icecast.xml
# cd /opt/icecast/2.3.3/etc
# vi icecast.xml

Find more help here to setup xml file http://icecast.org/docs/icecast-2.3.1/icecast2_config_file.html

Create icecast user & group

# groupadd -g 200 icecast
# useradd -d /var/log/icecast -m -g icecast -s /bin/bash -u 200 icecast

Before start icecast server check permission and make log folder
# mkdir -p /var/run/icecast
# chown -R icecast:icecast /var/run/icecast

Start the icecast server

# /opt/icecast/2.3.3/bin/icecast -c /opt/icecast/2.3.3/etc/icecast.xml -b   (background)

You will find Icecast server running here
http://Server-IP:8000/

Icegenerator – MP3 streaming client

Compile libshout and lib3lib (ID3 support), run ldconfig

# cd /usr/src/icecast
# wget http://downloads.us.xiph.org/releases/libshout/libshout-2.3.1.tar.gz

# tar xf libshout-2.3.1.tar.gz
# cd libshout-2.3.1

# ./configure –prefix=/opt/icecast/2.3.3
# make
# make install

Install icegenerator

# cd /usr/src/icecast
# wget http://netcologne.dl.sourceforge.net/project/icegenerator/icegenerator/0.5.5-pre2/icegenerator-0.5.5-pre2.tar.gz
# tar xfz icegenerator-0.5.5-pre2.tar.gz
# cd icegenerator-0.5.5-pre2

# ./configure
# make
# make install

Now configure icegenerator to create MP3 radio station

# vi /usr/local/etc/svnlabs

IP=127.0.0.1
PORT=8000
SERVER=2
MOUNT=/svnlabs
PASSWORD=password***
FORMAT=1
MP3PATH=m3u:/var/www/html/svnlabs.m3u
LOOP=1
SHUFFLE=1
NAME=SVNLabs MixStreams
DESCRIPTION=SVN Labs Softwares
GENRE=svnlabs
URL=http://Server-IP:8000/
LOG=2
LOGPATH=/var/log/icecast/icegen.log
BITRATE=48000
SOURCE=source

You can even use MP3 folder path

MP3PATH=pth://var/www/html/songs

Create playlist file

# vi /usr/local/etc/svnlabs.m3u

/var/www/html/songs/svnlabs1.mp3
/var/www/html/songs/svnlabs2.mp3

Or try ….

# find /var/www/html/songs/ -name “*.mp3” > /var/www/html/svnlabs.m3u

Make sure you have setup all paths
# su – icecast -c “export LD_LIBRARY_PATH=/opt/icecast/2.3.3/lib:$LD_LIBRARY_PATH; /usr/local/bin/icegenerator -f /usr/local/etc/svnlabs”

Get more help from here for icegenerator variables http://www.becrux.com/index.php?page=projects&name=icegenerator

http://Server-IP:8000/svnlabs

Start other radio station using Running Icecast Server

# /usr/local/bin/icegenerator -f /usr/local/etc/indie

Icecast Streaming Media Server
Icecast Streaming Media Server

What is the Difference Between Shoutcast and Icecast?


Hits: 5351  
Shoutcast Server


Icecast Server


Plus Point – Your radio and online stream will be listed in the Shoutcast directory where you can find online radio stations and Internet radio from around the world. – Do OPOCE to deny access to certain IP addresses to your live stream.

– Easy to use and very robust.

– Icecast streaming server uses Mountpoint which means that on the same account (server) can run in multiple streams of different quality. The advantage Mountpoint most sense if you use a combination of Auto DJ and live streaming. Unlike Shoutcast will not have to manually interrupt the Auto DJ to grace the live stream for Icecast is done automatically. – Ogg format supported streaming although here the format is not so popular.

– You can protect your passwords from the stream.

– Better support for video streaming.

– Icecast is open source software with frequent updejtovima. Anyone can develop Icecast server.


 


 

Minus Point – If you want to include and use the Auto DJ options in combination with live streaming then you will have the first DJ to stop the car before you can continue to live streaming. – Shoutcast is not opensource and is owned by AOL.

– Shoutcast server has frequent Updates.

– Directory of online radio stations is not nearly as popular as the Shoutcast directory. – Is not primarily intended for beginners in the world live streaming.

 

The conclusion is that most users will choose the Shoutcast server. However, if you will use a combination of Auto DJ and live streaming Icecast then certainly a better choice. Radiolive offers both options to their customers. Perhaps it is good to note that though most of our users use Shoutcast streaming server.

 

Play Favorite Radio FM Stream in HTML5

HTML5 <audio> the element enable native audio playback within the browser. It supports all browsers i.e. Firefox, Chrome, Safari, IE and Opera.

HTML5 Player support Radio FM MP3 Streams from Icecast, Shoutcast, Wowza, Amazon S3 and other CDNs.. customize your radio playlist now.

Radio Stream Playlist


Hits: 4596  

Radio Live Streaming

 

HTML5 MP3 Player with Playlist

Windows Playlist: playlist.asx

<asx version = "3.0">
    <Title>Radio Title</Title>
    <Author>http://www.svnlabs.com</Author>
    <Copyright>SVN Labs</Copyright>
    <PARAM name="HTMLView" value="http://www.svnlabs.com" />
    <MoreInfo href="http://www.svnlabs.com" />
    <entry>
        <ref href="http://stream-ip:port/stream" />
        <Title>Radio Title</Title> 
        <Author>http://www.svnlabs.com</Author>
    </entry>
</asx>

 

Quicktime Playlist: playlist.qtl

<?xmlversion="1.0"?>
<?quicktime type="application/x-quicktime-media-link"?>
<embed src="icy://stream-ip:port/stream" autoplay="true" />

 

Winamp Playlist: playlist.pls


numberofentries=1
File1=http://stream-ip:port/stream
Title1=Radio Title
Length1=-1
version=2

 

Realmedia Playlist: playlist.ram

http://stream-ip:port/stream

Play Favorite Radio FM Stream in HTML5

HTML5 <audio> the element enable native audio playback within the browser. It supports all browsers i.e. Firefox, Chrome, Safari, IE and Opera.

HTML5 Player support Radio FM MP3 Streams from Icecast, Shoutcast, Wowza, Amazon S3 and other CDNs.. customize your radio playlist now.