Online Radio – Howto

 

Here’s a howto for setting up your own online internet radio station. This was done on a CentOS 6.2 platform but it’s pretty much the same for others as well. Most of the installs are source compiles, yum has been used for some libraries you could use your favourite package manager on your server.

Config files and installation service are available on request. We will be refining this project over time adding much much more funtionality and software to the web player. for now enjoy this player here:

Prepare the server for greatness

  •  yum -y install bzip2-devel ncurses-devel aspell pspell expat-devel gmp-devel freetype-devel flex-devel ruby-libs ruby gd-devel subversion libjpeg-devel libpng-devel gcc-c++ gcc-cpp curl-devel libxml2-devel libtool-ltdl-devel httpd-devel pcre-devel libc-client-devel unixODBC-devel postresql-devel net-snmp-devel libxslt-devel sqlite-devel readline-devel atop htop pspell-devel
  • cd /home/imtiaz/src/; wget http://space.dl.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz
  • tar -zxf lame-3.98.4.tar.gz
  • cd lame-3.98.4
  • ./configure
  • make
  • make install
  • yum install libshout-devel, flac-devel, perl-devel, python-devel, libmp4v2-devel

add a user which will be used to run everything

  • useradd ice
  • passwd ice

start working on the streaming server setup as the user from above

  • su – ice
  • mkdir src
  • cd src
  • wget http://downloads.xiph.org/releases/icecast/icecast-2.3.2.tar.gz
  • wget http://www.centova.com/clientdist/ices/ices-cc-0.4.1.tar.gz
  • tar -zxf icecast-2.3.2.tar.gz
  • tar -zxf ices-cc-0.4.1.tar.gz

setup icecast

  • cd icecast-2.3.2
  • ./configure –prefix=/home/ice/srv
  • make
  • make install

build a local copy of flac 1.1.2(or lower) as ices wont work with latest versions of flac

  • cd ..
  • wget http://downloads.sourceforge.net/project/flac/flac-src/flac-1.1.2-src/flac-1.1.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fflac%2Ffiles%2Fflac-src%2Fflac-1.1.2-src%2F&ts=1338063039&use_mirror=space
  • tar -zxf flac-1.1.2.tar.gz
  • cd flac-1.1.2
  • ./configure –prefix=$HOME/srv
  • make
  • make install

build ices

  • cd ../ices-cc-0.4.1
  • make distclean
  • ./configure –prefix=/home/ice/srv –with-flac=/home/ice/srv
  • make
  • make install

work on the housekeeping

  • export PATH=/home/ice/srv/bin/:$PATH
  • cd srv
  • cd etc/
  • vi icecast.xml
  • cd
  • mkdir -p /home/ice/srv/var/log/icecast
  • chmod -R 755 /home/ice/srv/var

Launch icecast

  • /home/ice/srv/bin/icecast -c /home/ice/srv/etc/icecast.xml -b

(-b sends it to the background, icecast.xml will need to be editted for passwords etc.)

playlist setup and directory structure for music files and playlists

  • cd
  • mkdir media
  • cd media
  • mkdir pls
  • cd ~/srv/bin
  • vi mp3list
  • cd ~/media
  • cd music

##(remove spaces from name of songs)

  • find . -name ‘* *’ | while read file; do target=`echo “$file” | sed ‘s/ /_/g’`; echo “Renaming ‘$file’ to ‘$target'”; mv “$file” “$target”; done;
  • cd ~srv
  • cd bin
  • chmod 755 mp3list

##(generate the playlist)

  • ./mp3list ~/media/music/1 1

(write the config file for the stream)

  • cd ~/srv/etc/
  • mkdir stubs
  • cd stubs
  • vi 1.conf

Launch ices

  • cd
  • srv/bin/ices -c srv/etc/stubs/1.conf

Create the webpage for the demo embedded player

  • su –
  • cd /var/www/vhosts/default/htdocs/
  • mkdir radio
  • cd radio
  • vi 1.htm
  • chmod 755 radio -R

That is it, your radio is online and you can tune in by going to the mountpoint you setup in the ices configuration you used. If you need assistance with this setup please mail us on R at NetBrix dot net. Lots of improvements on the way in the meanwhile enjoy this online radio channel

Extract audio from video + mp3 from video + audio stream extraction

Ever wanted to extract the audio stream from a music video to make it easier to carry on your mp3 player? Well we have developed an application that allows you to do just that!

Not only can you extract the audio from the video you can also extract the optimized flv from the video and download both streams separately. Now how cool is that.

Try it out here

Let us know what you think of the application also if you’d like us to set it up for you.

Server setup for YouTube clones -mencoder+ffmpeg+ffmeg-php+flvtool2+mplayer+libraries+etc.+etc.

This service works with Dreamhost post the horrible Debian update as well

It works for Bluehost servers post recent updates.


Service Options




Ok we’ve been getting a few requests for setting up servers for youtube clones. The back and forth on mail is kinda “not happening” so I’ve written a quick list of what we “need” to get it all rolling and fast! Here’s the list:

  • I need the ssh details of the server. Usually if you came to this page you already tried a bit of poking around so you know what ssh is.
  • I also need to know if you already have a you tube clone script setup (try Social Media, vshare or clipshare). If you do I’ll need to know so that I can test using that script. For an additional negotiable amount, usually $30 but may vary upon complexity, I can help you setup your youtube clone.
  • I also need to pay bills (occasional trip to the Bahamas and the weekend parties at the Tiki bar…. Hilton is just so pretentiously expensive), so I charge for this service. USD 50 is what I expect and I can send you my paypal details if you’re interested and are able to paypal.
  • Since a few people ripped us off we need the payment before we start the work
  • Depending on how your server is setup it takes about 24 hours to set it all up. I can throw in the test application if you’re looking for a script as well please let me know upfront so that I can let you know any reasonable additional charges involved for this script .

So there you are now ping me when you’re ready…. mail me through the Contact Form Here’s a List of scripts we have successfully setup on shared as well as dedicated hosting

  • PHPmotion
  • HWDVideoShare component for Joomla
  • Achtube component for Joomla
  • Clipshare (all versions)
  • Vshare
  • videoshare(agriya)
  • Rayzz
  • social media
  • OSTube
  • PHPFox
  • other custom made scripts for various sites which want to be left anonymous(probably haven’t discovered the magic of reciprocal link exchanges yet 🙁 )

Go ahead and make the payment and while at it also send the ssh information in the encrypted secure message so that I can get on the job right away:


Service Options




ffmpeg-php on dreamhost shared host

Please use the server setup page to request a quote.

How to install ffmpeg-php on a dreamhost shared host under a users account

This HOWTO now includes setup instructions for the following stuff:

  • autoconf
  • LAME
  • ffmpeg
  • GD2
  • mplayer+mencoder
  • Ruby
  • flvtool2
  • libogg
  • libvorbis
  • PHP
  • ffmpeg-php

Disclaimer: Some of you might not be able to make it all work due to various reasons, that does not mean it cannot be done.

For installation assistance please also read The install prerequisites page where we list the requirements for the server setup. Clip-share, vshare, alstrasoft, social media are all scripts which we have setup successfully on Dreamhost, Bluehost, godaddy and many other shared hosting environments (as on 10May2007)

Rayzz, PHPMotion and OSTube also successfully deployed on shared hosts (as on 10August 07)

Prepare the directory
structure
mkdir bin
mkdir lib
mkdir tmp
chmod 777 tmp
chmod 775 bin
chmod 775 lib

Export some environment
variables
export TMPDIR=$HOME/tmp
export PATH=$HOME/bin:$PATH
export LD_LIBRARY_PATH=$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH
export CPATH=$HOME/include:/usr/local/include:$CPATH
export LIBRARY_PATH=$HOME/lib:/usr/local/lib:$LIBRARY_PATH
mkdir src
cd src

AUTOCONF
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
tar -zxf autoconf-2.60.tar.gz
cd autoconf-2.60
./configure "--prefix=$HOME"
make
make install

LAME

wget http://nchc.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
tar -zxvf lame-3.97.tar.gz
cd lame-3.97
./configure "--prefix=$HOME" "--enable-shared"
make
make install

LIBOGG

wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
tar -zxf
libogg-1.1.3.tar.gz
cd libogg-1.1.3
./configure --prefix=$HOME
make
make install

LIBVORBIS

wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz
tar -zxf libvorbis-1.1.2.tar.gz
cd libvorbis-1.1.2
./configure --prefix=$HOME
make
make install

FFMPEG

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg/
./configure "--prefix=$HOME" "--cross-compile" "--enable-shared" "--enable-mp3lame" "--extra-cflags=-I$HOME/include" "--extra-ldflags=-L$HOME/lib"
make
make install

GD2

wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz
tar -zxf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure --prefix=$HOME
make
make install

MPlayer + Mencoder

wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2
bunzip2 essential-20061022.tar.bz2
tar -xf essential-20061022.tar
mv essential-20061022 $HOME/lib
wget http://www3.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc1.tar.bz2
bunzip2 MPlayer-1.0rc1.tar.bz2
tar -xf MPlayer-1.0rc1.tar
cd MPlayer-1.0rc1
./configure --prefix=$HOME --with-codecsdir=$HOME/lib/essential-20061022
make
make install

RUBY
cd $HOME/src
wget ftp://ftp.ruby-lang.org/pub/ruby/stable-snapshot.tar.gz
tar -zxf stable-snapshot.tar.gz
cd ruby
make distclean
./configure --prefix=$HOME
make
make install

FLVTOOL2

wget http://rubyforge.org/frs/download.php/9225/flvtool2_1.0.5_rc6.tgz
tar -zxvf flvtool2_1.0.5_rc6.tgz
cd flvtool2_1.0.5_rc6
ruby setup.rb config –prefix=$HOME
ruby setup.rb setup
ruby setup.rb install

PHP
wget http://us2.php.net/distributions/php-4.4.4.tar.bz2
bunzip2 php-4.4.4.tar.bz2
tar xf php-4.4.4.tar
cd php-4.4.4
./configure --prefix=$HOME --libdir=$HOME/lib --bindir=$HOME/bin --with-ffmpeg=$HOME
make
make install

FFMPEG-PHP
wget http://superb-east.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.0.tbz2
bunzip2 ffmpeg-php-0.5.0.tbz2
tar -xf ffmpeg-php-0.5.0.tar
cd ffmpeg-php-0.5.0
phpize
./configure "--prefix=$HOME" "--libdir=$HOME/lib" "--bindir=$HOME/bin" "--with-ffmpeg=$HOME"
make clean
make install

Setup users environment
to use the php installed earlier

cd $HOME/lib
cp $HOME/lib/php/extensions/no-debug-non-zts-20020429/ffmpeg.so ./
cp $HOME/src/php-4.4.4/php.ini-recommended php.ini
vi php.ini (add extension= /home//lib/ffmpeg.so)</STRONG>< /STRONG>

To enable site:
cp $HOME/bin/php $HOME/cgi-bin/php.cgi

add a .htaccess with following content

AddHandler phpFive .php
Action phpFive /cgi-bin/php.cgi

You might need to also run the following

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/lib
” export LIBRARY_PATH=
$HOME/lib:$LIBRARY_PATH”
“export
CPATH=$HOME/include/:$HOME/include/lame/”

as well as put it ahead of any
call to ffmpeg in your PHP code. Please send questions through the sitecontact form
.-Imtiaz (khanimtiaz at gmail dot com)

We have got this procedure working on a variety
of shared hosts besides dreamhost. For installation assistance please also read
the install prerequisites page