Skip to content

Instantly share code, notes, and snippets.

@prathyvsh
Created June 3, 2025 01:27
Show Gist options
  • Save prathyvsh/2dbbf25e8aed29bfd8633b27d31725b9 to your computer and use it in GitHub Desktop.
Save prathyvsh/2dbbf25e8aed29bfd8633b27d31725b9 to your computer and use it in GitHub Desktop.
Snippet for generating timestamped, optimized videos from After Effects.
# Snippet for generating timestamped, optimized videos from After Effects.
# Requires ffmpeg for conversion.
# Alias for aerender
alias aerender="/change/to/path/to/aerender/inside/AfterEffects/folder"
# Use this minimally as:
# in=inputfile.extension out=outputfilename render
# There is no need to mention the extension of the output as it uses .mp4 by default
# It can be parametrized further with the following flags:
# in=inputfile.extension out=outputfilename comp="Comp 1" start=0 time=360 render
render() {
echo "Started at $(date)"
if [[ $start == "" ]]; then start=0; fi
if [[ $time == "" ]]; then time=240; fi
if [[ $comp == "" ]]; then comp="Comp 1"; fi
if [[ $in == "" ]]; then { echo "Input not found"; return; } fi
if [[ $out == "" ]]; then { echo "Output not found"; return; } fi
if [[ $src == "" ]]; then { echo "Using current working directory"; src=`pwd`; } fi
echo "Input: $in"
echo "Output: $out"
echo "Source: $src"
aerender -project $src/$in -comp "$comp" -output $src/$out.mp4 -s $start -e $time && ffmpeg -i $src/$out.mp4 $src/$out-$(date +%H-%M-%S-%d-%m-%y).mp4;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment