

Which works for creating a scaled animated gif with a fixed width of 150px at a rate of 1 frame per second but its only an animation of the first 10 seconds of the video. The code I'm working with now isįfmpeg -i test.mp4 -vf scale=150:-1 -t 10 -r 1 test.gif

The problem now is I want to show the user a short scaled preview (animated gif) of the video before they click to play it. Because that's a lot of parameters, I added some really basic help to remind myself of the format just run the script with no parameters (or any number other than six), and the help will pop up.A brief overview of what I'm trying to accomplish I have a site that will accept video uploads, uploads get converted into the mp4 format to be uniformed and playable on the web using one of the many available players. The parameters, in order, are for the frame rate, target pixel width, start time at which to capture (in minutes and seconds), duration to capture from that start time (in seconds), the input movie's filename, and the new animated GIF's filename. Using my modified script, I can make an animated GIF out of a bit of any movie with this command: So I took that script and modified it so I could pass all the major settings on the command line. However, there are a number of settings that I wanted to tweak but are hardcoded in the script. There's a simple script on the blog post that takes just two parameters-the input and output filenames-and generates a nice animated GIF. Thanks to that linked blog post, it turns out to be incredibly easy to turn bits of any video into very high quality animated GIFs.


So how did I create the animated GIF from the movie file? I know there are any number of great apps that will do this ( ScreenFlow, for one), but I had another thought: While working on the animated screenshot movie (which I created using ffmpeg), I had happened to read about ffmpeg's ability to create high quality animated GIFs, so I thought I'd give that a try. To create the demo movie on Time Sink's web page, I used a looping Keyboard Maestro macro, ffmpeg, and /iy67d0lPq9
