Introduction
I don’t belive you pay Adobe $49 a month just to convert videos. FFMPEG is a free and open-source project consisting of a vast software suite of libraries and programs for handling video, audio, and other multimedia files and streams. It’s a swiss army knife for video processing.
Thanks me later. You already save $49 a month.
Commands
FFMPEG is a command-line tool, so you need to know the commands to use it. Here are some of the most common commands:
Cut Video
Suppose you want to cut a video from 00:00:10 to 00:00:20. Here’s how you can do it:
Flag | Description | Example |
---|---|---|
-i | Input file | input.mp4 |
-ss | Start time | 00:00:10 |
-to | End time | 00:00:20 |
-c | Codec | copy |
Convert Video to GIF
Suppose you want to convert a video to a GIF. Here’s how you can do it:
Flag | Description | Example |
---|---|---|
-i | Input file | input.mp4 |
-vf | Video filter | fps=10,scale=320:-1:flags=lanczos |
-c:v | Video codec | gif |
Snapshots
Suppose you want to take a snapshot from RTSP or webcam stream. Here’s how you can do it:
Flag | Description | Example |
---|---|---|
-f | Format | rtsp. Available formats: rtsp, v4l2 (webcam), etc. |
-i | Input file | rtsp://username:password@ip:port |
-vframes | Number of frames | 10 |
Video to Frames
Suppose you want to extract frames from a video. Here’s how you can do it:
Flag | Description | Example |
---|---|---|
-i | Input file | input.mp4 |
-vf | Video filter | fps=1 |
Get Audio from Video
Suppose you want to extract audio from a video. Here’s how you can do it: