How to Install FFmpeg on Windows and Use the Command Line
Learn how to install FFmpeg via winget or manually, add it to your PATH, and use essential commands to convert video and extract audio.

On this page
winget install Gyan.FFmpeg. It is the engine used by almost all video converters, including those with buttons and online tools. If you use it directly, you have no size limits, you can control every parameter, and your files won’t end up on someone else’s server.It has no windows: you type a command and the work begins. It might be a bit intimidating at first, but for common tasks (converting, extracting audio, cutting, reducing file size), you only need a few commands to copy, which you can find below. The latest stable version is 9.0, released in 2026.
Installation with winget #
This is the fastest way on Windows 11 and updated Windows 10. Open Terminal or Command Prompt and type:
winget install Gyan.FFmpeg
This is the full version provided by gyan.dev, the same one you would download manually. Finally, close and reopen your terminal so it recognizes the new path, then check:
ffmpeg -version
If the version and build options appear, everything is set up correctly.

ffmpeg -version
winget upgrade Gyan.FFmpeg. With manual installation, however, you have to re-download the archive and replace the files every time.Manual installation #
Use this when winget is unavailable or if you want a specific build.
From the official download page, hover over the Windows icon and select Windows builds from gyan.dev (alternatively, there are BtbN builds on GitHub). On the gyan.dev page, under release builds, download ffmpeg-release-full.7z: this is the full version, with all encoders.
Extract the archive into a folder that you won’t move, for example
C:\ffmpeg. Windows 11 extracts.7zfiles automatically from version 23H2 (right-click → Extract All); on Windows 10, you will need 7-Zip. Inside, you will find thebinfolder containingffmpeg.exe,ffplay.exe, andffprobe.exe. It doesn’t have to be on your C: drive; the important thing is that the path used in the next step is correct.Add that folder to your PATH: search for Edit the system environment variables in the Start menu, open Environment Variables, select
Pathunder user variables, click Edit → New, and enter:C:\ffmpeg\binConfirm with OK on all windows, open a new terminal, and test it with
ffmpeg -version.
Without the PATH set up, FFmpeg will only work if you manually navigate to its folder every time. When someone says an installation “doesn’t work,” nine times out of ten, this is the reason.

Essential commands to keep handy #
The structure is always the same: ffmpeg -i file_di_ingresso [opzioni] file_di_uscita.
Convert a video to MP4 #
ffmpeg -i filmato.mkv -c:v libx264 -crf 23 -c:a aac -b:a 192k filmato.mp4
The number after -crf controls the quality: the lower it is, the better and larger the video will be. At 18, you won’t see any difference from the original; 23 is a good compromise; above 28, the loss in quality becomes noticeable.
If you have a recent graphics card, you can use it to speed things up significantly: replace libx264 with h264_nvenc for NVIDIA, h264_amf for AMD, or h264_qsv for Intel. The quality is slightly lower at the same file size, but it works perfectly fine for many uses.
If the video is already in the correct format and you only need to change the container, a direct copy is instantaneous because nothing is re-encoded:
ffmpeg -i filmato.mkv -c copy filmato.mp4
Extract audio from a video #
ffmpeg -i lezione.mp4 -vn -c:a libmp3lame -q:a 2 lezione.mp3
-vn removes the video; -q:a 2 provides high quality with a small file. If the original audio is already good enough for you, extract it without re-encoding:
ffmpeg -i lezione.mp4 -vn -c:a copy lezione.m4a
Cut a clip #
ffmpeg -ss 00:01:30 -i video.mp4 -t 00:00:45 -c copy spezzone.mp4
This starts at one minute and thirty seconds and takes forty-five seconds. By using -ss before -i, the cut is almost instantaneous.
Reduce video file size #
ffmpeg -i grande.mp4 -vf "scale=1280:-2" -c:v libx264 -crf 26 -c:a aac -b:a 128k piccolo.mp4
This sets the width to 1280 pixels, calculates the height proportionally, and lowers the quality slightly: the file becomes light enough to send or upload quickly.
Extract a frame #
ffmpeg -ss 00:00:10 -i video.mp4 -frames:v 1 immagine.jpg
Convert all files in a folder #
From PowerShell:
Get-ChildItem *.mkv | ForEach-Object { ffmpeg -i $_.Name -c:v libx264 -crf 23 -c:a aac "$($_.BaseName).mp4" }
-t 00:00:30 to check the result. If you don’t like the quality, you’ll know immediately rather than after forty minutes.ffprobe and ffplay #
There are three programs in the bin folder. ffmpeg.exe converts and modifies. ffplay.exe is a basic player, useful for quickly checking a file or a result: ffplay video.mp4. Then there is ffprobe, which analyzes a file and reports its characteristics:
ffprobe video.mp4
It shows duration, video and audio codecs, resolution, frame rate, and tracks. This is the first command to run when a file won’t open anywhere; usually, the reason is a codec that the program doesn’t support.

Common errors #
ffmpeg non è riconosciuto come comando. The path is not in your PATH, it contains a typo (it must end with \bin), or the terminal was already open before you made the change.
Unknown encoder 'libx264'. The build you downloaded does not include that encoder: you need a full version, like those listed on the official page.
The output file is huge. You didn’t specify the quality and FFmpeg is using a high setting: add -crf.
The audio is out of sync. This happens with some variable frame rate files, such as recordings from a phone; it can often be fixed by re-encoding the audio instead of copying it.
The command seems stuck. Look at the last line: FFmpeg shows progress there, updating it continuously. If the numbers are changing, it is working.
FAQ #
Is FFmpeg free even for professional use? #
Yes, it is free software and you can use it for work too. Full builds include some components under a GPL license: if you integrate it into a program that you distribute, check the license of the build you are using.
Which is better: FFmpeg or a program with a GUI? #
For an occasional conversion, a program with buttons like HandBrake is more convenient. For repetitive tasks, batch conversions, or precise parameters, the command line is faster and always gives the same result. In fact, many of those programs mentioned below use FFmpeg itself.
Can I use it to trim videos without losing quality? #
Yes, with -c copy: the streams are copied without re-encoding, so the quality remains identical and it only takes a few seconds. The limitation is that the cut occurs on the nearest keyframe, so it might shift by a fraction of a second from the exact point you specified.
Does it work on Mac and Linux too? #
Yes, and it is the same program with the same commands. On macOS, you install it with brew install ffmpeg; on Ubuntu and its derivatives via sudo apt install ffmpeg. The commands in this guide work identically across all three systems.
How do I convert a video for WhatsApp or social media? #
The format that works everywhere is MP4 with H.264 video and AAC audio—the same one produced by the first command in this guide. For social media, you should also lower the resolution: 1080 pixels on the long edge is plenty, and the file size will be much smaller.
Can I install it in a folder other than C:\ffmpeg? #
Yes, even on another drive. The only thing that matters is that the exact path to your bin folder is added to your PATH.

