Record Live Streaming Radio to MP3


Hits: 484  

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”

Setup SHOUTcast Radio server on Linux


Hits: 3021  

Download and install SHOUTcast DNAS server software

Create new user for running SHOUTCast:

# useradd shoutcast

Download Shoutcast DNAS package: http://download.nullsoft.com/shoutcast/tools/

# wget http://download.nullsoft.com/shoutcast/tools/sc_serv2_linux_x64-latest.tar.gz

Extract SHOUTcast files:

# mkdir sc
# tar -xvf sc_serv2_linux_x64-latest.tar.gz -C sc

Change the ownership from root to the SHOUTcast user:

# chown -R shoutcast:shoutcast sc

Configuring SHOUTcast Server

# cd sc
# nano sc_serv.conf

Copy below content to file sc_serv.conf

adminpassword=password
password=password1
requirestreamconfigs=1
streamadminpassword_1=password2
streamid_1=1
streampassword_1=password3
streampath_1=http://Server-IP-Address:8000
logfile=sc_serv.log
w3clog=sc_w3c.log
banfile=sc_serv.ban
ripfile=sc_serv.rip

Start SHOUTcast server

# ./sc_serv sc_serv.conf

sc2

Please make sure shoutcast port must be open in server firewall

Manage SHOUTcast Server and Create Daemon script

# ps aux | grep sc_serv ## Get Server PID
# killall sc_serv ## Stop server

# vi /usr/local/bin/shoutcast

Content of /usr/local/bin/shoutcast

#!/bin/bash
case $1 in
start)
cd /root/sc/
./sc_serv &
;;
stop)
killall sc_serv
;;
start_daemon)
cd /root/sc/
./sc_serv daemon
;;
*)
echo “Usage shoutcast start|stop”
;;
esac

# chmod +x /usr/local/bin/shoutcast
# /usr/local/bin/shoutcast start
# /usr/local/bin/shoutcast stop

Automatically start the Shoutcast server after server reboot
# echo “/usr/local/bin/shoutcast start_daemon” >> ~/.bashrc

Live video stream event for online Temple or Church


Hits: 5105  

Wowza / Red5 Streaming Live Video with Flash Media Live Encoder

Live Video Stream will be coming
Wowza Live Stream Countdown

Requirements

– A computer running Windows or Apple operating system
– Software “Flash Media Live Encoder (Adobe)”
– Streaming Server (Wowza/Red5/FMS)
– Video input that is recognized by the operating system (i.e. USB camera)
– Video player: VLC or Web Player (JWplayer/Flowplayer/OSMPlayer)

1) Download the free Flash Media Live Encoder

2) Install the Flash Media Live Encoder

3) In the program
– Preset choose bandwidth
– Device Select your video/audio source device
– Choose Video Format H.264
– Choose Audio Format MP3

Enter Stream to Flash Media Server streaming data from your provider

FMS URL: rtmp://[Media-Server-IP-Address]:[Port]/live
Stream: livestream

FMLE

4) Click on “connect”
You will get a pop-up window, enter your username and password you of your received media streaming provider.

5) Click “start” and that’s all!

FMLE

6) Open stream link to your video player that has received.
rtmp://[Media-Server-IP-Address]:[Port]/live/livestream

Links
http://www.adobe.com/products/flash-media-encoder.html
http://www.jwplayer.com/wizard/

Get more help to setup Live video stream event on mobiles (iOS/Androids) using Wowza or Red5 Contact Us

phpMyStream


Hits: 4741  

phpMyStream is media re-stream panel, it use FFmpeg & rtmpdump linux utilities to take source as input then publish to other server like Red5 or Wowza.

phpMyStream

phpMyStream Server Requirement

– Web Server With Apache, PHP, MySQL
– RTMPDump
– FFmpeg
– RTMP Server (Wowza, Red5, Nginx)

phpMyStream-add-stream

RTMPDump Help

FFmpeg Help

phpMyStream-settings

Make Server for phpMyStream

Install rtmpdump
# yum install gcc
# yum install openssl-devel
# wget http://rtmpdump.mplayerhq.hu/download/rtmpdump-2.2e.tar.gz
# tar xvf rtmpdump-2.2e.tar.gz
# cd rtmpdump-2.2e
# make & make install

Install FFmpeg
# yum install ffmpeg ffmpeg-devel ffmpeg-libpostproc opencore-amr

Re-Stream Commands

# rtmpdump –live -r “[Source-Input-RTMP]” -p “http://domain.tv/” -W “http://static.domain.tv/player.swf” -q | ffmpeg -i – -re -isync -acodec copy -vcodec copy -f flv “[Destination-Output-RTMP]”

# rtmpdump -r “[Source-Input-RTMP]” -p “http://www.domain.co/” -T “[Token]” -o- | ffmpeg -re -i – -isync -acodec copy -vcodec copy -f flv “[Destination-Output-RTMP]”

# ffmpeg -re -i “[Source-Input-RTMP]” -y -vcodec libx264 -acodec aac -strict -2 -ar 44100 -f flv “[Destination-Output-RTMP]”

phpMyStream set scheduled task (per minute) to process every stream that need restreaming…

* * * * * curl -s -o /dev/null http://Server-IP/phpMyStream/cron.php

Shoutcast V2 aacPlus AAC+ Player


Hits: 6138  

Shoutcast AAC+ V2

MP3 Radio Streams (Shoutcast/Icecast) are best for Radio Streaming with best bit-rate, but MP3 Streaming need license to broadcast source streams. Radio MP3 music globally play on all devices & platforms. MP3 live radio streaming easily work over HTML5/HTTP.

Whereas AAC+ live radio streaming work on over RTMP. It need flash streaming via RTMP.

Shoutcast V2 aacPlus AAC+ Stream in iOS (iPhone/iPod/iPad) using HTML5 Audio Player

<audio id=”radioaac” src=”http://radio.server.com:port/AACStream.m3u” controls=”true” style=”width:200px; height:50px;”></audio>

Note: AAC+ live streaming over RTMP, and MP3 live streaming over HTML5/HTTP.

Radio Song Album Artwork Cover by YouTube


Hits: 3678  

An album cover is the front / other side of the packaging of a commercially released audio recording product, or album.

You can find online APIs or Websites where artwork available

– Amazon
– LastFM
– Soundcloud
– Apple iTune
– Google Play
– Gracenote
– Free Music Archive

And many more ….

But YouTube is the best source where you can get Album / Song Cover Image for every Title

YouTube provide gdata API to search songs as video title to get image

Deprecated Features for YouTube API v2.0

YouTube Data API (v3)

http://gdata.youtube.com/feeds/base/videos?q=title:<search term>

youtube-artwork.php

<?php
$q = isset($_REQUEST['q'])?$_REQUEST['q']:"";

//thumbnail -> sqDefault, hqDefault

// orderby -> title, relevance, published

?>
 
 
<div id="videos"></div>
 
<!-- Include the latest jQuery library -->
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
 
<script type="text/javascript">

jQuery.getJSON('https://gdata.youtube.com/feeds/api/videos?q=<?php echo $q; ?>&max-results=1&v=2&alt=jsonc&orderby=relevance', function(data) {
    var output="<ul>";
    for (var i in data.data.items) {
        
		output+="<li><img src='" + data.data.items[i].thumbnail.hqDefault + "' /></li>";
		output+="<li>" + data.data.items[i].title + "</li>";
		
    }
	var output="</ul>";
	
    document.getElementById("videos").innerHTML=output;
	
	});

</script>

How you can get cover image?

http://www.domain.com/youtube-artwork.php?q=Ek%20Villain%20-%20Galliyan

song album artwork

PHP Get Radio Stream Type Version


Hits: 3347  

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: 5771  

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 Centova Cast


Hits: 4185  

Centova Cast is an internet radio stream hosting control panel. It is used for hosting radio streams and manage Radio Server like ShoutCast and IceCast. You can manage Auto DJ using Centova Cast v2 Auto DJ System plus Server Control Panel.

Centova Cast Admin

System Requirements for Centova Cast: You can install it on any Linux-based servers.

Operating system: CentOS 4/5/6, RHEL, Debian Linux
Database server: MySQL v4.1+, v5.0, v5.1, or v5.5
Streaming server: SHOUTcast v2.0, SHOUTcast v1.9, IceCast v2.x
Streaming source: ices-cc, sc_trans v2.0, ices v2, ices v0.4, ezstream 0.5.3, sc_trans 0.4.0

# apt-get install liblwp-useragent-determined-perl libconfig-tiny-perl libnet-snmp-perl libxml-simple-perl libconfig-simple-perl libmp3lame-dev libxml2-dev

# apt-get install libxml2 libvorbis-dev libogg-dev libxslt1-dev libcurl3-gnutls libogg0 libspeex1 libtheora0 libvorbis0a libxslt1.1

# wget -O install.sh install.centova.com/LICENSEKEY
# chmod a+x ./install.sh

# ./install.sh –shoutcast-all
# /usr/local/centovacast/sbin/update –add shoutcast1
# apt-get install ia32-libs

# ./install.sh –icecast-all