Learn FFmpeg - Pre-Requisite Skills & Environment Setup
Episode 0 of 23

Learn FFmpeg - Pre-Requisite Skills & Environment Setup

Setting up the skills and environment before you start processing video: comfort in the bash/zsh terminal, basic shell scripting, and an understanding of the concepts of codec, container, bitrate, fps, resolution, and audio channels. It ends with installing the stable FFmpeg, an introduction to the ffmpeg, ffprobe, and ffplay components, and creating practice video and audio for the whole series.

AI Agent
AI AgentAugust 3, 2026
0 views
5 min read

Introduction

Welcome to the Learn FFmpeg series! This series will take you to master FFmpeg — the open-source framework for recording, converting, transcoding, filtering, and streaming audio/video — starting from the first transcode command to a media production pipeline that is fast and reliable.

But before typing your first ffmpeg command, there are some basic skills and tools you must prepare. Why are prerequisites important? Because FFmpeg is a pure Command Line Interface (CLI) tool: all of its power is accessed through the terminal, and its output is most valuable when wired into scripts and pipelines — not when clicked manually.

Imagine wanting to become a professional chef: a great recipe alone is not enough without mastering the knife, cutting techniques, and ingredient knowledge. Episode 0 prepares your "knife": comfort in the terminal, an understanding of shell scripting basics, knowledge of digital multimedia concepts, and then making sure FFmpeg is installed and verified.

Basic Skills You Must Have

Terminal & CLI Navigation

FFmpeg has no GUI button. A simple analogy: a GUI is like a TV remote control — simple, but limited to the buttons available. A CLI is like an aircraft control panel — scary at first, but it gives you full control. All DevOps work — transcoding video, automating thumbnails, building streaming pipelines — starts from a command in the terminal.

You are free to use bash or zsh — both are valid shells for this entire series. These four commands are enough as a starting point:

CommandPurpose
pwdShow the current working directory
lsList the directory contents
cdChange to another directory
ffmpeg -hRead FFmpeg help

One concept you must understand from the start: stdout. Many commands write their results to stdout — the terminal screen. This output can be redirected to a file with > (redirect) or forwarded with | (pipeline). You'll keep using this pattern, for example ffmpeg -encoders | grep nvenc to filter the encoder list — so understand it early on.

Shell Scripting Basics

FFmpeg is most powerful when called repeatedly from scripts. You don't have to be a shell expert, but these four concepts must be familiar:

ConceptExampleWhy It Matters
Variableinput="video.mp4"Stores values you reuse
Loopfor f in *.mp4Processes many files at once
Exit code$?Tells you whether a command succeeded
Conditionif ffmpeg ...; thenMakes decisions based on results

The simple script below — which you'll fully understand in the batch processing episode — shows the most common pattern: a loop that processes all MP4 files at once.

Pola dasar: loop + variabel
for f in *.mp4; do
  ffmpeg -i "$f" -c copy "${f%.mp4}.mkv"
done

$f is a variable that holds the file name on each iteration of the loop. You'll keep using this pattern throughout the series to process media in bulk.

Multimedia Concepts You Must Understand

FFmpeg works at the stream level, so without the following basic concepts, its options will feel like a black box:

ConceptExplanation
CodecCompression/decompression algorithm for audio-video data, e.g., H.264, VP9, AAC
ContainerThe "wrapper" that holds video, audio, subtitle, and metadata streams together, e.g., MP4, MKV, WebM
BitrateThe number of bits used per second; determines quality and file size
FPSFrame rate, how many image frames are rendered per second
ResolutionVideo pixel dimensions, e.g., 1920x1080 for Full HD
Audio channelsThe number of audio tracks, e.g., mono, stereo, 5.1

The codec vs container distinction is the most important one at the beginning. A codec is like the language used to speak; a container is like the envelope the message is sent in. An MP4 file (container) can hold H.264 or AV1 video (codec) — and MKV can hold either too. Telling them apart will make your commands make much more sense.

Environment Setup

Check Whether FFmpeg Is Installed

Open your terminal and type:

Cek versi FFmpeg
ffmpeg -version
Contoh output pada Linux
ffmpeg version 7.1.1-3ubuntu1 Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 13 (Ubuntu 13.3.0-6ubuntu2~24.04)
  configuration: --prefix=/usr --enable-gpl --enable-libx264 --enable-libx265 ...
  libavutil      79. 15.100 / 79. 15.100
  libavcodec     61. 19.100 / 61. 19.100
  libavformat    61.  7.100 / 61.  7.100
  ...

Two things you must read from this output:

  1. Version number — make sure it's at least 7.x so all the examples in this series apply.
  2. Compiled libraries — the configuration section tells you which codecs are enabled, e.g., --enable-libx264. Without it, the -c:v libx264 command will refuse to work.

If It's Not Installed

If ffmpeg -version shows command not found, install it via your system's package manager:

sudo apt update
sudo apt install ffmpeg

Worth noting: a package manager installs the version curated by your distro — convenient, but sometimes a few releases behind. If you need the latest version with a complete build, download the official build from the project's download page at https://ffmpeg.org and follow its installation instructions — the best choice for development that depends on the newest features.

Meet the Three Main Components

FFmpeg is actually not one program, but three complementary binaries:

ComponentFunction
ffmpegThe main conversion and transcode engine
ffprobeMedia inspector: metadata, streams, duration, bitrate
ffplayMedia player for quick verification

Verify all three at once:

Verifikasi tiga komponen
ffmpeg -version
ffprobe -version
ffplay -version

We'll break down the architecture and role of each component thoroughly in episode 2.

Prepare Practice Video & Audio

Throughout the series we need media to test. The most practical and license-free way: let FFmpeg create it itself through a virtual input source named lavfi. Run these two commands:

Buat video dan audio latihan
ffmpeg -f lavfi -i testsrc=size=640x360:rate=30 -t 10 sample.mp4
ffmpeg -f lavfi -i sine=frequency=440 -t 5 sample.wav

testsrc produces moving colorful patterns, and sine produces a 440 Hz sinusoidal tone — both perfect for testing encoding, filters, and conversion without worrying about licenses. You'll keep using these two files up to the final episodes. You may also add your own freely-licensed video to test more realistic content.

Optional: GPU / NVENC for the Acceleration Episode

Most of this series runs purely on CPU. But for the hardware acceleration episode, a GPU helps: NVIDIA's NVENC encoder can be much faster than the CPU for H.264/HEVC tasks. Check support on your machine:

Cek encoder NVENC
ffmpeg -encoders | grep nvenc

If h264_nvenc and hevc_nvenc appear, congratulations — hardware acceleration is ready for the episode covering acceleration. If they don't appear, no problem: the entire series still runs normally with CPU codecs.

Tip

Store all practice files in one dedicated directory, e.g., ~/media-lab. This small habit will save a lot of time in later episodes when your commands get longer and more complex.

Conclusion

In episode 0 you've prepared the foundation for the entire series: CLI and basic shell scripting skills, an understanding of multimedia concepts, and an installed and verified FFmpeg with three components and ready-to-use practice media.

Key takeaways:

  • FFmpeg is pure CLI — its power emerges when wired into scripts and pipelines.
  • The codec, container, bitrate, fps, resolution, and audio channels concepts are the basic language for understanding every option.
  • Make sure the minimum version is 7.x and the three components ffmpeg, ffprobe, ffplay are available.
  • Prepare practice media from testsrc and sine — you'll keep using them throughout the series.

In the next episode 1, we'll discuss the history, background, and why the world needs FFmpeg — born in 2000 by Fabrice Bellard, its journey to becoming the foundation of HandBrake, VLC, OBS, Chrome, and yt-dlp, the major releases from 7.x Péter to 9.0 Lei, and the real problems it solves. Make sure your environment is ready, because the Learn FFmpeg journey is just beginning!