explaingit

leandromoreira/ffmpeg-libav-tutorial

10,967CAudience · developerComplexity · 3/5Setup · moderate

TLDR

Hands-on C tutorial that teaches you to use FFmpeg as a programming library rather than a command-line tool, covering video decoding, audio syncing, remuxing, and transcoding from first principles.

Mindmap

mindmap
  root((ffmpeg-libav-tutorial))
    What it covers
      Video fundamentals
      Audio fundamentals
      Codec concepts
      Container formats
    Programming chapters
      Reading media files
      Decoding frames
      Remuxing
      Transcoding
    Tech stack
      C language
      FFmpeg
      libav libraries
    Audience
      Programmers
      Media developers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Write a C program that opens a video file and extracts individual frames for processing, without shelling out to FFmpeg on the command line.

USE CASE 2

Build a transcoder in C that converts video between codecs by calling the FFmpeg libav libraries directly.

USE CASE 3

Understand how video containers, codecs, and audio-video sync work at the code level before building a media processing pipeline.

Tech stack

CFFmpeglibav

Getting it running

Difficulty · moderate Time to first run · 1h+

Requires C development tools and the FFmpeg development libraries installed, the tutorial provides example code to compile and run.

License not specified in the explanation.

In plain English

This is a written tutorial that teaches you how to use FFmpeg as a programming library rather than as a command-line tool. FFmpeg is a widely used open source program for working with video and audio: converting formats, extracting frames, adjusting quality, and streaming. Most people interact with it through terminal commands, but FFmpeg also exposes a set of C libraries (collectively called libav) that programmers can call directly from their own code. The tutorial starts from first principles, explaining what video actually is (a sequence of images displayed fast enough to create the illusion of motion), what audio is at the signal level, what a codec does (compresses raw data so files are not enormous), and what a container is (a file format like MP4 or WebM that bundles video and audio streams together). It then walks through common FFmpeg command-line operations before moving into C code. The programming chapters cover reading media files, decoding frames, syncing audio and video timing, remuxing (changing a file's container without re-encoding the content), and transcoding (converting between codecs). Each chapter builds on the last with working code examples and explanations of the internal structures FFmpeg uses. The tutorial is written in C, but the author notes that the concepts apply to any language that has FFmpeg bindings, and many do. Translations of the tutorial are available in Simplified Chinese, Korean, Spanish, Vietnamese, Portuguese, and Russian. The intended audience is programmers who already have some coding experience and want to understand how media processing works at the library level, not just the command-line level. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Using the ffmpeg-libav-tutorial as a guide, write me a C program that opens an MP4 file and prints the duration, codec, and resolution.
Prompt 2
Walk me through the ffmpeg-libav-tutorial chapter on remuxing, I want to change an MKV container to MP4 without re-encoding in C.
Prompt 3
Help me adapt the ffmpeg-libav-tutorial decode example to extract all keyframes from a video and save them as PNG files.
Prompt 4
Explain how the ffmpeg-libav-tutorial handles audio and video sync, I'm seeing A/V drift in my own libav code.
Open on GitHub → Explain another repo

← leandromoreira on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.