Installing FFmpeg on Windows
If you are using a pre-packaged version, FFmpeg is already built-in, and you do not need to install it separately.
Why install it? If your AI project involves audio or video, you will almost certainly need it. Therefore, it is 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
package. This includes support for all common libraries. After downloading, extract it and go to the bin directory. You will see three exe files. Copy them to an English directory, for example, I copied them to E:\sdk\ffmpeg
. Then, add this path to the Path environment variable.
How to add the Path environment variable: Press Win key + Pause key (top right), in the opened window, click --Advanced System Settings--Environment Variables--System Variables--find the Path line 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 then click OK.
Then you can see the newly added path on the left. Click OK to close, and click OK all the way to close all the opened dialogs.
Verify if the installation was successful.
Open any cmd window and enter ffmpeg
. If the following is displayed, the installation is correct. If it prompts "ffmpeg is not an available command..." or similar, it means that 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 such as command not found, you need to install brew.
- To install brew, continue to enter the following command in the terminal:
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
- Confirm the installation is complete, wait for the execution to finish, and then re-execute
brew -v
. If the version number is displayed, it means that brew is installed successfully, and you can continue to install ffmpeg.
- Continue to execute 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 that ffmpeg has been successfully installed.