tbare Posted November 10, 2007 Share Posted November 10, 2007 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 Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 10, 2007 Share Posted November 10, 2007 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. Quote Link to comment Share on other sites More sharing options...
alecks Posted November 10, 2007 Share Posted November 10, 2007 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... Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 10, 2007 Share Posted November 10, 2007 one note is on the second line I would add a round(.5*getFrameCount()); as you don't want a fractional frame otherwise that is what you will need to mimic via the binaries if you can't get the ffmpeg installed Quote Link to comment Share on other sites More sharing options...
tbare Posted November 10, 2007 Author Share Posted November 10, 2007 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...) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.