Skip to content

Instantly share code, notes, and snippets.

@Circl3s
Created January 28, 2023 23:46
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 Circl3s/0d19c7f6e3ec08ca3be12e869a237985 to your computer and use it in GitHub Desktop.
Save Circl3s/0d19c7f6e3ec08ca3be12e869a237985 to your computer and use it in GitHub Desktop.
Powershell script for converting videos to gifs using ffmpeg :)
param(
[Parameter(Mandatory=$True)]
[String]$In,
[String]$Out,
[String]$Scale = "-1:-1"
)
if ($Out.Length -eq 0) {
$Out = (Get-Item $In).BaseName + ".gif"
}
ffmpeg.exe -i $In -filter_complex "[0:v] scale=$Scale [s]; [s] split [a][b]; [a] palettegen [p]; [b][p] paletteuse" $Out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment