I need to create a screenshot from a video,
I followed this tutorial to do the internal setup in window 8, php 5.3
1) I downloaded ffmpeg from here - [ http://ffmpeg.zeranoe.com/builds/ ] for a 64-bit operating system.
2) I followed https://www.youtube.com/watch?v=gU49GiWGGAI , the video and successfully completed the entire configuration, and phpinfo() shows that ffmpeg installed.
3) Then I tried this one to find out if it works or not,
He worked successfully
4) Next, I completed this video tutorial here , and the thumbnails were created successfully.
below is my code
/** * FFMPEG-PHP Test Script * * Special thanks to http://www.sajithmr.me/ffmpeg-sample-code for this code example! * See the tutorial at http://myownhomeserver.com on how to install ffmpeg-php. */ error_reporting(1); error_reporting(E_ALL ^ E_NOTICE); // Check if the ffmpeg-php extension is loaded first extension_loaded('ffmpeg') or die('Error in loading ffmpeg'); // Determine the full path for our video $vid = realpath('./videos/myvideo.mp4'); $videosize = filesize($vid); $remoteVideo = 'http://video-js.zencoder.com/oceans-clip.mp4'; //ffmpeg $ffmpeg = dirname(__FILE__) . "\\ffmpeg\\bin\\ffmpeg"; $imageFile = "1.png"; $image2 = "2.png"; $size = "120x90"; $getfromsecond = 7; $cmd = "$ffmpeg -i $vid -an -ss $getfromsecond -s $size $imageFile"; $cmd2 = "$ffmpeg -i $remoteVideo -an -ss $getfromsecond -s $size $image2"; if(!shell_exec($cmd)){ echo "Thumbnail created"; }else{ echo "Error Creating thumbnail"; } if(!shell_exec($cmd2)){ echo "Thumbnail for remote url was created"; }else{ echo "Error Creating thumbnail for remote url "; }
OUTPUT Thumbnail created Thumbnail for remote url was created
Now the above code works as expected in my local, windowed computer, I need to do this in my server environment (Linux server) with php 5.5. How can I configure ffmpeg configuration on CentOS server version 6.5 with php 5.5.
I followed this guide to install it on the server
1.http : //supportlobby.com/blog/ffmpeg-installation-on-centos-6-5/
2.http : //tecadmin.net/install-ffmpeg-on-linux/
EXIT TO THE CONSOLE
[root@BRANDWEB01D ~]
But on the server, when I open my php file, I get this error Error in loading ffmpeg
I also checked phpinfo (), it shows that ffmpeg is installed in my local, but not on the server.
What else do I need to do to configure ffmpeg in Cent Os 6.5 php 5.5.
php ffmpeg video screenshot centos
Hitesh
source share