I did what you guys told me
But you didn't. :-) Look:
make_jpg("
folder/videofile.flv", "folder/test.jpg", "01");
"folder" will be relative to "wherever you are." The program you are referencing will execute from "where it is" - like so:
I am in /var/www/example.com/folder
I execute ffmpeg, which is in /usr/bin/ffmpeg
I pass my function "folder/videofile" so it's going to attempt operation on /usr/bin/ffmpeg/folder/videofile . . . .
which doesn't exist. Same is true of /test.jpg, you may think you're putting it at domain root, but that is
from a browser and a url, even if it worked it would attempt to write the file to the server root, next to /var and /etc and all the other files - PHP won't have permissions to do that (and would be hella dangerous if it did.)
Not sure what your system path is, but you need to do something like this:
$root = '/var/www/mysite.com'; // Or $_SERVER['DOCUMENT_ROOT']
$videodir = 'folder';
make_jpg("$root/$videodir/videofile.flv", "$root/test.jpg", "01");
The second path - to write to - may not work, and is not a "great idea." This would mean the root of yoursite.com is writable, which is not all that safe. I'd direct it to a folder too that has appropriate permissions for PHP to write:
make_jpg("$root/$videodir/videofile.flv", "$root/
thumbnails/test.jpg", "01");
Another thing you need to do - you're not using error trapping correctly, which will be a big help. Look at this:
if(!file_exists($input)) return false;
So if the file doesn't exist, it returns null, but you're not doing anything with the function call. Do one of these two:
$ok = make_jpg("$root/$videodir/videofile.flv", "$root/thumbnails/test.jpg", "01");
if (! $ok) { die("Whoops. File $root/$videodir/videofile.flv doesn't exist!"); }
or
if (! make_jpg("$root/$videodir/videofile.flv", "$root/thumbnails/test.jpg", "01")) {
die("Whoops. File $root/$videodir/videofile.flv doesn't exist!");
}
Both of those will help tell you what's wrong, at least. ffmpeg is a bugger to get to work at times, but get the paths right and error trap wherever you can for starters.