I\'m building a cms and I want users to be able to upload videos but I\'m not familiar with video upload & conversion. Is there an example or has anybody coded a solution li
A long, long time ago in my PHP4 days I used the following method, calling ffmpeg on the shell and creating a screenshot.
/**
* Create a snapshot of a videofile and save it in jpeg format
*/
function snapshot($sourcefile,$destfile,$width=184,$height=138,$time=1){
$width=floor(($width)/2)*2;
$height=floor(($height)/2)*2;
exec("ffmpeg -i {$sourcefile} -s {$width}x{$height} -t 0.0001 -ss {$time} -f mjpeg {$destfile}");
}
It takes a supported video file as $sourcefile. The desired file location for the screenshot can be given by the $destfile parameter. Off course make sure that the given location is writeable for the executing user.
Hopefully this is also usable for anyone else who's looking for the right syntax.