---
title: "How to Install FFmpeg on Windows and Use the Command Line"
description: "Learn how to install FFmpeg via winget or manually, add it to your PATH, and use essential commands to convert video and extract audio."
url: "https://www.alemasone.com/en/install-ffmpeg-windows-command-line/"
language: "en"
published: 2025-07-05
updated: 2026-09-20
categories: ["Multimedia and Creation"]
translations:
  it: "https://www.alemasone.com/it/installare-ffmpeg-windows/"
  es: "https://www.alemasone.com/es/instalar-ffmpeg-windows-linea-comandos/"
  fr: "https://www.alemasone.com/fr/installer-ffmpeg-windows-ligne-commande/"
  pt: "https://www.alemasone.com/pt/instalar-ffmpeg-windows-linha-comando/"
  de: "https://www.alemasone.com/de/ffmpeg-windows-installieren-nutzen-befehle/"
---

# How to Install FFmpeg on Windows and Use the Command Line

On Windows [FFmpeg](https://ffmpeg.org/) is installed with a single command: `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:

```powershell
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:

```powershell
ffmpeg -version
```

If the version and build options appear, everything is set up correctly.

![Windows Terminal showing FFmpeg version number and build options](terminale-ffmpeg-version-windows.png "The successful installation response for `ffmpeg -version`")

> **Updates arrive with a single command.** To upgrade to a new version, type `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](https://learn.microsoft.com/it-it/windows/package-manager/winget/) is unavailable or if you want a specific build.

1. From the [official download page](https://ffmpeg.org/download.html), hover over the Windows icon and select **Windows builds from gyan.dev** (alternatively, there are BtbN builds on GitHub). On the [gyan.dev page](https://www.gyan.dev/ffmpeg/builds/), under *release builds*, download **ffmpeg-release-full.7z**: this is the full version, with all encoders.

2. Extract the archive into a folder that you won't move, for example `C:\ffmpeg`. Windows 11 extracts `.7z` files automatically from version 23H2 (right-click → **Extract All**); on Windows 10, you will need [7-Zip](https://www.7-zip.org/). Inside, you will find the `bin` folder containing `ffmpeg.exe`, `ffplay.exe`, and `ffprobe.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.

3. Add that folder to your PATH: search for **Edit the system environment variables** in the Start menu, open **Environment Variables**, select `Path` under user variables, click **Edit** → **New**, and enter:

   ```text
   C:\ffmpeg\bin
   ```

4. Confirm 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.

![Windows Environment Variables window with the FFmpeg bin folder path added to Path](variabile-environment-windows-ffmpeg.png "The line to add to the user Path variable")

## 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

```bat
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:

```bat
ffmpeg -i filmato.mkv -c copy filmato.mp4
```

### Extract audio from a video

```bat
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:

```bat
ffmpeg -i lezione.mp4 -vn -c:a copy lezione.m4a
```

### Cut a clip

```bat
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

```bat
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

```bat
ffmpeg -ss 00:00:10 -i video.mp4 -frames:v 1 immagine.jpg
```

### Convert all files in a folder

From PowerShell:

```powershell
Get-ChildItem *.mkv | ForEach-Object { ffmpeg -i $_.Name -c:v libx264 -crf 23 -c:a aac "$($_.BaseName).mp4" }
```

> **Test on thirty seconds.** Before running a long conversion, add `-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`](https://ffmpeg.org/ffprobe.html), which analyzes a file and reports its characteristics:

```bat
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.

![Windows Terminal showing ffprobe analysis: duration, bitrate, and video/audio codecs of the file](analisi-ffprobe-video-windows.png "Information extracted by ffprobe from a video file")

## 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](/en/install-wine-ubuntu-windows-apps/) 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.
