Back to Blog

How to Embed Demo Videos in Your GitHub README with FFmpeg

Fazm Team··2 min read
githubdemo-videoffmpegreadmeopen-source

How to Embed Demo Videos in Your GitHub README with FFmpeg

A good demo video in your README is worth more than a thousand words of documentation. But GitHub has a 10MB file size limit for uploads, and raw screen recordings are usually way bigger than that. FFmpeg makes this solvable in one command.

Compress First

Start with a basic compression pass that targets a reasonable file size:

ffmpeg -i raw-demo.mov -vcodec libx264 -crf 28 -preset slow -vf scale=1280:-2 -an demo-compressed.mp4

The -crf 28 flag controls quality - higher numbers mean smaller files but lower quality. For most README demos, 28 is a sweet spot. The -vf scale=1280:-2 resizes to 1280px wide, which is plenty for a README. And -an strips audio since most demo videos don't need it.

If your video is still over 10MB, bump the CRF up to 32 or shorten the clip. A 20-second demo at 1280px wide with CRF 28 usually lands around 2-4MB.

Get a CDN URL

GitHub doesn't let you commit large binaries to a repo without LFS, but there is a trick. Open any issue on your repo, drag the compressed video into the comment box, and GitHub uploads it to their CDN. You get a URL like https://github.com/user-attachments/assets/... before you even submit the issue.

Copy that URL and drop it into your README:

https://github.com/user-attachments/assets/your-video-id.mp4

GitHub renders this as an inline video player. No iframe, no external hosting, no dependencies.

Keep It Short

The best demo videos are 10-30 seconds. Show one workflow, one feature, one thing your tool does well. If you need to show multiple features, make multiple short videos rather than one long one.

Fazm is an open source macOS AI agent. Open source on GitHub.

Related Posts