0% found this document useful (0 votes)
19 views3 pages

Ffmpeg Notes

FFmpeg is a command-line tool for converting multimedia files and can record, convert, and stream audio and video. The document provides basic syntax, common commands for video manipulation, useful flags, common video codecs, and advanced examples such as adding watermarks and creating GIFs. It also includes installation instructions for Windows, Linux, and macOS.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views3 pages

Ffmpeg Notes

FFmpeg is a command-line tool for converting multimedia files and can record, convert, and stream audio and video. The document provides basic syntax, common commands for video manipulation, useful flags, common video codecs, and advanced examples such as adding watermarks and creating GIFs. It also includes installation instructions for Windows, Linux, and macOS.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

FFmpeg Quick Notes

What is FFmpeg?

FFmpeg is a command-line tool to convert multimedia files (audio, video) between formats.

It can record, convert, stream audio and video.

Basic Syntax

ffmpeg -i inputfile outputfile

-i = input file

Without any other options, FFmpeg will try to convert to another format automatically.

Common Commands

Convert Video Format:

ffmpeg -i input.mp4 output.avi

Extract Audio from Video:

ffmpeg -i input.mp4 -q:a 0 -map a output.mp3

Resize Video:

ffmpeg -i input.mp4 -vf scale=640:360 output.mp4

Compress Video:

ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4

Cut a Section of Video:

ffmpeg -i input.mp4 -ss 00:01:00 -to 00:02:00 -c copy output.mp4


Merge Videos (Concatenation):

Create list.txt:

file 'video1.mp4'

file 'video2.mp4'

Then run:

ffmpeg -f concat -safe 0 -i list.txt -c copy output.mp4

Useful Flags

-ss : start time

-t : duration

-to : end time

-vf : video filters

-af : audio filters

-c:v : video codec

-c:a : audio codec

-b:v : video bitrate

-b:a : audio bitrate

-crf : Constant Rate Factor (quality control)

-preset : speed-quality balance

Common Video Codecs

libx264 - H.264 (very common for MP4)

libx265 - H.265 (better compression)

vp9 - WebM videos

Advanced Examples
Add a Watermark:

ffmpeg -i input.mp4 -i watermark.png -filter_complex "overlay=10:10" output.mp4

Create a GIF from Video:

ffmpeg -i input.mp4 -vf "fps=10,scale=320:-1" output.gif

Installation

Windows: Download binaries from https://ffmpeg.org

Linux:

sudo apt install ffmpeg

macOS:

brew install ffmpeg

You might also like