About this project

This repository is an educational tutorial for learning how to use FFmpeg as a library (libav) to build multimedia programs. It was created as a modern replacement for deprecated tutorials and is available in multiple languages. The content begins with an introduction to media fundamentals, explaining what video, audio, codecs, and containers are. It then provides a crash course on using the FFmpeg command-line tool, covering common video operations such as transcoding (converting codecs), transmuxing (changing containers), transrating (changing bitrates), transsizing (changing resolution), and adaptive streaming using DASH. The core of the repository is the "Learn FFmpeg libav the Hard Way" section, which provides code walkthroughs in C. It covers: - Chapter 0: A "hello world" program that reads a media file, extracts metadata, decodes frames, and saves them as gray images. It explains the FFmpeg libav architecture, including components like AVFormatContext, AVStream, AVPacket, AVCodec, and AVFrame. - Chapter 1: An explanation of audio and video synchronization, detailing presentation timestamps (PTS), timebases, and how video players pace frame rendering. - Chapter 2: Remuxing code. - Chapter 3: Transcoding code. The tutorial uses Docker as its development and runner environment to avoid compilation issues and includes a Makefile for fetching test videos and running examples. While the code is written in C, the author notes that the concepts are easily applicable to other languages with FFmpeg bindings, such as Python and Go.