PHPmotion Wiki : ServerVPSDebugging

HomePage :: Contents :: PageIndex :: Login/Register

Debugging FFPmpeg - Mencoder



If you are trying to install PHPmotion on a dedicated server or a VPS and you are having problems converting videos or generating thumbnail images, you can try the following debuging steps:

You will need SSH Access

Disclaimer: These are just helpful tips and you should ensure that you are comfortable working in ssh as we will NOT be liable for any problems or data loss you may cause on your server. If in doubt get a system admin or your web host to do this for you






(1) Login to the server - Create a working directory

mkdir phpmotion-debug

cd phpmotion-debug




(2) Check the paths to ffmpeg etc

The command below, should output some file paths which tell you where your copy of the pragrams ffmpeg and mencoder are installed on your particular server. These are the same paths the PHPmotion will use (as set via your siteadmin)


whereis ffmpeg mencoder


You may find that you have more than one copy of each of the applications installed...in which case, you will need to do the following tests using each path...




(3) Download a test video from our website

wget http://www.phpmotion.com/testclips/lions.mpg 





(4) Try to convert the video using ffmpeg

You will need to use the correct paths that you got in the previous steps. In our example, we are using the path that we got from our own server: /usr/bin/ffmpeg


/usr/bin/ffmpeg -i lions.mpg lions-ffmpeg.flv


If the above has worked, you should see a processes showing that the video is being converted. You can also check if the file lions-ffmpeg.flv now exists by running this command


ls -lh





(5) Try to convert the same video using mencoder

You will need to use the correct paths that you got in the previous steps. In our example, we are using the path that we got from our own server: /usr/bin/mencoder


/usr/bin/mencoder lions.mpg  -o lions-mencoder.flv -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=800:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -vf scale=450:400 -srate 22050




(6) Now try to create a thumbnail image using ffmpeg

/usr/bin/ffmpeg -i lions-ffmpeg.flv -ss 1 -t 00:00:01 -s 120x90 -r 1 -f mjpeg lions.jpg

If the above has worked, you should see a processes showing that the video is being converted. You can also check if the file lions-ffmpeg.flv now exists by running this command


ls -lh






Possible Outcomes




You got some errors

Having run these tests, you may have found that your ffmpeg or mencoder failed to convert videos correctly. In which case, you will need to either reinstall these modules or you can use our server setup service.




Video converted just fine

If the videos did convert correctly via this ssh test and yet they do not convert on your PHPmotion website, then its likely that either


You server does not support what is called command line php. This gives phpmotion the ability to run these same command when
a video finishes uploading

You will need to contact your web host for a solution to this:





Your server has the **exec** command disabled in your php settings. PHPmotion needs access to this command in order to be able to
execute command via ssh shell. To check if this is the case, upload a [[http://wiki.phpmotion.com/HelpPHPinfoFile phpinfo]]file to
your server and check the **disable_functions** section to see if **exec **is listed there.

You will need to contact your web host to get this enabled if its currently disabled





You have some security features installed on your server that are preventing PHPmotion access to ffmpeg and mencoder. 

This could be either: 

	- You have  "open_basedir"  or "safe_mode" restriction set in your php. Check using a phpinfoe
	- You have either "Selinux" or "Suhosin" installed on your server and its restricting PHPmotion from working correctly






HINT


If you managed to convert videos is ssh but you still dont see them when you upload. Try this

  1. Upload a video as normal on your website
  2. Once complete, open the url http://www.yourdomain.com/convertor.php
  3. Check to see if the video is now showing

if the video show after doing this, you should check to see if curl is installed on your server. If its not installed, you should consider installing it.



Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.0478 seconds