Skip to content

Instantly share code, notes, and snippets.

@mtking2
Last active November 17, 2017 19:01
Show Gist options
  • Select an option

  • Save mtking2/25dfa4f3cf12dfd532c2c0288a76233b to your computer and use it in GitHub Desktop.

Select an option

Save mtking2/25dfa4f3cf12dfd532c2c0288a76233b to your computer and use it in GitHub Desktop.

Revisions

  1. Michael revised this gist Nov 17, 2017. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions gifenc
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,8 @@
    #!/bin/sh

    # convert input.mov to 720px wide gif at 30fps
    # ./gifenc input.mov output.gif 720 30

    palette="/tmp/palette.png"

    filters="fps=$4,scale=$3:-1:flags=lanczos"
  2. Michael created this gist Jul 10, 2017.
    8 changes: 8 additions & 0 deletions gifenc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    #!/bin/sh

    palette="/tmp/palette.png"

    filters="fps=$4,scale=$3:-1:flags=lanczos"

    ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
    ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2