Quote:
Originally Posted by JamesK
Ok sweet it works like a charm! Here's a recap of the whole situation & solution for those with the same problem:
Since LongTail's FLV player does not automaticallly create a preview on the actual video page I had two choices, either enable autoplay so no preview is required, or use a little ffmpeg php script to make a screen cap of the video. The second seemed like a better option to save a lot of bandwidth (it's still user friendly since he only has to click a big ass play button to start the video).
I installed FFMPEG and FFMPEG-PHP (not sure if I needed both but whatever they're both on my server here now. Here are the tutorials for Linux:
FFMPEG tutorial: http://www.mysql-apache-php.com/ffmpeg-install.htm
FFMPEG-PHP tutorial: http://ffmpeg-php.sourceforge.net/
I made a PHP file (thanks Fris & Killswitch) called imgpreview.php and added this code to it.
Code:
<?
$movie = new ffmpeg_movie($_GET['f'], false);
$frame = $movie->getFrame(50);
$im = $frame->toGDImage();
header('Content-type:image/jpeg');
imagejpeg($im);
imagedestroy($im);
?>
And added image=imgpreview.php?f=videofile.flv to the flashvars. If you're using TubeAce like me, you should replace videofile.flv to {video_file} and you're set!
Thanks again guys.
|
If you wanna make it more random, say just a random frame from the video, you can do this...
Code:
<?
$movie = new ffmpeg_movie($_GET['f'], false);
$frame = $movie->getFrame(rand(1, getFrameCount());
$im = $frame->toGDImage();
header('Content-type:image/jpeg');
imagejpeg($im);
imagedestroy($im);
?>
