Quick Start Guide to FFmpeg
A FULL-COLOUR book from Apress/SpringerNature
- Need to process audio/video files without spending much on software?
- Need a quick tutorial or desk-side reference for FFmpeg?
FFmpeg is THE BEST software to easily create, edit, enhance and convert audio and video files. It is a free and open-source command-utility available for Linux, Mac and Windows.
Quick Start Guide to FFmpeg is THE BEST book for an extensive FFmpeg tutorial, hack collection and quick reference. It is richly illustrated with color screenshots, code examples and tables to help you work with audio, video, images, animations, fonts, subtitles and metadata like a PRO.
This book begins with a simple introduction to FFmpeg executables — ffmpeg, ffprobe and ffplay, and explains how you can use them to process multimedia containers, streams, audio channels, maps and metadata. It then describes how you can easily edit, enhance and convert audio, video, image and text files. There are dedicated chapters for filters, audio, subtitles and metadata, as well as a big collection of FFmpeg tips and tricks. Sample lists of FFmpeg filters, encoders, decoders, formats and codecs are also available as appendices. The book is richly illustrated with screenshots and syntax-highlighted code snippets, all in FULL COLOUR. It is based on the latest Long Term Support (LTS) version of FFmpeg.
Quick Start Guide to FFmpeg is for anyone who needs to edit or process multimedia files including studio professionals, broadcast personnel, video content creators (such as Youtubers), podcasters, librarians, archivists and webmasters. It will be indispensable for those wanting to process a variety of multimedia files from the command line and inside shell scripts.
| Format | Store | Order | Get the FULL-COLOUR paperback |
|---|---|---|---|
| Colour paperback | Amazon (USA) | 44.99 | ![]() |
| Colour paperback | Barnes & Noble (USA) | $44.99 | |
| Colour paperback | Springer-Nature (with free worldwide shipping) |
$44.99 | |
| PDF ebook | Springer-Nature (worldwide) | $29.99 | |
| Colour paperback | Bookswagon (India) | ₹2500 | |
| Universal link for all stores | |||
| https://books2read.com/ffmpeg | |||
This book will help you learn to:
- Convert from one format to another video-to-video, video-to-audio, video-to-image, image-to-video, video-to-animation, animation-to-video, text-to-audio, text-to-video
- Edit video files by cutting them with and without re-encoding, appending (joining clips together), resizing, changing frame rate and aspect ratio, mixing in audio
- Use filters to rotate, flip, crop, overlay (side-by-side or inset), remove logos, blur, smooth and sharpen, apply transitions as well as speed up or down playback
- Edit audio files by changing, normalizing or compressing volume, mixing and splitting channels and detecting silence. Also, learn to generate waveforms as video or image
- Add subtitles, place them anywhere on the screen, use custom fonts and colors, and use different languages
- Set metadata such as MP3 tags for and album art, set global and stream-specific metadata. And, learn how to import, export and remove metadata
- Automate your FFmpeg tasks
List of Contents
- Introduction
- Extra resources for the book
- Chapter 1: Installing FFmpeg
- Chapter 2: Starting with FFmpeg
- Chapter 3: Formats and codecs
- Chapter 4: Media containers and FFmpeg numbering
- Chapter 5: Format conversion
- Chapter 6: Editing videos
- Chapter 7: Using FFmpeg filters
- Chapter 8: All about audio
- Chapter 9: All about subtitles
- Chapter 10: All about metadata
- Chapter 11: FFmpeg tips and tricks
- Chapter 12: Annexures
- Annexure 1: Sample list of codecs
- Annexure 2: Sample list of decoders
- Annexure 3: Sample list of encoders
- Annexure 4: Sample list of filters
- Annexure 5: Sample list of formats
On the right, you can see real pages from the paperback published by Apress in 2023. (The animation is low-resolution to conserve file size.) Note the special formatting, syntax highlighting and usability aids that I got them to include. (You will not find that in other books.)
For a full-resolution sample, check this PDF containing the first few pages of the book from Springer.com.
Extra Resources — Additional pages and updated annexures
This book was originally self-published in 2020 as FFmpeg Quick Hacks. When I presented the book to Apress for republication under their imprint, they asked me to rewrite the book using my own videos or explicitly public-domain videos instead of leveraging fair-use doctrine on random videos grabbed from Youtube (included in the PDF linked below). I have also updated the book to FFmpeg v5.1 LTS (Long Term Support). It is good for FFmpeg v6 totally and FFmpeg v7 with the exception of loopback decoders.
Unlike other authors (who use Microsoft Word), I write my books in CommonMark (standarised MarkDown) and output them as PDF using a bash script — starting with the very first line. As I usually create my own covers, I made replica Apress covers for that PDF.
In the PDF download below, I have excerpted here a few sample pages out of both books. (The book published by Apress will have a different formatting. Read the release announcement.)
Also included are annexures (updated for FFmpeg v6) and my books backlist (with no watermarks of course). The annexures contain ffmpeg output for the options -codecs, -formats, -filters, -encoders and -decoders from Windows and Linux OSs.
Extra Resources — Source code
The list of commands used in the book is available in this text file:
QuickStartGuideToFFmpegByVSubhash-ER-CommandsList.md.txt
Extra Resources — Latest FFmpeg blog posts
- On my blog:
- Compositing videos, images and text using FFmpeg
- Your FFmpeg build compilation from source failed because of libvmaf?
- My FFmpeg book has been published by Apress/SpringerNature
- How to compile FFmpeg 6.0 in Linux and what new things can you do with it
- Fix for FFmpeg error ‘Frame rate very high for a muxer not efficiently supporting it. Please consider specifying a lower framerate, a different muxer or setting vsync/fps_mode to vfr’
- What's new in FFmpeg 6.1
- The anti-racism filter that every White Youtuber needs (satirical version)
- How to create a slideshow with FFmpeg
- How to play videos using FFplay
- How to add text, image, colour and timer overlays on videos using FFmpeg
- Problems in compiling FFmpeg 7.0 from source on old Linux systems
- How to create a collection of several video clips
- How to replace a colour in a video with another colour using FFmpeg
- How to build FFmpeg 7.0 from source and what you can do with its new features
- How to downmix 5.1-channel audio to stereo without low vocal volume
- How to render text on an animated GIF
- Using FFmpeg's ffplay as a beefed-up audio player
- Open-Cleavage-Free Internet
- FFmpeg 8 is in, CodeProject.com is out and Whisper.cpp is in and out
- How to convert Video CD or VCD DAT and CUE/BIN/ISO CD image files to MP4 format using FFmpeg
- How to rip DVDs using FFmpeg
- On CodeProject:
- How to Use FFmpeg Filters to Jazz Up Your Audio and Video Files
- FFmpeg Filters Every Youtuber Needs (non-satirical version)
Extra Resources — Chapter-wise video demos
These Rumble videos are also available on Youtube ↗
Note: Even though these videos are at 800x608, they are not displayed at that resolution here by default. In the beginning of each video, change the quality setting to the highest and click on the Fullscreen button. Also, disable the Autoplay button to prevent the automatic playback of the dreadful ‘related videos’.
- Introduction
- Using
ffmpegin the command line
- Using
- Chapter 2 | Starting with FFmpeg
- Playing videos with
ffplay
- Playing audios with
ffplay
- Using
ffprobeon multimedia files
- Playing videos with
- Chapter 4 | Media containers and FFmpeg numbering
- File and streams numbering

- Using
-mapoptions
- Specifying stream metadata

- File and streams numbering
-
Chapter 5 | Format conversion
- Video-to-image conversions

- Image-to-video conversions

-
Video-to-GIF and video-to-APNG animation conversions

This video shows my software implementation for Chandler Bing's ‘Run, Yasmine! Run!’ challenge. [For copyright reasons, I could not use it in the book. For technical reasons, I could not demonstrate animations in the book.]
ffmpeg -i bw.m4v \ -filter_complex "fps=7,scale=w=200:h=-1:flags=lanczos,split[v1][v2]; [v1]palettegen=stats_mode=diff[d]; [v2][d]paletteuse=dither=bayer:bayer_scale=4" \ bw4.gifThis command creates a GIF animation with good frame quality and file size, but the motion is not smooth.

Adjusting the dithering algorithm creates an animation smoother motion but bigger file size and a dotted texture.
ffmpeg -i bw.m4v \ -filter_complex "fps=7,scale=w=200:h=-1:flags=lanczos,split[v1][v2]; [v1]palettegen=stats_mode=diff[d]; [v2][d]paletteuse=dither=bayer:bayer_scale=1" \ bw1.gif
However, GIF is an ancient format. The new alternative is APNG. It is lossless like PNG and supports animation and millions of colours.
ffmpeg -i bw.m4v \ -vf "scale=w=200:h=-2, hqdn3d, fps=6" \ -dpi 72 -plays 0 \ bw.apngIf you need to convert a GIF to APNG, ImageMagick is the tool you should use, not FFmpeg.
magick animated.gif animated.apngThis kind of APNG creation is not recommended. Colours in the source GIF file would have been already downsampled to 256 colours (as per GIF specification). If you convert from PNG source files, you will be able to create an APNG with richer colours.
For my first fiction title Unlikely Stories, I initially used an animated GIF.
magick -delay 200 -loop 0 \ chapter-image-*.png \ -units PixelsPerInch -density 72 -resize '>x400' \ animation-unlikely-stories.apngAfter I learned about APNG format, I was able to eliminate the effects of downsampling.
Animated GIF Animated PNG 
- Audio-to-video conversions

- Convert YouTube videos to audio
The
yt-dlproject has been buried because of legal issues. Theyt-dlpproject has taken its place. I've written about this newer python tool in a couple of blog posts. - Text-to-audio conversions

- Video-to-image conversions
- Chapter 6 | Editing videos
- Fixing aspect ratio of distorted videos

- Fixing aspect ratio of distorted videos
-
Chapter 7 | Using FFmpeg Filters
- Inset video (picture-in-picture overlay)

- Split video (side-by-side overlay)

- Split video (side-by-side overlay with borders)

- Rotate and flip videos

- Rotate videos discretely

- Adjust brightness, contrast and saturation

- Remove channel logo from video

- Fade-in and fade-out audio and video

- Crop video

- Sharpen/blur video

- Speed up video

-
Slow down video

Ms. Lennon's original video was available on her channel.
After slowing down a Tom & Jerry video, I was able to confirm poltergeist activity in a doll.

- Generate test video with sound (noise)

- Generate test video — Write text on video — Draw box on video

- Inset video (picture-in-picture overlay)
- Chapter 8 | All about audio
- Render visual waveform of the audio —
showwavesfilter —
dialup-modem-handshake.mp4
- Render visual waveform of the audio —
showfreqsfilter —
The-most-annoying-DIY-electronic-alarm.mp4
- Normalize audio

- Dynamically compress audio

- Render visual waveform of the audio —
- Chapter 11 | FFmpeg Tips & Tricks
- Add an espeak intro to your MP3 files

- Render animated GIF on video —
subhash-browser-rss-demo-with-download-button.mp4
- Generate noise of certain color — barb-intermission.mp4

- Use bleep sound in video — barb-bleep.mp4

- How to add echo to video — barb-echo.mp4

- Reverse video and audio

- Forensic examination of audio (not really) —
chenda-music-sound-levels.mp4
- Fade into another video using transition effect — trips.mp4

- More xfade transitions

- Replace a green-screen background with another video (nuvo) —
green-screen-eliminated.mp4
- Replace green-screen background with another video (ole)

- Pan across a video using filter expressions

- All-in-one demo

- Add an espeak intro to your MP3 files
Miscellaneous video demos
Stop wasting hours on expensive timeline-based video editors such as Premiere Pro or Final Cut Pro! Most video-editing tasks REQUIRE LESS THAN 5 MINUTES USING FFMPEG. (Rendering time not included.) FFmpeg can create almost all kinds of complex videos with fonts, animations, subtitles, overlays, transitions, etc. From the command line! Using just one command! FFmpeg! No problem!
-
Subtitle a video
In the subtitle file (SSA), I used the following style for using my own custom font and other subtitle display settings.
Style: Default,Florentia,30,&H2200CCCC,&H000000FF,&H220000EE,&HAA00CCCC,-1,-1,0,0,100,100,0,30.00,3,2,3,1,20,20,40,1
-
A stop-motion video created using Cheese and FFmpeg

-
Increase volume using FFMPEG and or Audacity for Dynamic Range Compression

-
Randomly replace a color


Acknowledgements & Thanks
- Barbara 2.0
- 'Beto' O'Rourke (Born to be president… ial campaign)
- Chills
- Jean-Claude Van Damme (public-domain videos)
- ‘Jerome Weiselberry’
- Jimmy Fallon (Tonight Show)
- Laurie Lennon
- Naomi 'Sexy Cyborg' Wu
- Sara Gonzales Unfiltered
- Yasmine Bleeth (Baywatch)
Use an RSS feed-reader such as Liferea, Thunderbird/Seamonkey or RSS Owl if you would like to anonymously subscribe to these channels. If you have no choice but to use Android, then use my app Subhash Browser & RSS Reader. It is also FREE.
Some other videos that I have created using FFmpeg
- Climate Change teen's message - improved, expletives deleted, bleeped & subtitled
In 2018, a Linux update ensured that all swear words in the kernel code submits will be automatically replaced. For example, 'f***' would be replaced with the word 'hug'. I did the same to a speech by a Swedish climate teen.

- Alexandria Ocasio-Cortez, meet Garbage Disposal

-
FAA under AOC Socialist administration
ffmpeg -y -i Prime-Time.mp4 \ -ss 0:43:51 -t 0:0:33 \ -filter_complex "color=c=green:s=640x360[c]; [c]drawtext=x=20:y=20:fontcolor=yellow:alpha=0.6:shadowx=1:shadowy=1:textfile=t1.txt:fontsize=22:fontfile=Dummies_.ttf[t1]; [t1]drawtext=x=270:y=320:fontcolor=yellow:alpha=0.6:shadowx=1:shadowy=1:textfile=t2.txt:fontsize=22:fontfile=Dummies_.ttf[t2]; [t2]drawtext=x=10:y=330:fontcolor=white:alpha=0.6:textfile=t3.txt:fontsize=16:fontfile=SourceSerifPro-It.ttf[t3]; [0:v:0]crop=640:250:0:35[v]; [t3][v]overlay=0:55" \ aoc-faa.mp4
- Rachel Maddow crying offscreen footage

- "So many people don't share Google's values!"

- Can the New York Times legally copy Naomi Wu's video without permission?

- Joe Biden is US comedy relief

- Jennifer Lawrence and Steve Buscemi deep-fake videos composited with images, text, background colour boxes
Check my blog post for theffmpegcommand that created this video.

Companion book
FFmpeg is a command-line program. If you are going to use it a lot, then you might as well become an expert at the command-line. Here is one of my other books that will make your terminal time more fun and easy.
This is the first and only paperback with colour syntax highlighting! (This feature is not available in the ebook form of the book.) No other publisher has done something like this.





