Configure FFmpeg
What is FFmpeg?
FFmpeg is a well-known open-source audio and video processing library used in many audio and video encoding and decoding projects.
Why use FFmpeg?
This project uses FFmpeg to encode and decode audio and video, allowing NapCat to handle audio and video files in formats supported by QQ.
If your Bot does not need to handle audio and video, you can choose not to install FFmpeg.
Install FFmpeg
Windows
Download the official licensed FFmpeg from here;
Extract the folder to a known location (e.g.,
C:\Program Files
) and rename it toffmpeg
;Your
ffmpeg
folder structure should look like this:textffmpeg |___bin |___|___ffmpeg.exe |___|___ffplay.exe |___\___ffprobe.exe |___doc |___\ ... |___LICENSE \___README.txt
Note
Make sure that the
bin
folder containsffmpeg.exe
,ffplay.exe
, andffprobe.exe
! Otherwise, unexpected errors may occur.Start QQNT, go to the LLOneBot settings page, select FFmpeg as the previously extracted
ffmpeg.exe
(in this example, the main FFmpeg program is located atC:\Program Files\ffmpeg\bin\ffmpeg.exe
), and then click the "Save" button;If no errors occur, FFmpeg is successfully configured. Congratulations!
If other programs also need to use FFmpeg
If other programs support manually selecting the FFmpeg location, simply configure it to use the FFmpeg used by NapCat.
If other programs do not support manually selecting the FFmpeg location, simply register the bin
directory of FFmpeg to the system PATH
variable (refer to this tutorial) .
If you have installed FFmpeg in the system variable, you can use FFmpeg normally whether or not you have configured the FFmpeg path in NapCat.
Linux
Use the package manager of your system to install ffmpeg
directly.
macOS
You can install FFmpeg using Homebrew, or you can manually download the binary files from here and install them.
Note that if you choose to install manually, make sure you download and install FFmpeg, FFprobe, and FFplay, otherwise unexpected errors may occur.