FFMPEG is one of the most powerful and widely-used tools in the world for working with audio and video. It powers the encoding behind YouTube, Netflix, Spotify, and countless other services. It can convert between formats, extract audio, chop clips, generate thumbnails, create GIFs, add watermarks, and much more — all from the command line.
In this exercise, you’ll pair FFMPEG with yt-dlp, a tool for downloading video from YouTube and other sites. Together they’re a toolkit for downloading, inspecting, and manipulating video — and OpenCode makes the whole process conversational.
Install the tools
Both tools are available through Homebrew on macOS:
brew install ffmpeg yt-dlp
On Linux, use your system package manager or Homebrew. On Windows, download FFMPEG from ffmpeg.org and yt-dlp from GitHub.
Find a video
You’ll start by finding a Creative Commons-licensed video on YouTube — these are videos the creator has explicitly marked as free to reuse.
To find one: search YouTube for a topic that interests you, click Filters, then under Features select Creative Commons. Pick something short (under 5 minutes) with visuals you find interesting — nature footage, city timelapses, and music videos tend to work well.
What you’ll do
Once you have a video, you’ll use FFMPEG to take it apart and put it back together:
- Download the video from YouTube using yt-dlp
- Inspect the video’s metadata — resolution, duration, codecs, frame rate
- Extract frames — pull out one image per second
- Extract audio — rip the audio track to a separate file
- Cut a clip — extract a specific segment by start time and duration
After the basics, you’ll have a chance to get creative — making GIFs, adding watermarks, speeding up footage, or anything else that sounds fun.