Install Red5 1.0.1 on CentOS release 6.5 (Final) 64-Bit


Hits: 9584  

Contact us for Red5 HLS Plugin

Red5 MySQL Authentication Plugin

Wowza MySQL Authentication Plugin

1. Install Java

# yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel

2. Install Ant

# cd /usr/local/src
# wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.8.2-bin.tar.gz
# tar zxvf apache-ant-1.8.2-bin.tar.gz
# mv apache-ant-1.8.2 /usr/local/ant

3. Export path for Ant and Java

# export ANT_HOME=/usr/local/ant
# export JAVA_HOME=/usr/lib/jvm/java
# export PATH=$PATH:/usr/local/ant/bin
# export CLASSPATH=.:$JAVA_HOME/lib/classes.zip

Also add these lines in /etc/bashrc at last to available every-time logged in to SSH

# echo ‘export ANT_HOME=/usr/local/ant’ >> /etc/bashrc
# echo ‘export JAVA_HOME=/usr/lib/jvm/java’ >> /etc/bashrc
# echo ‘export PATH=$PATH:/usr/local/ant/bin’ >> /etc/bashrc
# echo ‘export CLASSPATH=.:$JAVA_HOME/lib/classes.zip’ >> /etc/bashrc

4. Install RED5 Server

# cd /usr/local/src
# wget http://fossies.org/linux/privat/red5-1.0.1.tar.gz
# tar zxvf red5-1.0.1.tar.gz
# mv /usr/local/src/red5-server-1.0 /usr/local/red5

5. Create a service for Red5 to start and stop

# wget -O /etc/init.d/red5 http://www.sohailriaz.com/downloads/red5.txt
# chmod +x /etc/init.d/red5

6. Allow port 5080 and 1935 to your server firewall

# iptables -A INPUT -p tcp -m tcp –dport 5080 -j ACCEPT
# iptables -A INPUT -p tcp -m tcp –dport 1935 -j ACCEPT

make sure you have double hyphen no space (- -) in dport option

OR allow from WHM

port-firewall-whm

7. Red5 Server Command

# /etc/init.d/red5 start
# /etc/init.d/red5 stop
# /etc/init.d/red5 status

# netstat -anp | grep 5080
# ps aux | grep red5

http://yourserver.com:5080/

Go to http://yourserver.com:5080/demos/ofla_demo.html to test Red5 Server Videos over RTMP

Red5-oflaDemo-VOD

Live video stream event for online Temple or Church


Hits: 5042  

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

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

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.

Wowza Live Stream Countdown


Hits: 3072  

Live Stream Time

<?php

function timeElapsed($originalTime){

        $timeElapsed=$originalTime-time();
		
		return $timeElapsed;
}


//$Details['datetimepicker'] = "06/26/2014 11:42 am";  // coming from database

$dtp = timeElapsed( strtotime($Details['datetimepicker']) );

?>
var myCountdownTest = new Countdown({
			time: <?php echo $dtp; ?>,
			width	: 300, 
			height	: 50,
			style:"boring",
			rangeHi:"day",
			labelText	: 	{
			second 	: "SECONDS",
			minute 	: "MINUTES",
			hour	: "HOURS",
			day 	: "DAYS",
			month 	: "MONTHS",
			year 	: "YEARS"			
			},
			onComplete : doneHandler
			});

Live Video Stream will be coming

Download Code: live-stream-countdown.zip

Radio Song Album Artwork Cover by YouTube


Hits: 3579  

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

JSON2CSV – convert json files to csv


Hits: 8025  

JSON2CSV is a python script that converts json data to a csv file.

json2csv

json2csv.py_.txt

Download above text file “json2csv.py_.txt” then rename “json2csv.py”

>> python json2csv.py “input.json” “output.csv”

JSON – input.json

[
{
“createdAt”: “2014-02-20T18:15:56.818Z”,
“fbID”: “34534534534”,
“lessonQuestions”: 5,
“lessonScore”: 2750,
“lesson_no”: 2,
“objectId”: “htmsuPr6F6”,
“updatedAt”: “2014-02-22T15:42:38.166Z”
},
{
“createdAt”: “2014-02-21T16:45:52.550Z”,
“fbID”: “100001132788807”,
“lessonQuestions”: 5,
“lessonScore”: 1100,
“lesson_no”: 3,
“objectId”: “xgmJxEyBHl”,
“updatedAt”: “2014-02-22T18:14:38.107Z”
}
]

CSV – output.csv

createdAt, fbID, lessonQuestions, lessonScore, lesson_no, objectId, updatedAt
2014-02-20T18:15:56.818Z, 34534534534, 5, 2750, 2, htmsuPr6F6, 2014-02-22T15:42:38.166Z
2014-02-21T16:45:52.550Z, 100001132788807, 5, 1100, 3, xgmJxEyBHl, 2014-02-22T18:14:38.107Z

Ref: https://github.com/vladikk/json2csv

PHP Get Radio Stream Type Version


Hits: 3297  

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

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″