Importing data from non-wordpress mysql database


Hits: 580  

You have to create an import php file to get the Questions/Answers from a non-wordpress database and bring them into posts in wordpress.

Question Table

<?php

/// non-wordpress database connection string here

require('./wp-load.php');

$results = mysql_query("SELECT * FROM questions");

while ($row = mysql_fetch_assoc($results)) 
{

    $post_information = array(
	'post_title' => wp_strip_all_tags( $row['question'] ),
	'post_content' => $row['answer'],
	'post_category' =>  array(6,7), // Cat Ids
	'post_date' => date('Y-m-d H:i:s', strtotime( $row['timestamp'] )),
	'post_type' => "post",
	'post_excerpt' => "",
	'post_author' => "admin",
	'post_status' => "publish"
	);
	
	$post_id = wp_insert_post( $post_information );		
	
	$filename = "http://www.domain.com/images/post-image.png";   ////  Post Thumbnail Image
	$wp_filetype = wp_check_filetype(basename($filename), null );
	
	$attachment = array(
	  'post_mime_type' => $wp_filetype['type'],
	  'post_title' => preg_replace('/\.[^.]+$/', '', basename($filename)),
	  'post_content' => '',
	  'post_status' => 'inherit'
	);
	
	$attach_id = wp_insert_attachment( $attachment, $filename, $new_post );
	
	//update_post_meta($post_id,'_thumbnail_id',$attach_id);	
	
	add_post_meta($post_id, '_thumbnail_id', $attach_id, true);

}

?>

Install Red5 Media Server on Ubuntu / Debian


Hits: 903  

Red5 is free media server based on Java and other open source frameworks. It support FLV, F4V, MP4, 3GP, MP3, F4A, M4A, AAC and protocols like RTMP, RTMPT, RTMPS, RTMPE.

WMSPanel white label reporting for Red5

Install Red5 Media server
# apt-get install red5-server

Red5 Need below ports open in firewall / iptable
RTMP: 1935
Debug proxy: 1936
HTTP servlet: 5080
RTMPT: 8088

Red5 Installed location
/usr/share/red5/

Red5 application in the location
/usr/share/red5/webapps

Install demo Red5 Applications
# wget http://www.red5.org/downloads/red5/1_0_1/red5-1.0.1.zip
# mkdir red5/
# cd red5
# unzip ../red5-1.0.1.zip
# cd red5-server-1.0/
# cp -R webapps/root/demos /var/lib/red5/webapps/root/demos
# cp -R webapps/installer /var/lib/red5/webapps/installer
# find /var/lib/red5/webapps/ -type d -exec chown _red5 {} \;
# /etc/init.d/red5-server restart

Red5 Installer

http://server-ip-address:5080/installer/

Red5 Demo

http://server-ip-address:5080/demos/

User Agent Parsing with PHP


Hits: 678  

Tobie Langel’s ua-parser, a great library which provides simple UA parsing in PHP, JavaScript and Python.

<?php require_once 'uaparser.php';

$ua = $_SERVER['HTTP_USER_AGENT'];
$parser = new UAParser();
$result = $parser->parse($ua);

echo '<pre>';
print_r($result);

?>

Mistserver Manager Login

Find more libraries here...

https://github.com/rjd22/ua-parser/tree/master/php

https://github.com/Synchro/ua-parser

MistServer PHP API for Live Stream


Hits: 992  

MistServer is a highly versatile, lightweight, customizable open-source multi-standard multimedia server. MistServer configuration is easy to use for full CDN solutions applications. Hope you already read our article to Install MistServer

Mistserver Manager Login

MistServer API provides a Server API and a Management API.

You can find MistServer PHP API Examples Here

Note: Make sure port 4242 used for MistServer is open on your web hosting firewall where you run MistServer PHP API for Live Stream

MistServer PHP API for Live Stream will try to put/get data using PHP CURL in port 4242

$server = new Mistserver();
$server->login(‘http://server-ip:4242/api’, ‘username’, ‘password’);

// you can add a live stream:
$server->add_stream( STREAM_NAME, push://@SOURCE, BUFFER_TIME);

mistserver-api-form

Your channel has been successfully created. Use the details below to broadcast:
Download: Download Flash Media Live Encoder 3.2
FMS URL: rtmp://server-ip:1935/live
Stream Name: churchstream

mistserver-stream

As you get Live Media Stream details you can use our article to make your event live…
Live video stream event for online Temple or Church

API Call Reference: http://www.mistserver.org/doxygen/api.html

Select2Array


Hits: 854  

It’s easy to convert PHP Array to Select Dropdown Box… you need to loop for all element in array to display as dropdown. But may be you ever think for reverse process. Yes, it’s also easy!

You need to scrape / crawl Select box HTML to get PHP Array back from HTML Select Box. Please read our articles for xpath here

Select2Array

<?php

$s = '<select name="country">
<option value="">Country...</option>
<option value="AF">Afghanistan</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AS">American Samoa</option>
<option value="AD">Andorra</option>
<option value="AG">Angola</option>
<option value="AI">Anguilla</option>
<option value="AG">Antigua &amp; Barbuda</option>
<option value="AR">Argentina</option>
<option value="AA">Armenia</option>
<option value="AW">Aruba</option>
<option value="AU">Australia</option>
<option value="AT">Austria</option>
<option value="AZ">Azerbaijan</option>
<option value="BS">Bahamas</option>
<option value="BH">Bahrain</option>
<option value="BD">Bangladesh</option>
<option value="BB">Barbados</option>
<option value="BY">Belarus</option>
<option value="BE">Belgium</option>
<option value="BZ">Belize</option>
<option value="BJ">Benin</option>
<option value="BM">Bermuda</option>
<option value="BT">Bhutan</option>
<option value="BO">Bolivia</option>
<option value="BL">Bonaire</option>
<option value="BA">Bosnia &amp; Herzegovina</option>
<option value="BW">Botswana</option>
<option value="BR">Brazil</option>
<option value="BC">British Indian Ocean Ter</option>
<option value="BN">Brunei</option>
<option value="BG">Bulgaria</option>
<option value="BF">Burkina Faso</option>
<option value="BI">Burundi</option>
<option value="KH">Cambodia</option>
<option value="CM">Cameroon</option>
<option value="CA">Canada</option>
<option value="IC">Canary Islands</option>
<option value="CV">Cape Verde</option>
<option value="KY">Cayman Islands</option>
<option value="CF">Central African Republic</option>
<option value="TD">Chad</option>
<option value="CD">Channel Islands</option>
<option value="CL">Chile</option>
<option value="CN">China</option>
<option value="CI">Christmas Island</option>
<option value="CS">Cocos Island</option>
<option value="CO">Colombia</option>
<option value="CC">Comoros</option>
<option value="CG">Congo</option>
<option value="CK">Cook Islands</option>
<option value="CR">Costa Rica</option>
<option value="CT">Cote D\'Ivoire</option>
<option value="HR">Croatia</option>
<option value="CU">Cuba</option>
<option value="CB">Curacao</option>
<option value="CY">Cyprus</option>
<option value="CZ">Czech Republic</option>
<option value="DK">Denmark</option>
<option value="DJ">Djibouti</option>
<option value="DM">Dominica</option>
<option value="DO">Dominican Republic</option>
<option value="TM">East Timor</option>
<option value="EC">Ecuador</option>
<option value="EG">Egypt</option>
<option value="SV">El Salvador</option>
<option value="GQ">Equatorial Guinea</option>
<option value="ER">Eritrea</option>
<option value="EE">Estonia</option>
<option value="ET">Ethiopia</option>
<option value="FA">Falkland Islands</option>
<option value="FO">Faroe Islands</option>
<option value="FJ">Fiji</option>
<option value="FI">Finland</option>
<option value="FR">France</option>
<option value="GF">French Guiana</option>
<option value="PF">French Polynesia</option>
<option value="FS">French Southern Ter</option>
<option value="GA">Gabon</option>
<option value="GM">Gambia</option>
<option value="GE">Georgia</option>
<option value="DE">Germany</option>
<option value="GH">Ghana</option>
<option value="GI">Gibraltar</option>
<option value="GB">Great Britain</option>
<option value="GR">Greece</option>
<option value="GL">Greenland</option>
<option value="GD">Grenada</option>
<option value="GP">Guadeloupe</option>
<option value="GU">Guam</option>
<option value="GT">Guatemala</option>
<option value="GN">Guinea</option>
<option value="GY">Guyana</option>
<option value="HT">Haiti</option>
<option value="HW">Hawaii</option>
<option value="HN">Honduras</option>
<option value="HK">Hong Kong</option>
<option value="HU">Hungary</option>
<option value="IS">Iceland</option>
<option value="IN">India</option>
<option value="ID">Indonesia</option>
<option value="IA">Iran</option>
<option value="IQ">Iraq</option>
<option value="IR">Ireland</option>
<option value="IM">Isle of Man</option>
<option value="IL">Israel</option>
<option value="IT">Italy</option>
<option value="JM">Jamaica</option>
<option value="JP">Japan</option>
<option value="JO">Jordan</option>
<option value="KZ">Kazakhstan</option>
<option value="KE">Kenya</option>
<option value="KI">Kiribati</option>
<option value="NK">Korea North</option>
<option value="KS">Korea South</option>
<option value="KW">Kuwait</option>
<option value="KG">Kyrgyzstan</option>
<option value="LA">Laos</option>
<option value="LV">Latvia</option>
<option value="LB">Lebanon</option>
<option value="LS">Lesotho</option>
<option value="LR">Liberia</option>
<option value="LY">Libya</option>
<option value="LI">Liechtenstein</option>
<option value="LT">Lithuania</option>
<option value="LU">Luxembourg</option>
<option value="MO">Macau</option>
<option value="MK">Macedonia</option>
<option value="MG">Madagascar</option>
<option value="MY">Malaysia</option>
<option value="MW">Malawi</option>
<option value="MV">Maldives</option>
<option value="ML">Mali</option>
<option value="MT">Malta</option>
<option value="MH">Marshall Islands</option>
<option value="MQ">Martinique</option>
<option value="MR">Mauritania</option>
<option value="MU">Mauritius</option>
<option value="ME">Mayotte</option>
<option value="MX">Mexico</option>
<option value="MI">Midway Islands</option>
<option value="MD">Moldova</option>
<option value="MC">Monaco</option>
<option value="MN">Mongolia</option>
<option value="MS">Montserrat</option>
<option value="MA">Morocco</option>
<option value="MZ">Mozambique</option>
<option value="MM">Myanmar</option>
<option value="NA">Nambia</option>
<option value="NU">Nauru</option>
<option value="NP">Nepal</option>
<option value="AN">Netherland Antilles</option>
<option value="NL">Netherlands (Holland, Europe)</option>
<option value="NV">Nevis</option>
<option value="NC">New Caledonia</option>
<option value="NZ">New Zealand</option>
<option value="NI">Nicaragua</option>
<option value="NE">Niger</option>
<option value="NG">Nigeria</option>
<option value="NW">Niue</option>
<option value="NF">Norfolk Island</option>
<option value="NO">Norway</option>
<option value="OM">Oman</option>
<option value="PK">Pakistan</option>
<option value="PW">Palau Island</option>
<option value="PS">Palestine</option>
<option value="PA">Panama</option>
<option value="PG">Papua New Guinea</option>
<option value="PY">Paraguay</option>
<option value="PE">Peru</option>
<option value="PH">Philippines</option>
<option value="PO">Pitcairn Island</option>
<option value="PL">Poland</option>
<option value="PT">Portugal</option>
<option value="PR">Puerto Rico</option>
<option value="QA">Qatar</option>
<option value="ME">Republic of Montenegro</option>
<option value="RS">Republic of Serbia</option>
<option value="RE">Reunion</option>
<option value="RO">Romania</option>
<option value="RU">Russia</option>
<option value="RW">Rwanda</option>
<option value="NT">St Barthelemy</option>
<option value="EU">St Eustatius</option>
<option value="HE">St Helena</option>
<option value="KN">St Kitts-Nevis</option>
<option value="LC">St Lucia</option>
<option value="MB">St Maarten</option>
<option value="PM">St Pierre &amp; Miquelon</option>
<option value="VC">St Vincent &amp; Grenadines</option>
<option value="SP">Saipan</option>
<option value="SO">Samoa</option>
<option value="AS">Samoa American</option>
<option value="SM">San Marino</option>
<option value="ST">Sao Tome &amp; Principe</option>
<option value="SA">Saudi Arabia</option>
<option value="SN">Senegal</option>
<option value="RS">Serbia</option>
<option value="SC">Seychelles</option>
<option value="SL">Sierra Leone</option>
<option value="SG">Singapore</option>
<option value="SK">Slovakia</option>
<option value="SI">Slovenia</option>
<option value="SB">Solomon Islands</option>
<option value="OI">Somalia</option>
<option value="ZA">South Africa</option>
<option value="ES">Spain</option>
<option value="LK">Sri Lanka</option>
<option value="SD">Sudan</option>
<option value="SR">Suriname</option>
<option value="SZ">Swaziland</option>
<option value="SE">Sweden</option>
<option value="CH">Switzerland</option>
<option value="SY">Syria</option>
<option value="TA">Tahiti</option>
<option value="TW">Taiwan</option>
<option value="TJ">Tajikistan</option>
<option value="TZ">Tanzania</option>
<option value="TH">Thailand</option>
<option value="TG">Togo</option>
<option value="TK">Tokelau</option>
<option value="TO">Tonga</option>
<option value="TT">Trinidad &amp; Tobago</option>
<option value="TN">Tunisia</option>
<option value="TR">Turkey</option>
<option value="TU">Turkmenistan</option>
<option value="TC">Turks &amp; Caicos Is</option>
<option value="TV">Tuvalu</option>
<option value="UG">Uganda</option>
<option value="UA">Ukraine</option>
<option value="AE">United Arab Emirates</option>
<option value="GB">United Kingdom</option>
<option value="US">United States of America</option>
<option value="UY">Uruguay</option>
<option value="UZ">Uzbekistan</option>
<option value="VU">Vanuatu</option>
<option value="VS">Vatican City State</option>
<option value="VE">Venezuela</option>
<option value="VN">Vietnam</option>
<option value="VB">Virgin Islands (Brit)</option>
<option value="VA">Virgin Islands (USA)</option>
<option value="WK">Wake Island</option>
<option value="WF">Wallis &amp; Futana Is</option>
<option value="YE">Yemen</option>
<option value="ZR">Zaire</option>
<option value="ZM">Zambia</option>
<option value="ZW">Zimbabwe</option>
</select>';
									

$doc = new DOMDocument();
$doc->loadHTML($s);
$xpath = new DOMXPath($doc);

$options = $xpath->query('*/select/option');

//print_r($options);

$values = array();
foreach ($options as $option) {

     $in = $option->getAttribute('value'); 
	 if($in=="") $in = rand(0,2);
	 $values[$in] = $option->textContent;
}

//print_r($values);
echo "$"."z = ".var_export($values, true).";";


?>

You can apply same logic for more HTML elements using xpath...

Download Select2Array.php

Install AWStats with GeoIP Plugin


Hits: 2626  

AWStats is a free analytic tool that generates web, streaming, ftp or mail server statistics, graphically. There are many log analyzer but AWStats is open source Web analytics reporting tool, It can analyze log files from Apache, WebStar, IIS.

Installing AWStats on ubuntu 12.04

# apt-get install awstats

Configuring for yourdomain.com replace yourdomain.com with your real domain

# cp /etc/awstats/awstats.conf /etc/awstats/awstats.yourdomain.com.conf
# vi /etc/awstats/awstats.yourdomain.com.conf

Check you have below settings in /etc/awstats/awstats.yourdomain.com.conf

LogFile=”/var/log/apache2/access.log”
SiteDomain=”yourdomain.com”
HostAliases=”localhost 127.0.0.1 yourdomain.com”
DNSLookup=1
LogFormat=1
AllowFullYearView=3

Generate stats for AWStats for /var/log/apache2/access.log file (Make sure you have fresh log file)

# /usr/lib/cgi-bin/awstats.pl -config=yourdomain.com -update

configuration Apache2 with password

# htpasswd -c /etc/awstats/awstats.pwd admin
# chmod 755 /etc/awstats/awstats.pwd

# vi /etc/apache2/sites-available/awstats

<VirtualHost *:80>
ServerName awstats.yourdomain.com
ServerAdmin admin@yourdomain.com
DocumentRoot /var/www
ErrorLog ${APACHE_LOG_DIR}/error_awstats.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access_awstats.log combined
<Directory “/usr/lib/cgi-bin/”>
<Files “awstats.pl”>
Options +ExecCGI
</Files>
</Directory>
Alias /awstats-icon/ “/usr/share/awstats/icon/”
<Directory /usr/share/awstats/icon>
Options None
AllowOverride All
Order allow,deny
Allow from all
</Directory>
RewriteEngine on
RewriteRule /awstats-icon – [L]
RewriteCond %{QUERY_STRING} !^(.*&)?framename=index(&.*)?$
RewriteCond %{QUERY_STRING} ^(.*&)?framename=.*(&.*)?$
RewriteRule /(.*) /usr/lib/cgi-bin/awstats.pl [L]
RewriteCond %{QUERY_STRING} ^(.*&)?config=([^&]*)(&(.*))?$
RewriteRule /.* /%2?%1%4 [R,L]
RewriteRule /awstats.pl$ / [R,L]
RewriteRule /([^/]*)(/.*)? /usr/lib/cgi-bin/awstats.pl?config=$1 [QSA,L]
<Location />
SetHandler cgi-script
Satisfy any
Order deny,allow
Deny from all
AuthType Basic
AuthName “AWStats Access”
AuthUserFile /etc/awstats/awstats.pwd
require valid-user
</Location>
<LocationMatch /(?!awstats.pl|robots.txt)$>
Require user admin
</LocationMatch>
<Location /awstats-icon>
SetHandler None
Allow from all
</Location>
</VirtualHost>

Enable Virtual Host

# a2ensite awstats
# apache2ctl configtest
# /etc/init.d/apache2 reload

Auto update stats

# crontab -e

*/10 * * * * /usr/share/awstats/tools/update.sh
10 03 * * * /usr/share/awstats/tools/buildstatic.sh
*/10 * * * * /usr/lib/cgi-bin/awstats.pl -config=yourdomain.com -update > /dev/null

Set proper permission on logs

# sudo chmod 644 -R /var/log/apache2/*
# chmod 644 /var/log/apache2

# vi /etc/logrotate.d/apache2   (Replace create 640 root adm with create 644 root adm)

Install GeoIP for AWStats

# apt-get install build-essential zlib1g-dev apg libgeo-ipfree-perl libnet-ip-perl libnet-dns-perl liburi-perl apache2-utils

# cd /usr/src/
# wget http://zlib.net/zlib-1.2.8.tar.gz
# tar xvzf zlib-1.2.8.tar.gz
# cd zlib-1.2.8
# ./configure –prefix=/usr/local/zlib && make && make install

# wget http://www.maxmind.com/download/geoip/api/c/GeoIP-latest.tar.gz
# tar xzvf GeoIP-latest.tar.gz
# cd GeoIP-1.6.0
# ./configure && make && make install

# cpan
> install YAML
> install Geo::IP Geo::IPfree Geo::IP::PurePerl URI::Escape Net::IP Net::DNS Net::XWhois Time::HiRes Time::Local
> quit

# cd /usr/src/
# wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
# gzip -d GeoLiteCity.dat.gz
# cp GeoLiteCity.dat /usr/share/GeoIP/GeoLiteCity.dat

Enable AWSTAT configuation for LoadPlugin

# vi /etc/awstats/awstats.yourdomain.com.conf

Remove comment from /etc/awstats/awstats.yourdomain.com.conf

LoadPlugin=”geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat”
LoadPlugin=”geoip_city_maxmind GEOIP_STANDARD /usr/share/GeoIP/GeoLiteCity.dat”

# /etc/init.d/apache2 reload

AWStats will run here

http://awstats.yourdomain.com/yourdomain.com

AWStats-Stats

AWStats-country

AWStats-hours

Error opening /usr/share/GeoIP/GeoIPCity.dat at /usr/local/share/perl/5.14.2/Geo/IP/PurePerl.pm line [file name in /usr/share/GeoIP]

Make sure you have all files in folder /usr/share/GeoIP/GeoLiteCity.dat else copy

# cp /usr/share/GeoIP/GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat

AWStats-UA

Other log file analysis and reporting tools

http://sawmill.net/

http://goaccess.io/

http://www.apacheviewer.com/

http://www.loganalyzer.net/

http://www.webalizer.org/

http://piwik.org/log-analytics/

http://www.w3perl.com/

http://http-analyze.org/index.php

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


Hits: 2169  

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://www.red5.org/downloads/red5/1_0_1/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: 1294  

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

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

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.