Export directly to GIFs?
Is there an easy way to export directly to GIFs using Templater without leaving AE?
- Im trying to avoid sending to AME as I am going to be creating tens of thousands of short animations and that would greatly complicate and slow down the workflow.
- Ive installed both GIFGun and AE Juice Export GIF, but neither actually install the ability to export GIFs from the Render Queue, they only do it through their own panel, so therefore Templater can’t use their functionality.
Am I missing an easy workflow? Thoughts?
@jasontcox Yes this is possible, but you would need to use Templater’s event scripts. The script would do the transcoding with ffmpeg. Some development work would need to be done to create this post-process transcode script that Templater could call each time it finished an output.
On our github account, we have an open source example of this. Check out the following:
If you have
ffmpeginstalled onto the machine you can register your transcode script in the “After Job” event in Templater preferences and it will run each time it finishes rendering. See documentation about Event Scripts.
Via the standard support channels, Dataclay can help you integrate our open source transcode example into your system. Shoot an email to email@example.com for any questions related to services that Dataclay can provide you.
@jasontcox we’ve also used something called gifsicle, which is a command line tool for optimizing gifs (homepage). What you do in this case, you render a version from AE’s render queue, then you do a post-render action to transcode to gif with
ffmpegand then compress with
gifsicle. These event scripts require Templater Bot. You’ll need to add
ffmpegto your SYSTEM PATH.
Here’s an example of a script (Windows BAT file) that I’ve used. Feel free to use it as a baseline to remix for your own purposes. (No warranties implied)
@ECHO ON SET RENDER="%~1" SET RPATH=%~dp1 SET ID=%~n1 SET FRAMERATE="15" SET SCALE="0" SET COLORS="256" SET PALETTE="%RPATH%palette.png" SET FILTERS=fps=%FRAMERATE%,scale=%SCALE%:-1:flags=lanczos SET GIFOUT="%RPATH%gifs\%ID%.gif" SET GIFCOMP="%RPATH%gifs-lossy\%ID%.gif" SET FULLRES="%RPATH%full-res" SET GIFFINAL="N:\email-campaigns\newsletter" ffmpeg -v warning -i %RENDER% -vf %FILTERS%,palettegen=stats_mode=diff:max_colors=%COLORS% -y %PALETTE% ffmpeg -i %RENDER% -i %PALETTE% -loop 0 -lavfi "%FILTERS% [x]; [x][1:v] paletteuse=dither=bayer:bayer_scale=3" -vcodec gif -y %GIFOUT% gifsicle %GIFOUT% -O3 --lossy=200 --output %GIFCOMP% move /Y %RENDER% %FULLRES% copy /Y %GIFCOMP% %GIFFINAL%