FFmpeg Basics
Install FFmpeg, understand the command structure, and run three practical operations you'll use all the time.
Watch the video walkthrough, or follow the written guide below.
What is FFmpeg?
FFmpeg is a free, open-source command-line tool for processing video and audio files. Most of the video editing apps you have used are already built on top of it — YouTube, VLC, OBS, and HandBrake all rely on FFmpeg under the hood.
If you are marketing a product or service, you need video content. Video drives discovery and conversions on every platform right now. But here is the problem: creating custom videos for every platform is incredibly time-consuming. You record one landscape video and now you need to crop it to a square for Instagram, add your website URL as an overlay, maybe create a vertical version for TikTok. FFmpeg lets you automate all of that — convert formats, crop videos, add text overlays, and batch process hundreds of files with simple commands.
Installing FFmpeg
Choose your operating system and run the matching command:
macOS (Homebrew)
Ubuntu / Debian
Windows (Chocolatey)
Verify the installation:
Get a Test Video
Before we start, grab a short clip to experiment with. Big Buck Bunny is an open-source video that is perfect for testing:
Open it to confirm it works:
You should see a short landscape video. Now let's do three things with it.
Understanding the Command Structure
Every FFmpeg command follows the same pattern:
-ispecifies the input file- Flags before
-iapply to the input, flags after apply to the output -vfapplies video filters (crop, scale, text overlay, etc.)- The output filename comes last — FFmpeg infers the format from the extension
That is the whole framework. Every command you will write in this course follows this structure. Now let's use it.
Operation 1: Crop to a Square
Instagram, TikTok, and LinkedIn all love square videos. If you recorded a landscape video, you need to convert it. Here is the command:
What this does: it takes the input file, finds the smallest dimension (either width or height), and crops it to a perfect square, keeping everything centered. So if you have a 1920x1080 landscape video, it crops it down to 1080x1080 from the center — you don't lose the important parts.
Breaking down the filter:
-vfmeans "apply a video filter"crop=ih:ihmeans "crop to a box where width and height both equal the input height"- When you omit the X and Y position, FFmpeg centers the crop automatically
Operation 2: Add a Text Overlay
Maybe it's your website URL, a call to action, or just branding. Here is how you overlay text on a video with a semi-transparent background so it's readable:
This centers the text with a semi-transparent black box behind it. You can adjust:
text=— the text to displayfontsize=— size in pixelsfontcolor=— text colorboxcolor=black@0.5— background color at 50% opacityx=andy=— position (the formula above centers it)
To pin the text to the bottom-right instead of center, change the position to:
Operation 3: Stitch Videos Together
Sometimes you want to loop a video or stitch multiple clips together. FFmpeg calls this concatenation. First, create a text file that lists the videos you want to combine:
Then tell FFmpeg to concatenate them:
The key here is -c copy — it doesn't re-encode the video, so it's almost instant regardless of file size. The output is the same clip played back to back. You can list as many files as you want in the text file to build longer compilations.
Inspecting Files with ffprobe
Before processing a video, it helps to know what you are working with. FFmpeg ships with ffprobe, a tool that reads file metadata without modifying anything:
For a cleaner view of just the key properties:
This tells you the resolution, codec, duration, and frame rate — exactly the context you need to choose the right flags.
Essential Flags Reference
| Flag | Purpose | Example |
|---|---|---|
-i | Input file | -i video.mov |
-vf | Video filter (crop, scale, text, etc.) | -vf "crop=ih:ih" |
-c:v | Video codec | -c:v libx264 |
-c:a | Audio codec | -c:a aac |
-c copy | Copy streams without re-encoding (fast) | -c copy |
-f concat | Concatenate files from a list | -f concat -i list.txt |
-y | Overwrite output without asking | -y output.mp4 |
-an / -vn | Remove audio / video stream | -an |
Where to Go From Here
These three operations — cropping, text overlays, and concatenation — are the building blocks. Once you understand them, you can script entire video workflows to create weeks of content in minutes. You can also use AI tools like ChatGPT to generate more complex FFmpeg commands — just describe what you want in plain language and it will produce the command.
In the next lesson, we will dive deeper into transcoding — converting between formats, codecs, and quality levels.
Key Takeaways
- FFmpeg uses a consistent pattern:
ffmpeg [options] -i input [options] output - Use
-vf "crop=ih:ih"to crop a landscape video to a centered square - Use
drawtextto overlay text with customizable position, size, and background - Use
-f concat -c copyto stitch videos together instantly without re-encoding - Use
ffprobeto inspect video properties before processing
Try This With FFmpeg Micro
Instead of running FFmpeg locally, you can use FFmpeg Micro's API to process videos in the cloud. No installation required.