racerx Posted February 7, 2015 Share Posted February 7, 2015 (edited) In case anyone wants to know how to encode an animated GIF with ffmpeg, here is a quick explanation... First of all ffmpeg is a very good and powerful encoder, I use it quite a bit with various programs or in Batch Processing via a batch file. I'm just going to explain the batch file process for now. Download ffmpeg in either 32-bit or 64-bit versions and put the ffmpeg.exe somewhere on your HDD. You can create a folder called ffmpeg in you C:\ drive if you'd like. Open Notepad and paste the following script and save as animated_GIF.bat: SET PATH="C:\FFMpeg" for %%a in ("*.avi") do ffmpeg -i "%%a" -vf scale=320:-1:sws_dither=a_dither -r 10 -ss 00:00:04 -t 00:00:08 -pix_fmt rgb8 -loop 0 -an "%%~na.gif" pause The 1st line is the path to the folder where ffmpeg.exe is located. Edit as needed. ("*.avi") means it will process all avi's in a folder. You can change it to ("*.mp4") for example to process mp4's. -vf scale=320:-1 means it will resize the width to 320, the height will auto resize to keep aspect ratio intact. -r 10 means 10 fps. -ss 00:00:04 means it starts encoding at the 4 second point. -t 00:00:08 means it will encode a total of 8 seconds of footage. You can also create an animated apng file in Paint.net, the use ffmpeg to encode the apng file into an animated GIF. Just omit the -r, -ss and -t commands. Then just drag you file into the animated_GIF.bat file and all files with the associated extension in the folder will be processed. Here is a quick example where I encoded a 12 year-old camcorder clip resized to 320 x 213. Edited February 7, 2015 by racerx Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted February 7, 2015 Share Posted February 7, 2015 That's all fine and dandy, but why not use ffmpeg to make a VP9 video instead? Much higher quality at a much smaller file size. Also plays natively in web browsers . Quote June 7th, 2023: Sorry about any broken images in my posts. The underlying DNS issue should be resolved soon. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted February 7, 2015 Share Posted February 7, 2015 What's this to do with paint.net? Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
racerx Posted February 7, 2015 Author Share Posted February 7, 2015 What's this to do with paint.net? The point is that you can make an animated GIF with Paint.NET using Simon Brown's plugin, but the quality is poor and file size is high. You can make an animated apng file using the same method, then drag the animated.apng file into an ffmpeg batch file to make a decent quality animated GIF at a low file size. Sure you can make a VP9.webm file also, but support for that is very low. You have little options other than youtube upload. There is also an option for animated.webp, but again low support. Anyway, if you think this is irrelevant, you can go ahead and delete it. Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted February 7, 2015 Share Posted February 7, 2015 I'm not going to delete this thread. I just didn't see the connection. Your explanation is an excellent justification for this thread. Thanks. Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Pixey Posted February 7, 2015 Share Posted February 7, 2015 Thanks so much @Racerx - I've always been facinated with animation, but have found the subject difficult. I will be trying your suggestions - look out........ I may post something soon (if I'm not too old to figure this out) Quote How I made Jennifer & Halle in Paint.net My Gallery | My Deviant Art "Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon. Link to comment Share on other sites More sharing options...
Scooter Posted February 7, 2015 Share Posted February 7, 2015 Thanks so much @Racerx - I've always been facinated with animation, but have found the subject difficult. I will be trying your suggestions - look out........ I may post something soon (if I'm not too old to figure this out) Racerx thanks from me to. looks workable for me ( -I slow some times) An Pixey ; Pixeys don't get old, they just get cleverer and cleverer and clev......well you get the idea Quote Scooter Age is only a number --in my case a Really BIG number, but there you have it When the prefect paint.net image is created, I will still be wondering "How they Do that?"- sigh☺️ 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.