video - how to use ffmpeg with php and upload and compress the file -


hello have installed ffmpeg inmy local computer , wanted know how use when uploading files php server . want files uploaded user converted swf format. have incresed upload limit php.ini there no issue of upload_mx_size

till using code

 <?php  $srcfile = "test/sample.mp4"; $destfile = "/test/sample22"; $ffmpegpath = "/usr/local/bin/ffmpeg"; $flvtool2path = "/usr/local/bin/flvtool2";  // create our ffmpeg-php class $ffmpegobj = new ffmpeg_movie($srcfile); // save our needed variables $srcwidth = makemultipletwo($ffmpegobj->getframewidth()); $srcheight = makemultipletwo($ffmpegobj->getframeheight()); $srcfps = $ffmpegobj->getframerate(); $srcab = intval($ffmpegobj->getaudiobitrate()/1000); $srcar = $ffmpegobj->getaudiosamplerate(); $srcvb = floor($ffmpegobj->getvideobitrate()/1000);   // call our convert using exec() convert 3 file types needed html5 exec($ffmpegpath . " -i ". $srcfile ." -vcodec libx264 -vpre hq -vpre ipod640 -b ".$srcvb."k -bt 100k -acodec libfaac -ab " . $srcab . "k -ac 2 -s " . $srcwidth . "x" . $srcheight . " ".$destfile.".mp4");  exec($ffmpegpath . " -i ". $srcfile ." -vcodec libvpx -r ".$srcfps." -b ".$srcvb."k -acodec libvorbis -ab " . $srcab . " -ac 2 -f webm -g 30 -s " . $srcwidth . "x" . $srcheight . " ".$destfile.".webm");  exec($ffmpegpath . " -i ". $srcfile ." -vcodec libtheora -r ".$srcfps." -b ".$srcvb."k -acodec libvorbis -ab " . $srcab . "k -ac 2 -s " . $srcwidth . "x" . $srcheight . " ".$destfile.".ogv");  ?> 

dont know or not dosent works when refresh page page says

 "fatal error: class 'ffmpeg_movie' not found in     c:\xampp\htdocs\video\videoupload.php on line 9"   

i have checked file sample.mp4 exists test folder please me upload video files , convert swf format ffmpeg lib

you may missing module, uses php -m or phpinfo() see if have module called 'ffmpeg-php' installed. if missing need install if want use class


Comments