Install Streaming Audio Server With Icecast 2.3.3


Hits: 10735  

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

Make New Application in Red5


Hits: 3981  

1. Make a new directory “svnlabs” under the webapps directory, it will be name of the application “svnlabs”.

Red5 New Apps
Red5 New Apps

2. Create a sub-directory called WEB-INF

– red5-web.properties
– red5-web.xml
– web.xml

webapp.contextPath=/svnlabs
webapp.virtualHosts=*, localhost, localhost:8088, 127.0.0.1:8088

Download “svnlabs” Red5 App here…

3. Restart Red5 Server

SponsorPay API in PHP


Hits: 4033  

SponsorPay – International Leader in Engagement Marketing and Performance Advertising for the Monetization of Virtual Currency and Digital Content on Social Networks, Online Games, Virtual Worlds and Entertainment Platforms.

Mobile Developers - SponsorPay
Mobile Developers – SponsorPay

Key Features:

* Boost branding and engagement
* Acquire users and improve engagement
* Engage and monetize all your users
* Drive customer acquisition and sales
* Grow revenues with innovative products
* Achieve true glocal monetization

SponsorPay Products

* Offer Wall
* Layover Offer Wall
* Offer Banners
* Offer Bar
* Offer Widget
* BrandEngage

SponsorPay Mobile Offer API

JSON Format
http://api.sponsorpay.com/feed/v1/offers.json?appid=[APP_ID]&uid=[USER_ID]&ip=[IP_ADDRESS]&locale=[LOCALE]&device_id=[DEVICE_ID]&ps_time=[TIMESTAMP]&pub0=[CUSTOM]&timestamp=[UNIX_TIMESTAMP]&offer_types=[OFFER_TYPES]&android_id=[ANDROID_ID]&hashkey=[HASHKEY]

XML Format
http://api.sponsorpay.com/feed/v1/offers.xml?appid=[APP_ID]&uid=[USER_ID]&ip=[IP_ADDRESS]&locale=[LOCALE]&device_id=[DEVICE_ID]&ps_time=[TIMESTAMP]&pub0=[CUSTOM]&timestamp=[UNIX_TIMESTAMP]&offer_types=[OFFER_TYPES]&android_id=[ANDROID_ID]&hashkey=[HASHKEY]

<?php

// Step 1: Gather all request parameters

$page = isset($_REQUEST['page'])?$_REQUEST['page']:"1";
$uid = isset($_REQUEST['uid'])?$_REQUEST['uid']:"svnlabs";
$pub0 = isset($_REQUEST['pub0'])?$_REQUEST['pub0']:"sv";
$appid = isset($_REQUEST['appid'])?$_REQUEST['appid']:"APP-ID";
$device_id = isset($_REQUEST['device_id'])?$_REQUEST['device_id']:"DEVICE-ID";
$ip = isset($_REQUEST['ip'])?$_REQUEST['ip']:"IP-ADDRESS";
$apikey = isset($_REQUEST['apikey'])?$_REQUEST['apikey']:"API-KEY";
$format = isset($_REQUEST['format'])?$_REQUEST['format']:"json";

$requestring = 'http://api.sponsorpay.com/feed/v1/offers.'.$format.'?';

$d = array(   
        'appid' => $appid,
        'device_id' => $device_id,
        'ip' => $ip,
        'locale' => 'en',
        'page' => $page,
        'pub0' => $pub0,
        'timestamp' => time(),
        'uid' => $uid,
    );
    
    
//Step 2: Order all request alphabetically    
    
ksort($d);

//Step 3: Concatenate all request parameters

$params = '';

foreach($d as $k=>$v)
{
  $params .= $k."=".$v."&"; 
}    

//Step 4: Concatenate the resulting string with your API Key
//Step 5: Hash the resulting string using SHA1

$hash = sha1($params.$apikey);

$url = $requestring.$params."hashkey=".$hash;

echo file_get_contents($url);

?>

 

SponsorPay is a really good solution for social media platform using more engaging ad units than traditional social media formats.

What is VAST?


Hits: 2811  

Digital Video Ad Serving Template (VAST) is specification to standardize the communication requirements between video players and the ad servers released by Interactive Advertising Bureau (IAB).

what is vast?
what is vast?

VAST data structure is an XML template declares:

* How ad creatives play?
* What to track ad played?

Sample VAST in JavaScript

<script type="text/javascript">
    var options = {
    ads: {
        'skipAd': {
        'enabled': true,
        'timeOut': 5
        },
        'servers'  : [
        {
            'apiAddress': 'vast.xml'
        }
        ], 
        'schedule' : [
        {
            'position' : 'mid-roll',
            'startTime': '00:00:07'
        },
        {
            'position' : 'post-roll'
        }
        ]
    }
    };
    _V_("video", options);
</script>

Screenshots of Video Ads using VAST

VAST Video Ads
VAST Video Ads
VAST HTML5 Video Ads
VAST HTML5 Video Ads
Total Video Ads
Total Video Ads
Android HTML5 Video Ads
Android HTML5 Video Ads

Thank you for visiting svnlabs.com, If you have any questions regarding the contents published in svnlabs.com then kindly contact us via email, we appreciate your feedback and promise you better services…

Email: info [at] svnlabs.com

Mobile: +919928673578

Skype: svnlabs

Twitter: http://twitter.com/svnlabs

FaceBook: http://www.facebook.com/svnlabs

Linkedin: http://www.linkedin.com/in/svnlabs

Concentrate > Observe > Imagine > Launch