Hello all,
i scanned the whole web (including this site of course) to answer tis question myself but finally failed:
I need a tool to batch-convert MPGs to animated GIFs. Only thing, which Needs to be done in addition to the conversion is, to delete the first of 24 Frames.
Unfortunately the software, which outputs the MPGs (vibration-loops of a CAE-Simulation) always puts an annoying extra frame in first position, which makes the loops bump.
As i have to convert a lot of these MPGs every week, it would be really nice to get it done by script or batch. I found several solutions to do it manually file by file, like VitualDub, but none of them really batchable.
I was hoping, that maybe VirtualSynth could be the one, but didnīt find a way to export GIF.
Would be very great, if anyone of you had a good hint, how it yould be done.
Thx in advance, Markus
+ Reply to Thread
Results 1 to 8 of 8
-
-
virtualsynth??
Have you googled for ffmpeg examples?
http://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-wit...onable-quality
And try use -ss to seek 1 second. https://trac.ffmpeg.org/wiki/Seeking
After you get a working ffmpeg command can you make a batch file for that. -
In ffmpeg, you can also use -vf_trim=start_frame=24 . Frame numbering starts at "zero" in most applications, so the 1st frame will actually be the 25th frame. It's more consistent than -ss, because the frame will be exact. If you use -ss, the start frame might be different depending on the frame rate of the source video.
So it might look something like this as a batch file
Code:for %%a in ("*.mpg") do ffmpeg -i "%%a" -vf_trim=start_frame=24 -an "output\%%~na.gif" pause
-mpg2 is almost never square pixel (normally you would resize to the proper square pixel format with correct aspect ratio),
-"gif" has many options and considerations for optimization. Frame rates are important. If source framerate is 29.97, it will be a problem with many browsers. Usually you should use 15 or less. Dithering algorithms are important as well for quality and filesize -
How to generate animated GIF with optimized palette with ffmpeg:
https://forum.videohelp.com/threads/377995-What-s-wrong-with-Solveig-Video-Splitter-s-G...=1#post2440729
The -ss option is used to trim the start off a video. Here's a batch file that builds an optimized palette from the entire video and then produces an animated GIF from the video after removing the first second:
Code:"C:\Program Files\ffmpeg\bin\ffmpeg" -i %1 -vf palettegen %1.palette.png "C:\Program Files\ffmpeg\bin\ffmpeg" -i %1 -i %1.palette.png -lavfi paletteuse -ss 00:00:01.000 %1.gif del %1.palette.png
You could easily modify this to operate on all video files in a folder. -
I guess loopo doesn't want ffmpeg solutions....
ffmpeg batch guide: https://forum.videohelp.com/threads/356314-How-to-batch-convert-multiplex-any-files-with-ffmpeg -
-
You can operate on all AVI files in a folder using a second batch file:
Code:for %%a in ("*.avi") do GifTrim "%%a"
Similar Threads
-
How do I compensate for a colour shift in an animated gif?
By Bruce Wayne in forum Video ConversionReplies: 16Last Post: 14th Apr 2016, 08:28 -
Animated Gif -> Webm tool
By lab in forum Video ConversionReplies: 5Last Post: 8th Jun 2015, 19:27 -
Help to convert an Animated GIF to AVI
By lilpotato in forum Video ConversionReplies: 17Last Post: 14th May 2013, 00:32 -
Animated Gif Maker
By budwzr in forum EditingReplies: 12Last Post: 10th Jan 2012, 11:09 -
Animated .GIF super-compression
By JJones in forum Newbie / General discussionsReplies: 5Last Post: 13th Aug 2011, 16:08