Npm install discord js ffmpeg binaries opusscript ytdl core save ошибки
Hi. thanks for create the bot, it works. but I can't play any sound, when I use the command "! sound", in my cmd I got this error
"Error occured!
Error: FFMPEG not found
at Function.selectFfmpegCommand (C:\discord-soundbot-master\node_modules\prism-media\src\transcoders\ffmpeg\Ffmpeg.js:46:13)
at new FfmpegTranscoder (C:\discord-soundbot-master\node_modules\prism-media\src\transcoders\ffmpeg\Ffmpeg.js:7:37)
at new MediaTranscoder (C:\discord-soundbot-master\node_modules\prism-media\src\transcoders\MediaTranscoder.js:10:19)
at new Prism (C:\discord-soundbot-master\node_modules\prism-media\src\Prism.js:5:23)
at VoiceConnection (C:\discord-soundbot-master\node_modules\discord.js\src\client\voice\VoiceConnection.js:46:18)
at Promise (C:\discord-soundbot-master\node_modules\discord.js\src\client\voice\ClientVoiceManager.js:63:22)
at ClientVoiceManager.joinChannel (C:\discord-soundbot-master\node_modules\discord.js\src\client\voice\ClientVoiceManager.js:45:12)
at VoiceChannel.join (C:\discord-soundbot-master\node_modules\discord.js\src\structures\VoiceChannel.js:120:30)
at SoundBot.playSoundQueue (C:\discord-soundbot-master\src\SoundBot.js:114:18)
at SoundBot.handleSoundCommands (C:\discord-soundbot-master\src\SoundBot.js:95:47)"
The text was updated successfully, but these errors were encountered:
3 Answers 3
Introduction to Voice Voice in discord.js can be used for many things, such as music bots, recording or relaying audio.
In discord.js, you can use voice by connecting to a VoiceChannel to obtain a VoiceConnection, where you can start streaming and receiving audio.
To get started, make sure you have:
FFmpeg - npm install ffmpeg-binaries
an opus encoder, choose one from below:
- npm install node-opus (better performance)
- npm install opusscript (a good network connection)
The preferred opus engine is node-opus, as it performs significantly better than opusscript. When both are available, discord.js will automatically choose node-opus. Using opusscript is only recommended for development environments where node-opus is tough to get working. For production bots, using node-opus should be considered a necessity, especially if they're going to be running on multiple servers.
FFmpeg is a convenient tool to work with audio/video/image/subtitle stuff, in this context this tool is required for extracting audio from an arbitrary container for bitstream (eg. mp4, mkv, flv, ogg) to a discord compatible VoIP codec OPUS.
Though it's intended be platform independent but for each platform requires different procedures, Note that: I only listed those platforms with which I have expertise with.
RedFame01 commented Mar 3, 2018
Thanks for rapid answer! If I run ffmpeg -version I get this
"ffmpeg version N-90173-gfa0c9d69d3 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libmfx --enable-amf --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth
libavutil 56. 7.101 / 56. 7.101
libavcodec 58. 13.100 / 58. 13.100
libavformat 58. 10.100 / 58. 10.100
libavdevice 58. 2.100 / 58. 2.100
libavfilter 7. 12.100 / 7. 12.100
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100"
I run rhis command npm install ffmpeg-binaries in the bot folder, and now if I play a sound the bot come in my channel , but it don't say anything and now I got this error:
"Error: OPUS_ENGINE_MISSING
at Object.exports.fetch.engineOptions [as fetch] (C:\discord-soundbot-master\node_modules\discord.js\src\client\voice\opus\OpusEngineList.js:27:9)
at AudioPlayer.playUnknownStream (C:\discord-soundbot-master\node_modules\discord.js\src\client\voice\player\AudioPlayer.js:96:37)
at VoiceConnection.playFile (C:\discord-soundbot-master\node_modules\discord.js\src\client\voice\VoiceConnection.js:453:24)
at voiceChannel.join.then (C:\discord-soundbot-master\src\SoundBot.js:115:37)
at process._tickCallback (internal/process/next_tick.js:103:7)
"
ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.
Ignoring exception in command play:
Traceback (most recent call last):
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 2115, in post_process
files_to_delete, info = pp.run(info)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\postprocessor\ffmpeg.py", line 272, in run
filecodec = self.get_audio_codec(path)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\postprocessor\ffmpeg.py", line 166, in get_audio_codec
raise PostProcessingError('ffprobe/avprobe and ffmpeg/avconv not found. Please install one.')
youtube_dl.utils.PostProcessingError: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\kola5\PycharmProjects\XD\music2\bot1.py", line 96, in play
ydl.download([sourse])
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 2068, in download
res = self.extract_info(
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 808, in extract_info
return self.__extract_info(url, ie, download, extra_info, process)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 815, in wrapper
return func(self, *args, **kwargs)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 847, in __extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 881, in process_ie_result
return self.process_video_result(ie_result, download=download)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 1692, in process_video_result
self.process_info(new_info)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 2050, in process_info
self.post_process(filename, info_dict)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 2117, in post_process
self.report_error(e.msg)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 628, in report_error
self.trouble(error_message, tb)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 598, in trouble
raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.
The above exception was the direct cause of the following exception:
This module may be buggy and need some fine tuning. Feel free to let me know what problems you encounter by opening an issue on the repo. This was originally an update of the original bot from ruiqimao by nexu-dev, but is now a updated version (again) for Discord.js's version 11.2^. Fixes deprecated warnings, video playback issues, along with various other add-ons and tweaks to the priors. For support/questions join the Discord server for a faster response than the repo.
- musichelp [command] : Displays help text for commands by this addon, or help for a specific command.
- play | : Play audio from YouTube.
- skip [number] : Skip a song or multi songs with skip [some number],
- queue : Display the current queue.
- pause : Pause music playback.
- resume : Resume music playback.
- volume : Adjust the playback volume between 1 and 200.
- leave : Clears the song queue and leaves the channel.
- clearqueue : Clears the song queue.
- owner : Various owner commands/actions. (W.I.P)
Permissions:
- If anyoneCanSkip is true, anyone can skip songs in the queue.
- If anyoneCanAdjust is true, anyone can adjust the volume.
- If ownerOverMember is true, the set ID of the user ( botOwner ) will over-ride CanAjust and CanSkip.
Pre-installation:
npm install discord.js
It is recommended to have the stable branch.
ffmpeg installed correctly for your OS/env.
Allows the bot to join voice as well as speak.
npm install node-opus or npm install opusscript
Required for voice. Discord.js prefers node-opus.
Installation:
Common installation issues:
Issue: (Trivial) FFMPEG was not found on your system.
Fix: Make sure ffmpeg is installed correctly and set in your PATH variable.
Issue: (Uncommon) Couldn't find an Opus engine.
Fix: npm install node-opus or npm install opusscript
Issue: (Rare) [NPM] ERR Cannot read property '0' of undefined
Fix: npm i -g npm@4.6.1 or another lower version of npm.
Issue: (Rare) TypeError: Invalid non-string/buffer chunk
Fix: Stop using ffmpeg-binaries . Seriously. It's been said enough to use ffmpeg itself by now.
Issue: (Trivial) Any node-gyp errors. (build fail, missing cl.exe, etc.)
Fix: This one is a little more complicated.
- Download and install Visual Studio 2015
- New project -> Visual C++
- Install Visual C++
If that doesn't fix your issue;
Issue: (Uncommon) ffluent-ffmpeg errors.
- Download and install ffmpeg correctly for your OS/env.
- Stop asking and make sure it's installed right.
This addon is easy to use, and doesn't require any extra configuration besides a YouTube Data API key to run.
More examples can be found on the repo or once downloaded in examples .
Example basic code, standalone:
Most options are optional and thus not needed.
The options you can pass in music(client, ) and their types is as followed:
Note: All boolean options default false.
I want to make my Discord bot join voice chat but every time I make it I get a error into log(cmd) saying, FFMPEG not found , please help me.
Picture of the error:
This is the code:
this is my package.json file:
RedFame01 commented Mar 3, 2018
Thanks for rapid answer! If I run ffmpeg -version I get this
"ffmpeg version N-90173-gfa0c9d69d3 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libmfx --enable-amf --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth
libavutil 56. 7.101 / 56. 7.101
libavcodec 58. 13.100 / 58. 13.100
libavformat 58. 10.100 / 58. 10.100
libavdevice 58. 2.100 / 58. 2.100
libavfilter 7. 12.100 / 7. 12.100
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100"
I run rhis command npm install ffmpeg-binaries in the bot folder, and now if I play a sound the bot come in my channel , but it don't say anything and now I got this error:
"Error: OPUS_ENGINE_MISSING
at Object.exports.fetch.engineOptions [as fetch] (C:\discord-soundbot-master\node_modules\discord.js\src\client\voice\opus\OpusEngineList.js:27:9)
at AudioPlayer.playUnknownStream (C:\discord-soundbot-master\node_modules\discord.js\src\client\voice\player\AudioPlayer.js:96:37)
at VoiceConnection.playFile (C:\discord-soundbot-master\node_modules\discord.js\src\client\voice\VoiceConnection.js:453:24)
at voiceChannel.join.then (C:\discord-soundbot-master\src\SoundBot.js:115:37)
at process._tickCallback (internal/process/next_tick.js:103:7)
"
ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.
Ignoring exception in command play:
Traceback (most recent call last):
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 2115, in post_process
files_to_delete, info = pp.run(info)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\postprocessor\ffmpeg.py", line 272, in run
filecodec = self.get_audio_codec(path)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\postprocessor\ffmpeg.py", line 166, in get_audio_codec
raise PostProcessingError('ffprobe/avprobe and ffmpeg/avconv not found. Please install one.')
youtube_dl.utils.PostProcessingError: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\kola5\PycharmProjects\XD\music2\bot1.py", line 96, in play
ydl.download([sourse])
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 2068, in download
res = self.extract_info(
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 808, in extract_info
return self.__extract_info(url, ie, download, extra_info, process)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 815, in wrapper
return func(self, *args, **kwargs)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 847, in __extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 881, in process_ie_result
return self.process_video_result(ie_result, download=download)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 1692, in process_video_result
self.process_info(new_info)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 2050, in process_info
self.post_process(filename, info_dict)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 2117, in post_process
self.report_error(e.msg)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 628, in report_error
self.trouble(error_message, tb)
File "C:\Users\kola5\PycharmProjects\XD\venv\lib\site-packages\youtube_dl\YoutubeDL.py", line 598, in trouble
raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.
The above exception was the direct cause of the following exception:
This module may be buggy and need some fine tuning. Feel free to let me know what problems you encounter by opening an issue on the repo. This was originally an update of the original bot from ruiqimao by nexu-dev, but is now a updated version (again) for Discord.js's version 11.2^. Fixes deprecated warnings, video playback issues, along with various other add-ons and tweaks to the priors. For support/questions join the Discord server for a faster response than the repo.
- musichelp [command] : Displays help text for commands by this addon, or help for a specific command.
- play | : Play audio from YouTube.
- skip [number] : Skip a song or multi songs with skip [some number],
- queue : Display the current queue.
- pause : Pause music playback.
- resume : Resume music playback.
- volume : Adjust the playback volume between 1 and 200.
- leave : Clears the song queue and leaves the channel.
- clearqueue : Clears the song queue.
- owner : Various owner commands/actions. (W.I.P)
Permissions:
- If anyoneCanSkip is true, anyone can skip songs in the queue.
- If anyoneCanAdjust is true, anyone can adjust the volume.
- If ownerOverMember is true, the set ID of the user ( botOwner ) will over-ride CanAjust and CanSkip.
Pre-installation:
npm install discord.js
It is recommended to have the stable branch.
ffmpeg installed correctly for your OS/env.
Allows the bot to join voice as well as speak.
npm install node-opus or npm install opusscript
Required for voice. Discord.js prefers node-opus.
Installation:
Common installation issues:
Issue: (Trivial) FFMPEG was not found on your system.
Fix: Make sure ffmpeg is installed correctly and set in your PATH variable.
Issue: (Uncommon) Couldn't find an Opus engine.
Fix: npm install node-opus or npm install opusscript
Issue: (Rare) [NPM] ERR Cannot read property '0' of undefined
Fix: npm i -g npm@4.6.1 or another lower version of npm.
Issue: (Rare) TypeError: Invalid non-string/buffer chunk
Fix: Stop using ffmpeg-binaries . Seriously. It's been said enough to use ffmpeg itself by now.
Issue: (Trivial) Any node-gyp errors. (build fail, missing cl.exe, etc.)
Fix: This one is a little more complicated.
- Download and install Visual Studio 2015
- New project -> Visual C++
- Install Visual C++
If that doesn't fix your issue;
Issue: (Uncommon) ffluent-ffmpeg errors.
- Download and install ffmpeg correctly for your OS/env.
- Stop asking and make sure it's installed right.
This addon is easy to use, and doesn't require any extra configuration besides a YouTube Data API key to run.
More examples can be found on the repo or once downloaded in examples .
Example basic code, standalone:
Most options are optional and thus not needed.
The options you can pass in music(client, ) and their types is as followed:
Note: All boolean options default false.
I want to make my Discord bot join voice chat but every time I make it I get a error into log(cmd) saying, FFMPEG not found , please help me.
Picture of the error:
This is the code:
this is my package.json file:
Windows
Windows is not easy as GNU/Linux, you either manually satisfy all dependencies then compile all the stuff all by yourself with MSVC or use Cygwin or Msys2 to compile. An alternative way is to download pre-compiled windows binaries from Zeranoe's website. Due to Zeranoe's website is closed, download from Gyan's website or anywhere else.
This will download you a Zip archive which you've to extract and copy all contents of the bin/ folder, those are the FFmpeg binaries. Optionally, store them at a file path which is listed in the PATH environment variable, to run it simply as ffmpeg in a shell.
This module may be buggy and need some fine tuning. Feel free to let me know what problems you encounter by opening an issue on the repo. This was originally an update of the original bot from ruiqimao by nexu-dev, but is now a updated version (again) for Discord.js's version 11.2^. Fixes deprecated warnings, video playback issues, along with various other add-ons and tweaks to the priors. For support/questions join the Discord server for a faster response than the repo.
- musichelp [command] : Displays help text for commands by this addon, or help for a specific command.
- play | : Play audio from YouTube.
- skip [number] : Skip a song or multi songs with skip [some number],
- queue : Display the current queue.
- pause : Pause music playback.
- resume : Resume music playback.
- volume : Adjust the playback volume between 1 and 200.
- leave : Clears the song queue and leaves the channel.
- clearqueue : Clears the song queue.
- owner : Various owner commands/actions. (W.I.P)
Permissions:
- If anyoneCanSkip is true, anyone can skip songs in the queue.
- If anyoneCanAdjust is true, anyone can adjust the volume.
- If ownerOverMember is true, the set ID of the user ( botOwner ) will over-ride CanAjust and CanSkip.
Pre-installation:
npm install discord.js
It is recommended to have the stable branch.
ffmpeg installed correctly for your OS/env.
Allows the bot to join voice as well as speak.
npm install node-opus or npm install opusscript
Required for voice. Discord.js prefers node-opus.
Installation:
Common installation issues:
Issue: (Trivial) FFMPEG was not found on your system.
Fix: Make sure ffmpeg is installed correctly and set in your PATH variable.
Issue: (Uncommon) Couldn't find an Opus engine.
Fix: npm install node-opus or npm install opusscript
Issue: (Rare) [NPM] ERR Cannot read property '0' of undefined
Fix: npm i -g npm@4.6.1 or another lower version of npm.
Issue: (Rare) TypeError: Invalid non-string/buffer chunk
Fix: Stop using ffmpeg-binaries . Seriously. It's been said enough to use ffmpeg itself by now.
Issue: (Trivial) Any node-gyp errors. (build fail, missing cl.exe, etc.)
Fix: This one is a little more complicated.
- Download and install Visual Studio 2015
- New project -> Visual C++
- Install Visual C++
If that doesn't fix your issue;
Issue: (Uncommon) ffluent-ffmpeg errors.
- Download and install ffmpeg correctly for your OS/env.
- Stop asking and make sure it's installed right.
This addon is easy to use, and doesn't require any extra configuration besides a YouTube Data API key to run.
More examples can be found on the repo or once downloaded in examples .
Example basic code, standalone:
Most options are optional and thus not needed.
The options you can pass in music(client, ) and their types is as followed:
Note: All boolean options default false.
GNU/Linux
You mostly use the package manager to install it along with its dependencies, or you can just use the way of manually compiling the code with the steps described at here.
Читайте также: