Installing ffmpeg on Windows
Why install it? If an AI project involves audio or video, it will almost certainly be used, so it is recommended to install it.
Download ffmpeg and set environment variables
ffmpeg Windows version download address
https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-6.1.1-full_build.7z
More other versions download https://www.gyan.dev/ffmpeg/builds/
After downloading and extracting, enter 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 a Path environment variable: Press and hold the Win key + Pause key (top right), and click --Advanced System Settings--Environment Variables--System Variables--find Path this line double-click in the opened window
Then click New--Browse in turn, find the directory where the 3 exe are located
Find the directory where ffmpeg.exe is located in the browse dialog box 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 down to close all opened dialog boxes.
Verify whether the installation is successful
Open a cmd window at random, enter ffmpeg and press Enter. If the following is displayed, the installation is correct. If it prompts "ffmpeg is not an available command or...", it means that you have made a mistake when configuring the environment variables, please reconfigure.
Install ffmpeg on Mac
- Open a terminal window and enter the command
brew -v
. If an error such as command does not exist or not found is prompted, you need to install brew
- To install brew, continue to enter this 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 that brew is successfully installed, and you can continue to install ffmpeg
- Continue to execute the command
brew install ffmpeg
in the terminal. After waiting for the execution to complete, enter the commandffmpeg
again. If a large string of version information is output, it means that ffmpeg has been successfully installed