我收到此“错误:找不到FFmpeg / avconv!” [英] I am getting this "Error: FFmpeg/avconv not found!"

查看:145
本文介绍了我收到此“错误:找不到FFmpeg / avconv!”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个Discord机器人,但是每次尝试运行youtube链接时都会收到此错误。

I am trying to create a discord bot, however receive this error every time I try to run a youtube link.

Error: FFmpeg/avconv not found!
    at Function.getInfo (C:\Users\-\discord-bot\node_modules\prism-media\src\core\FFmpeg.js:130:11)
    at Function.create (C:\Users\-\discord-bot\node_modules\prism-media\src\core\FFmpeg.js:143:38)
    at new FFmpeg (C:\Users\-\discord-bot\node_modules\prism-media\src\core\FFmpeg.js:44:27)
    at AudioPlayer.playUnknown (C:\Users\-\discord-bot\node_modules\discord.js\src\client\voice\player\BasePlayer.js:47:20)
    at VoiceConnection.play (C:\Users\-\discord-bot\node_modules\discord.js\src\client\voice\util\PlayInterface.js:71:28)
    at Object.play (C:\Users\-\discord-bot\commands\play.js:78:8)
    at Object.execute (C:\Users\-\discord-bot\commands\play.js:48:16)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:14004) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send an empty message
    at RequestHandler.execute (C:\Users\-\discord-bot\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:14004) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandl
ed promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:14004) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

我用 npm install -g ffmpeg-binaries 安装了ffmpeg尝试在全球范围内安装。我还向PATH中添加了ffmpeg,但这似乎没有用。

I installed ffmpeg with npm install -g ffmpeg-binaries to try and install it globally. I also added ffmpeg to PATH, but that did not seem to work.

是否可以修复它?

推荐答案

您是否正在使用此方法?
https://discord.js。 org /#/ docs / main / stable / class / VoiceConnection?scrollTo = play

Are you using this method? https://discord.js.org/#/docs/main/stable/class/VoiceConnection?scrollTo=play

因为您没有提供任何代码...

As you didn't provide any code...

我遇到了同样的问题,那天我做了两件事,但我不知道哪个是解决问题的。

I had the same issue, that day i did two things, but i don't know which one was the fix.

  • Actaullay download FFMPEG http://ffmpeg.org/download.html - put executable (ffmpeg.exe) in project directory Don't download source code, download from Get packages & executable files for your OS
  • Update node.js to newest version https://nodejs.org/en/

我不确定它是哪个修复程序。但是现在它也可以在目录中没有该文件的情况下工作,所以我有点困惑

I'm not sure which one of the fixes it was. But now it also works without the file in directory, so I'm kinda confused

还尝试要求 ffmpeg-binaries 在js文件中

Also try requiring ffmpeg-binaries in the js file

这篇关于我收到此“错误:找不到FFmpeg / avconv!”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆