ffmpeg on vexxhost
I'm currently working on a video conversion project on a vexxhost server using ffmpeg. I was using this article as a guideline for conversion on the vexxhost server, but apparently the ffmpeg_movie class does not exist... after some digging I found a solution.
First, download the getid3 package in order to access all of the properties you'll need from your uploaded videos. It may not be a pretty as using the ffmpeg_movie class, but if you don't have the option and you're hung up on using a class, you can always write your own.
require_once('getid3/getid3.php');
$getID3 = new getID3();
$fileinfo = $getID3->analyze('path/to/originalfile');
getid3_lib::CopyTagsToComments($fileinfo);
if(!empty($fileinfo['video']['resolution_x'])) echo '
Video width: '.$fileinfo['video']['resolution_x'].'
';if(!empty($fileinfo['video']['resolution_y'])) echo '
Video height: '.$fileinfo['video']['resolution_y'].'
';exec("/usr/local/bin/ffmpeg -i 'path/to/originalfile' -ar 22050 -ab 32 -f flv -s ". $fileinfo['video']['resolution_x'] ."x". $fileinfo['video']['resolution_y'] ." 'path/to/convertedfile'");

RSS Feed
Ajax for Web Application Developers