Jump to content

Using FFMPEG to generate thumbnails from FLV


rondog

Recommended Posts

I have it all setup on my server and it works. It works if I point it at an http stream ie. progressive download.

 

I have a series of streaming videos that use the RTMP protocol and I am having issues with this. Is this even possible?

 

What are some options of generating thumbnails automatically with streaming videos?

 

This is how I would normally generate a thumbnail:

<?php
header("Content-type: image/jpeg");

$moviefile 		= "rtmp://dopflash.flash.internapcdn.net/dopflash_vitalstream_com/_definst_/jit/video2.flv";

$mov 			= new ffmpeg_movie($moviefile,false);
$img 			= $mov->getFrame(1);
$showImg 		= $img->toGDImage();

$mkNewImg 		= new ffmpeg_frame($showImg);

$maxWid 		= 150;
$oldWid 		= $mkNewImg->getWidth();
$oldHgt 		= $mkNewImg->getHeight();
$movRatio 		= $oldWid/$oldHgt;

if ($oldWid > $maxWid)
{
$newWid 	= $maxWid;
}

$newHgt 		= $newWid / $movRatio;

$mkNewImg->resize($newWid,$newHgt);

$newImg 		= $mkNewImg->toGDImage();

imagejpeg($newImg,$mkThumbFile,40);
imagedestroy($newImg);
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.