how to use it on my script?..
this script work with my XAMMP. this require FFMPEG.EXE
but .exe is not working on linux, .exe is only for WINDOWS
may panel is LINUX
HERE's the CODE
this script is to give SCREENSHOT on the video
If ffMPEG is already installed on my server..
so how to use it on my given script?
PLEASE HELP ME!!!
this script work with my XAMMP. this require FFMPEG.EXE
but .exe is not working on linux, .exe is only for WINDOWS
may panel is LINUX
HERE's the CODE
this script is to give SCREENSHOT on the video
PHP Code:
<?php
$ffmpeg = 'ffmpeg.exe';
// change "demo.mpg" to your mpg file name!
$video = dirname(__FILE__) . "\demo.3gp";
// change "demo.jpg" to whichever name you like or don't
// for this example, the name of the output jpg file does not matter
$image = dirname(__FILE__) . "\demo.jpg";
$second = 1;
$cmd = "$ffmpeg -i $video 2>&1";
if (preg_match('/Duration: ((\d+):(\d+):(\d+))/s', `$cmd`, $time)) {
$total = ($time[2] * 3600) + ($time[3] * 60) + $time[4];
$second = rand(1, ($total - 1));
}
$cmd = "$ffmpeg -i $video -deinterlace -an -ss $second -t 00:00:01 -r 1 -y -vcodec mjpeg -f mjpeg $image 2>&1";
$return = `$cmd`;
echo 'done!';
?>
so how to use it on my given script?
PLEASE HELP ME!!!
Comment