FFmpegs Pages

Simple media processing for everyone

Convert Video Format

23
Command:
ffmpeg -i input.mp4 -c:v libx264 -crf 23 -c:a aac output.mp4

Compress Video

Command:
ffmpeg -i input.mp4 -b:v 2M -maxrate 2M -bufsize 4M output.mp4

Extract Frames

Command:
ffmpeg -i input.mp4 -ss 00:01:30 -vframes 1 frame.png

Audio Processing

Command:
ffmpeg -i input.mp4 -vn -acodec mp3 output.mp3

Frequently Asked Questions

How do I compress video with FFmpeg?

You can compress video using:
ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4

How to extract audio with FFmpeg?

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

How to cut a video without re-encoding?

Use the copy codec:
ffmpeg -ss 00:00:30 -to 00:01:00 -i input.mp4 -c copy output.mp4

How to convert a video to GIF with FFmpeg?

Simple command:
ffmpeg -i input.mp4 output.gif
For higher quality, add filters:
ffmpeg -i input.mp4 -vf "fps=10,scale=320:-1:flags=lanczos" output.gif

How to merge multiple videos with FFmpeg?

Create a text file file_list.txt:
file 'video1.mp4'
file 'video2.mp4'
Then run:
ffmpeg -f concat -safe 0 -i file_list.txt -c copy output.mp4

How to change video resolution with FFmpeg?

Resize video to 720p:
ffmpeg -i input.mp4 -vf scale=1280:720 output.mp4

How to remove audio from a video?

Command:
ffmpeg -i input.mp4 -an output.mp4