'ffmpeg' is not recognized as an internal or external command

avatar
Borislav Hadzhiev

Last updated: Apr 4, 2024
4 min

banner

# 'ffmpeg' is not recognized as an internal or external command

The error "'ffmpeg' is not recognized as an internal or external command, operable program or batch file" occurs for 2 main reasons:

  1. Not having ffmpeg installed on your Windows machine.
  2. Not having ffmpeg added to your user's PATH environment variable.

ffmpeg is not recognized as internal or external command

shell
'ffmpeg' is not recognized as an internal or external command, operable program or batch file. The term 'ffmpeg' is not recognized as the name of a cmdlet, function, script file, or operable program.
If you already have FFmpeg installed, scroll down to the next subheading.

To download and install FFmpeg on Windows:

  1. Open the FFmpeg downloads page, select the Windows logo and click on "Windows builds from gyan.dev".

ffmpeg download for windows

  1. In the "git master builds" section, download the ffmpeg-git-full version for the latest release.

download ffmpeg git full version

  1. Open your downloads directory, right-click on the ffmpeg.7z file, hover over 7-Zip and click on "Extract Here".

extract download here

  1. Rename the output directory to ffmpeg.

rename to ffmpeg

  1. Copy the ffmpeg directory to Local Disk (C:), or in other words C:\.

copy directory to local disk c

The next step is to add the path to the ffmpeg executable file to your user's PATH environment variable.

The ffmpeg.exe file is located in the bin directory in the ffmpeg folder.

location of ffmpeg exe file

# Add the path to ffmpeg.exe to your user's PATH environment variable

To add the path to the ffmpeg executable to your user's PATH environment variable:

  1. Click on the Search bar and type "environment variables".
  2. Click on "Edit the system environment variables".

edit system environment variables

  1. Click on the "Environment Variables" button.

click environment variables

  1. In the "User variables for YOUR_USER" section, select the "Path" variable and click "Edit".

select user path click edit

  1. You can either click "New" and then "Browse" and navigate to the path where ffmpeg.exe is located or paste it directly.

click new browse

If you pasted your ffmpeg folder in Local Disk (C:), then your path should be the following.

cmd
C:\ffmpeg\bin

location of ffmpeg exe file

We need to add the path to the bin directory in the ffmpeg folder because this is where the ffmpeg executable (ffmpeg.exe) file is located.

When you issue ffmpeg commands, you are effectively using the ffmpeg.exe file.

  1. Once the path is added, confirm the changes by clicking on the "OK" button twice.

path to ffmpeg added

  1. Close your Command prompt application and then reopen it.
Note that you must restart your Command prompt shell for the changes to take effect.

You might also have to restart your PC, but that's not always necessary.

Open a new Command Prompt and run the ffmpeg -version command to make sure everything works as expected.

cmd
ffmpeg -version

ffmpeg command works

Alternatively, you can install ffmpeg using Chocolatey.

# Install FFmpeg on Windows using Chocolatey

To install FFmpeg on Windows if you have Chocolatey installed:

  1. Click on the Search bar and type PowerShell.

  2. Right-click on the PowerShell application and click "Run as administrator".

run powershell as administrator

  1. Run the following command to install ffmpeg.
PowerShell
choco install ffmpeg -y

chocolatey install ffmpeg

If you don't have Chocolatey installed, you have to install it first.

To install Chocolatey:

  1. Open PowerShell as an administrator.

run powershell as administrator

  1. Run the following command.
PowerShell
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

windows install chocolatey

  1. Wait for the command to complete.
  2. Type choco to make sure Chocolatey is installed.

windows verify chocolatey installed

Now that you have Chocolatey installed, run the following command to install ffmpeg.

PowerShell
choco install ffmpeg -y

Note that your shell should still be run using elevated permissions.

chocolatey install ffmpeg

Now you should be able to use the ffmpeg command.

Click on the Search bar, type "cmd" and start the Command Prompt application.

cmd
ffmpeg -version

ffmpeg command works

# Conclusion

To solve the error "'ffmpeg' is not recognized as an internal or external command, operable program or batch file", make sure:

  1. You have ffmpeg installed on your Windows machine.
  2. You have ffmpeg added to your user's PATH environment variable.

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.