I'm working on a video sharing website where people can upload their own videos and I want the most recent uploads to be shown on the index page, but not as videos but thumbnails, so that when you click on the thumbnail you get to the video page. You guys all know how youtube's index looks/works -- that's what I'm trying to simulate.
I read about ffmpeg but it seems to me it would only work if you have ffmpeg installed on your computer. I want this to be an automated process though without the user having to first install something on their pc.
Is there a way I can code this? Or do i have to use some kind of framework or CMS? Could this problem be solved by simply getting ffmpeg hosting (example)?
If there is no manual way to do this in php, is there way using python?
Fyi, my website is written in php and i use jwplayer to stream the videos.
Please note that I want to get a thumbnail from a video that's been uploaded on my server and not a youtube or vimeo thumbnail.
I have worked on this kind of issue and I am sure that user don't need ffmpeg on there pc instead you need a server which has ffmpeg installed.
To create thumbnail from video try the code below.
<?php
$video = 'path/to/video.flv';
$thumbnail = 'path/to/thumbnail.jpg';
shell_exec("ffmpeg -i $video -deinterlace -an -ss 1 -t 00:00:01 -r 1 -y -vcodec mjpeg -f mjpeg $thumbnail 2>&1");
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With