Install ffmpeg on Windows
Why install it? If your AI project involves audio or video, you'll almost certainly need it. So, 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
package. This includes support for all common libraries. After downloading and extracting, go to the bin directory, you will see 3 exe files. Copy them to an English directory, for example, I copied them to the E:\sdk\ffmpeg
folder, and then add this path to the Path environment variable.
How to add Path environment variable: Press Win+Pause key (top right), in the opened window, click in order -- Advanced system settings -- Environment Variables -- System variables -- find the Path line and double click it.
Then click New -- Browse in order, find the directory where the 3 exe files are located.
In the browse dialog box, find the directory where ffmpeg.exe is located as mentioned earlier, 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 opened dialog boxes.
Verify successful installation
Open a cmd window at random, enter ffmpeg and press Enter. If the following is displayed, it means the installation is correct. If it prompts "ffmpeg is not an available command or...", it means there is an error in configuring the environment variable. Please reconfigure.
Install ffmpeg on Mac
- Open a terminal window and enter the command
brew -v
. If an error message such as command not found or not found is displayed, 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 complete, and then re-execute
brew -v
. If the version number is displayed, it means 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 large string of version information is output, it means that ffmpeg has been successfully installed.