Take screenshots from FLV video

I am working on a video sharing website and I want to take a screenshot of a flv video file from another website like youtube. I am using PHP, but I have no idea how to do this. any guidance is appreciated.

+2


source to share


2 answers


It seems like the ffmpeg extension for PHP .

Looking quickly, something like this should work:



$movie = new ffmpeg_movie('foo.flv');
$frame = $movie->getFrame(1234);
imagefromjpeg($frame, 'foo.jpeg');
imagedestroy($frame);

      

Of course, this means that these extensions must be added to the current PHP installation.

+7


source


You can upload the FLV video to your server (there are many applications and documentation for getting flv from YouTube) and then use a command line tool to extract a screenshot from the video (i.e. similar to this blog post ).



I don't know of any tools that will allow you to do this without downloading a video. While this is technically possible, you will probably have to go beyond PHP and adapt the open source tool to your needs. This site can be a good starting point for such a decision.

+2


source







All Articles