Adam Wares Blog

Tag: phpmotion

Install ffmpeg & Mplayer on a Plesk Server for Phpmotion

by admin on Sep.05, 2008, under Uncategorized, linux, tech

With the current craze of Youtube-ness happening everyone is jumping on the youtube clone site web2.0 bandwagon. Everyone is screaming ME TOO! Where the likes of Phpmotion and Vidiscript free youtube clone software comes in.

The problem is you need a few custom server requirements like ffmpeg and mencoder. The problem is for someone like me (a linux novice) I only barely know terminal and finding clear information is hard because everyone assumes you know what you doing!

So when I got my dedicated fedora server I wanted to make my own youtube site, but wasn’t sure how to install the required components. What made things even more interesting was my server had Plesk running the show, which means default settings wouldn’t work straight out of the box

Here is my tutorial , Installing ffmpeg / mencoder / Flv2tool and LAME for Video Sites On a Fedora 8 PLESK Servers.

For this to work you need to have a dedicated server or something like that (virtual dedicated etc) and know the basics of terminal.

We are going to use YUM to install stuff. Best way to say that YUM just does the hard work for you! Its an installer for the common programs in linux!

LAME:

LAME is our mp3 ‘plugin’ .

SSH into your server as root then type

yum install LAME

Then you will start the installer which will check for the latest version, it will prompt you to download it. Say

‘y’ for yes.

Easy

Ok lets get ffmpeg out of the way

yum install ffmpeg ffmpeg-devel

what you can do is get all the extras for streaming, to be honest I wasnt sure if I needed any of these extras but

always good to have them up your sleave.

yum install gstreamer-plugins-good gstreamer-plugins-pulse gstreamer-plugins-ugly gstreamer-python gstreamer-tools

Install FFMPEG-PHP Extension

ffmpeg-php is a wrapper for PHP. Lets just say you need it

wget http://internode.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.3.1.tbz2 (this downloads the files)
(this is my local mirror - find one closer to you at http://ffmpeg-php.sourceforge.net/)

tar -xjf ffmpeg-php-0.5.3.1.tbz2 (this unzips it)

then make sure you change to the dirrectory that the file is in otherwise you’ll get and error

phpize

./configure
make
make install

Ok at this point we need to edit the PHP.ini so it knows about ffmpeg (like telling your wife to buy milk at the

shop)

open up php.ini , if you dont know where it is simply type

whereis php.ini

add the lines -
[ffmpeg]
extension=ffmpeg.so

Next is Installing Mplayer + Mencoder

yum install mplayer mencoder

easy

Install FLVTool2

find the latest link at http://rubyforge.org/projects/flvtool2/

wget (yoururl)

ruby setup.rb config
ruby setup.rb setup
sudo ruby setup.rb install

Once all that is done your most of the way home, but for to work with your applications on plesk like phpmotion and

Vidiscripts you’ll need to edit the php.ini file to change simple settings. Things like how large the files you can upload can be, and the base directory the script can find everything - this is dependent on the script your running for example vidiscript can be found here - http://vidiscript.com/requirements.html

After you have edited those you’ll need to fix a few loose ends up with Plesk - only simple things navigate to the directory of the domain you plan to use the script on- should be somthing like

/var/www/vhosts/#yourdomain#/conf (where #yourdomain# is the domain!)

we need to update the open_basedir so the script can access ffmpeg so create a file named vhost.conf
and put the following lines in -

<Directory /var/www/vhosts/#yourdomian#/httpdocs>
php_admin_value open_basedir none
</Directory>

then we need to tell plesk to look for vhost.conf which we do in httpd.include, add the lines under the
<VirtualHost> header

Include /var/www/vhosts/#yourdomain#/conf/vhost.conf

then we should be done… we need to do just a couple of things, again from root

run the command
/usr/local/psa/admin/sbin/websrvmng -v -a

this will let plesk know you want to run vhost.conf

then I normally restart apache and plesk

/etc/rc.d/init.d/psa stopall
/etc/rc.d/init.d/psa start
apachectl -k graceful

You should find everything now ready to go! Hopefully. If not, then do a little googling. It seems the best way to learn!

Leave a Comment :, , , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

    Archives

    All entries, chronologically...