Skip to content

Media — ffmpeg, GIFs, client demos ​

Everyday CLI beats online converters for NDAs.

Install ​

powershell
# winget
winget install Gyan.FFmpeg

# or choco
choco install ffmpeg

ffmpeg -version

Convert MP4 → GIF ​

bash
ffmpeg -i input.mp4 video.gif

Higher quality palette approach:

bash
ffmpeg -i input.mp4 -vf "fps=12,scale=640:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" output.gif

Cut by time ​

bash
ffmpeg -i input.mp4 -ss 00:05:10 -to 00:15:30 -c:v copy -c:a copy output.mp4

Drop last N minutes ​

bash
ffmpeg -sseof -00:10:00 -i input.mp4 -c copy output.mp4

Compress for Slack / email ​

bash
ffmpeg -i input.mp4 -vcodec libx264 -crf 28 -preset fast -acodec aac -b:a 128k small.mp4

Extract audio ​

bash
ffmpeg -i input.mp4 -vn -acodec copy audio.m4a
ffmpeg -i input.mp4 -vn -acodec libmp3lame -q:a 2 audio.mp3

Screenshot from video ​

bash
ffmpeg -ss 00:01:23 -i input.mp4 -frames:v 1 shot.png

PowerShell batch: all mp4 → gif in folder ​

powershell
Get-ChildItem *.mp4 | ForEach-Object {
  ffmpeg -y -i $_.FullName "$($_.BaseName).gif"
}

See also older notes: PowerShell ffmpeg