Installing ffmpeg on Windows
Why install it? If your AI project involves audio or video, you'll almost certainly need it, so installation is recommended.
Download ffmpeg and set environment variables
ffmpeg Windows 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, unzip it. 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 Path environment variable: Hold down the Win key + Pause key (upper right corner), click in the opened window -- Advanced system settings -- Environment variables -- System variables -- find the Path line and double-click it.
Then click New--Browse, find the directory where the 3 exe files are located.
In the browse dialog, find the directory where ffmpeg.exe is located, and then click OK.
Then you will see the newly added path on the left, click OK to close, and OK all the way to close all the opened dialog boxes.
Verify successful installation
Open any cmd window, enter ffmpeg and press Enter. If the following is displayed, the installation is correct. If it prompts "ffmpeg is not an available command or..." etc., it means you made a mistake in configuring the environment variables, please reconfigure.
Installing ffmpeg on Mac
- Open a terminal window and enter the command
brew -v
. If it prompts that the command does not exist or is not found, 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 execute
brew -v
again. 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 waiting for the execution to complete, enter the commandffmpeg
. If a long string of version information is output, it means ffmpeg has been successfully installed.