Jump to content

[SOLVED] Auto-generate thumbnails for video/flash files?


tbare

Recommended Posts

Hello, all...

 

I'm wondering if there is a (good) way to auto-generate a thumbnails for video (.avi, .wmv, etc.) and flash (.swf) files and display them in a page.

 

Basically, i want to be able to list the files in a directory containing these file types, and have a thumbnail displayed for the file, w/o having to create thumbnails for the files manually (thus, making the site easily updated).

 

Is it possible? i do not have SQL installed on this server, and (as of now) the owner of said server has no plans on installing it. I'd complain, but he's hosting for free... soo... herein lies said problem.

 

If anyone could point me in the right direction, it would be much appreciated...

 

Thanks in advance,

 

TBare

you can, but you have to know how the files are structured.  You will some how have to phrase the video file to the prescribed frame and then use that to create a jpeg or your favorite image type, the GD part of it isn't difficult the hard part will be getting the data to use GD on.

There is no easy way to do this (I don't think php has any built in functions to handle video files); you need to install the ffmpeg-php extension, with which you can do this sort of stuff... once it is installed if you want to get say, the middle frame, you'd do something like

 

$frame = new ffmpeg_movie("/path/to/movie",0);
$frame->.5*getFrameCount();
$frame->getFrame($frame);

 

... rest of the stuff to resize and save $frame as a thumbnail.

 

because your host said he won't install sql, I doubt they'd install ffmpeg-php...

he never said he "wouldn't" install sql, but rather, hasn't installed it after several attempts... and actually, i think he may have installed ffmpeg-php... if so (or if he would later), i'll read more into this at that point... this is more of a pre-lim to seeing if it's even possible before i start actually diving into it... i'm working on a re-design of my website, and trying to make it as easy to add content to as possible so that i will actually be encouraged to do it (as it is now, i have to manually create the thumbnails of the files, then add the links, add the cells in the table, etc... it's just a pain... hopefully i'll get this working...

 

Thanks!!

 

(btw, current site is: http://www.wannafork.com... good stuff if you're bored or just want to waste some time...)

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.