Skip to content

Instantly share code, notes, and snippets.

@krashanoff
Created May 28, 2024 23:15
Show Gist options
  • Save krashanoff/28049f0b6e3dc57b523b6e411c335494 to your computer and use it in GitHub Desktop.
Save krashanoff/28049f0b6e3dc57b523b6e411c335494 to your computer and use it in GitHub Desktop.

Handy FFMPEG Things

I'll try to update this.

Compressing a MOV

MOV captures from your Mac are really large, usually. This makes it into a nice GIF with a timecode in the corner.

ffmpeg -i capture.mov \
  -filter_complex "drawtext=fontsize=15:fontfile=/Library/Fonts/Fira\ Code\ Medium\ Nerd\ Font\ Complete\ Mono.ttf:timecode='00\:00\:00\:00':rate=25:fontsize=72:fontcolor='white':boxcolor=0x000000AA:box=1:x=main_w-text_w:y=main_h-text_h,\
    fps=45,\
    scale=1200:-1:flags=lanczos,\
    split[s0][s1];[s0]palettegen=max_colors=255[p];[s1][p]paletteuse=dither=bayer" \
    output.gif

Filesize is usually half, and looks fine. VP9 would be better, but /shrug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment