Installing FFmpeg on Windows
Why install it? If your AI project involves audio or video, you'll almost certainly need it. Therefore, it's recommended to install it.
Download FFmpeg and Set Environment Variables
FFmpeg Windows version download address:
https://www.gyan.dev/ffmpeg/builds/#release-builds
Choose to download the ffmpeg-release-full.7z
archive. This includes support for all common libraries. After downloading, extract it and go to the bin
directory. You'll see three .exe
files. Copy them to an English directory, for example, E:\sdk\ffmpeg
. Then, add this path to the Path environment variable.
How to add the Path environment variable: Press the Win key + Pause key (top right corner). In the opened window, click on: Advanced system settings -> Environment Variables -> System variables -> Find the Path row and double-click it.
Then, click New -> Browse, find the directory where the three .exe
files are located.
In the browse dialog, find the directory where ffmpeg.exe
is located and click OK.
Then, you'll see the newly added path on the left. Click OK to close, and click OK all the way to close all opened dialog boxes.
Verify successful installation
Open any cmd window and enter ffmpeg
, press Enter. If the following is displayed, it means the installation is correct. If it says "ffmpeg is not a recognized command or...", it means you made a mistake when configuring the environment variables. Please reconfigure.
Installing FFmpeg on Mac
Open a terminal window and enter the command
brew -v
. If you see an error message like "command not found", you need to install brew.- To install brew, enter the following command in the terminal:
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
- Verify that the installation is complete. Wait for the execution to finish, then re-run
brew -v
. If the version number is displayed, it means brew is installed successfully and you can continue installing FFmpeg.
- Continue executing the command
brew install ffmpeg
in the terminal. After the execution is complete, enter the commandffmpeg
. If a long string of version information is output, it means FFmpeg has been installed successfully.