View Single Post
Old 05-19-2009, 03:52 PM  
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,372
Quote:
Originally Posted by JamesK View Post
I need a php file that automatically grabs a screen cap of the first second of a flv video, using ffmpeg. I want to be able to use it in LongTail Video's flash player.

Anyone know how to do this?
this is really rough, prob could be done better but.

Code:
<?
$video = $_GET['f'];
$movie = new ffmpeg_movie($video, false);
$frames = $movie->getFrameCount();
$frame = $movie->getFrame(50);
$im = $frame->toGDImage();
imagejpeg($im,"$video.jpg");
imagedestroy($im);
header("Content-type:image/jpeg");
readfile("$video.jpg");
?>
then call it via a flashvar

Code:
so.addVariable("image", "imgflv.php?f=video.flv");
you get the idea.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote