amishshah / prism-media

Easily transcode media using Node.js 🎶
https://amishshah.github.io/prism-media
Apache License 2.0
239 stars 53 forks source link

Calling some YT-Vids brings Error FFmpeg/avconv not found! #40

Closed ackhack closed 4 years ago

ackhack commented 4 years ago

Issue:

C:\Users\Chris\IdeaProjects\uwuBot\node_modules\ytdl-core-discord\node_modules\prism-media\src\core\FFmpeg.js:130
    throw new Error('FFmpeg/avconv not found!');
    ^

Error: FFmpeg/avconv not found!
    at Function.getInfo (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\ytdl-core-discord\node_modules\prism-media\src\core\FFmpeg.js:130:11)
    at Function.create (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\ytdl-core-discord\node_modules\prism-media\src\core\FFmpeg.js:143:38)
    at new FFmpeg (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\ytdl-core-discord\node_modules\prism-media\src\core\FFmpeg.js:44:27)
    at C:\Users\Chris\IdeaProjects\uwuBot\node_modules\ytdl-core-discord\index.js:35:24
    at C:\Users\Chris\IdeaProjects\uwuBot\node_modules\ytdl-core\lib\info.js:337:9
    at C:\Users\Chris\IdeaProjects\uwuBot\node_modules\ytdl-core\lib\info.js:220:11
    at checkDone (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\ytdl-core\lib\util.js:373:7)
    at SAXParser.parser.onend (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\ytdl-core\lib\info.js:262:26)
    at emit (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\sax\lib\sax.js:624:35)
    at end (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\sax\lib\sax.js:667:5)
    at SAXParser.write (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\sax\lib\sax.js:975:14)
    at SAXParser.close (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\sax\lib\sax.js:157:38)
    at PassThrough.emit (events.js:223:5)
    at endReadableNT (_stream_readable.js:1185:12)
    at processTicksAndRejections (internal/process/task_queues.js:81:21)

Using ytdl-core-discord, 'https://www.youtube.com/watch?v=8e16Cu5S660' will crash the DiscordBot. Could be more Videos but i only found this until now. 'https://www.youtube.com/watch?v=zQ4LiyFF8RU' for Example works fine.

Steps to reproduce:

Probably just install ytdl-core-discord and call ytdl(url) will crash with given Error

Further details:

ackhack commented 4 years ago

discord.js : 11.5.1 ffmpeg-binaries 3.2.2-3 ytdl-core-discord: 1.1.0

iCrawl commented 4 years ago

Use ffmpeg-static instead of ffmpeg-binaries

ackhack commented 4 years ago
(node:10264) UnhandledPromiseRejectionWarning: Error: FFMPEG not found
    at Function.selectFfmpegCommand (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\prism-media\src\transcoders\ffmpeg\Ffmpeg.js:46:13)
    at new FfmpegTranscoder (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\prism-media\src\transcoders\ffmpeg\Ffmpeg.js:7:37)
    at new MediaTranscoder (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\prism-media\src\transcoders\MediaTranscoder.js:10:19)
    at new Prism (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\prism-media\src\Prism.js:5:23)
    at new VoiceConnection (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\discord.js\src\client\voice\VoiceConnection.js:46:18)
    at C:\Users\Chris\IdeaProjects\uwuBot\node_modules\discord.js\src\client\voice\ClientVoiceManager.js:63:22
    at new Promise (<anonymous>)
    at ClientVoiceManager.joinChannel (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\discord.js\src\client\voice\ClientVoiceManager.js:45:12)
    at VoiceChannel.join (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\discord.js\src\structures\VoiceChannel.js:130:30)
    at join (C:\Users\Chris\IdeaProjects\uwuBot\Commands\Music.js:63:76)
    at play (C:\Users\Chris\IdeaProjects\uwuBot\Commands\Music.js:96:17)
    at Object.play (C:\Users\Chris\IdeaProjects\uwuBot\Commands\Music.js:13:9)
    at Object.play (C:\Users\Chris\IdeaProjects\uwuBot\Commands\play.js:6:15)
    at executeFunctionByName (C:\Users\Chris\IdeaProjects\uwuBot\botMain.js:60:26)
    at Client.<anonymous> (C:\Users\Chris\IdeaProjects\uwuBot\botMain.js:24:13)
    at Client.emit (events.js:223:5)
    at MessageCreateHandler.handle (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:105:65)
    at WebSocketConnection.onPacket (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
    at WebSocketConnection.onMessage (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
    at WebSocket.onMessage (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\ws\lib\event-target.js:120:16)
    at WebSocket.emit (events.js:223:5)
    at Receiver.receiverOnMessage (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\ws\lib\websocket.js:789:20)
    at Receiver.emit (events.js:223:5)
    at Receiver.dataMessage (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\ws\lib\receiver.js:422:14)
    at Receiver.getData (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\ws\lib\receiver.js:352:17)
    at Receiver.startLoop (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\ws\lib\receiver.js:138:22)
    at Receiver._write (C:\Users\Chris\IdeaProjects\uwuBot\node_modules\ws\lib\receiver.js:74:10)
(node:10264) 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(). (rejection id: 2)
(node:10264) [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.

Using the newest version of ffmpeg-static resulted in this error. I installed ffmpeg and ffmpeg-static and removed ffmpeg-binaries beforehand. "ffmpeg": "0.0.4", "ffmpeg-static": "^4.0.1",

ackhack commented 4 years ago

it wont crash the bot but the bot doesnt do anything

ackhack commented 4 years ago

ok installing ffmpeg-binaries@3.2.2-3 ffmpeg-static @discord.js/opus worked