I have a web application that converts any video into an animated GIF. The app runs in PHP and the following steps are executed through php's shell_exec:
- Scale video to smaller dimensions, if they are large (ffmpeg -i $in -s 200x150 -an $out)
- Use ffmpeg to extract 1 jpeg every x seconds (ffmpeg -i $in -ss $ss -vframes 1 $out)
Convert jpegs to animated GIF using imagick (convert -delay $delay -loop 0 $dir/* $out)
aside - the reason I don't use the ffmpeg gif89a output is because the quality sucks.
I want to be able to except any major image format, but the most common will probably be .flv (flash) and .avi/.mpg.
My application runs fine, but I am a perfectionist and it needs to be faster for scalability.
My web server has 16 cores and I would like to utilize them as much as possible, but .flv multi-threading appears to not be supported by ffmpeg, while .avi and some others are supported. Also, ffmpeg doesn't support multi-threading when outputting to jpegs.
Does anyone know of any other programs that support multi-threading for .flv and others? Are there any more efficient methods to create an animated GIF from video, while maintaining relatively decent quality (aka not the 100-color palette that ffmpeg supports)?
Also, if anyone knows which codecs might perform best for stages 1 and 2, particularly with flv, I'd love to know. I've done hours of testing, but there are just so many options I haven't come to any solid conclusions.
***Update: My online app is working well so far animated gif generator. I would still love to make it faster though, so if anyone has run into similar circumstances... let me know!