Skip to content

Instantly share code, notes, and snippets.

@bertrandom
Created March 1, 2016 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bertrandom/b840edd5b936cac82f30 to your computer and use it in GitHub Desktop.
Save bertrandom/b840edd5b936cac82f30 to your computer and use it in GitHub Desktop.
#!/bin/bash
start_time=$3
duration=$4
palette="/tmp/palette.png"
filters="fps=15,scale=320:-1:flags=lanczos"
ffmpeg -v warning -ss $start_time -t $duration -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -ss $start_time -t $duration -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment