Skip to content

Instantly share code, notes, and snippets.

@catprisbrey
Created January 16, 2025 15:06
Show Gist options
  • Save catprisbrey/e34489a3499038c775b53ad0ed963926 to your computer and use it in GitHub Desktop.
Save catprisbrey/e34489a3499038c775b53ad0ed963926 to your computer and use it in GitHub Desktop.
FFMPEG convert and scale videos or GIFs to MP4
## Simple script i use to convert larger files or GIFs to smaller MP4s for using in BlueSky or Discord.
## Change the 'SOURCE' to whatever path to your file. And change 'EXPORT.mp4' to whatever you want the final file to be.
## The 'trunc(iw/2)' gives you control of scale. '/2' is half size, '/4' is quater size, etc.
ffmpeg -i SOURCE -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" EXPORT.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment