The frame extractor class implements the Iterator interface, so we can specify which frames we want, and then loop through the object to get them. I created two classes: one to extract some video frames, and one to join them back into an animated GIF. FFmpeg supports most of the existing video formats, has a command line interface, and is available under the LGPL license. To create the video preview, we need PHP >= 5.1 with the Imagick extension and FFmpeg. It makes a rather unconventional use of the SPL Iterators, proving how flexible they are. I recently stumbled upon the code I wrote and thought it was probably worth sharing. Abstract: Extract frames from a movie and create a preview as animated GIF, using PHP, SPL, Imagick and FFmpeg.Ībout one year ago, I had to create animated GIFs as a preview of a video for a media portal.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |