View Single Post
Old Oct 7th, 2006, 3:16 PM   #6
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,076
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
That isn't at all what the original poster wants. Jesus. XD

He wants a PHP function that can automatically convert a frame from inside a video in to a still image, inside the PHP script itself. It would be useful, if for example, a user submitted a video.

Then a thumbnail could be automatically generated by the same PHP script that recieved the upload from the user, and saved to the server. In the same manner Google Videos and You Tube does it...

That is what you want right? If I understand correctly? I'm not sure how you would do this in PHP. You should search the manual: http://php.net/ You might need to enable some external library for PHP...

Edit : I think the way YouTube does it, is after having the video uploaded, there is an executable programmed in some language (doesn't matter what), that's basically a server-side robot. This robot walks the storage locations for the videos and creates images for each video it finds.

In order to do this, you would have to have complete control of the server, in order to run a server-side executable. This is my educated guess, based on the premise of how I've noticed the thumbnail for a video takes a random time to get generated after it has been uploaded.

The reason for this robot would be because PHP doesn't have the capabilities to do this automatically. But other languages, C++ for instance, probably have support for it.

If you don't feel like programming a "robot", persay, you could program a single tasked executable, and see if you can call it from a PHP "startfile" function, if such exists. I hope this helps... and good luck!

Last edited by Sane; Oct 7th, 2006 at 3:30 PM.
Sane is offline   Reply With Quote