riforik / Rikard-Discord-Bot

RikardDev's Discord Bot
MIT License
1 stars 0 forks source link

FFMPEG Not Found #2

Open riforik opened 4 years ago

riforik commented 4 years ago

FFMPEG Not Found

Ffmpeg can not be found on the system for possible reasons.

Notes

Potential Fixes:

  1. Simply is not installed on the remote server. Installing could mean manipulating the server's environment paths. (likely)
  2. Changing the package.json to include ffmpeg (not likely)

Error

(node:294283) UnhandledPromiseRejectionWarning: Error: FFMPEG not found
    at Function.selectFfmpegCommand (/home/isaiahro/RDB_test/node_modules/prism-media/src/transcoders/ffmpeg/Ffmpeg.js:46:13)
    at new FfmpegTranscoder (/home/isaiahro/RDB_test/node_modules/prism-media/src/transcoders/ffmpeg/Ffmpeg.js:7:37)
    at new MediaTranscoder (/home/isaiahro/RDB_test/node_modules/prism-media/src/transcoders/MediaTranscoder.js:10:19)
    at new Prism (/home/isaiahro/RDB_test/node_modules/prism-media/src/Prism.js:5:23)
    at new VoiceConnection (/home/isaiahro/RDB_test/node_modules/discord.js/src/client/voice/VoiceConnection.js:46:18)
    at Promise (/home/isaiahro/RDB_test/node_modules/discord.js/src/client/voice/ClientVoiceManager.js:63:22)
    at new Promise (<anonymous>)
    at ClientVoiceManager.joinChannel (/home/isaiahro/RDB_test/node_modules/discord.js/src/client/voice/ClientVoiceManager.js:45:12)
    at VoiceChannel.join (/home/isaiahro/RDB_test/node_modules/discord.js/src/structures/VoiceChannel.js:130:30)
    at Object.module.exports.run (/home/isaiahro/RDB_test/commands/play.js:22:39)
(node:294283) 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:294283) [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.
ghost commented 4 years ago

You need to actually install FFMPEG, the FFMPEG module on NPM simply exports a wrapper API for FFMPEG's command-line interface. You can download FFMPEG's binaries from the website or use a package manager (like apt on Ubuntu, brew on Mac or choco on Windows) which usually takes care of dropping the binaries into a directory that is present in the PATH.

riforik commented 4 years ago

You need to actually install FFMPEG, the FFMPEG module on NPM simply exports a wrapper API for FFMPEG's command-line interface. You can download FFMPEG's binaries from the website or use a package manager (like apt on Ubuntu, brew on Mac or choco on Windows) which usually takes care of dropping the binaries into a directory that is present in the PATH.

@chroventer thanks for the resolve, installing the binaries manually seems to be what I'll have to do. By using node installed on a web hosted server, I sadly can't even run npm i due to security limitations.

Error

Cloudlinux NodeJS Selector demands to store node modules for application in separate folder (virtual environment) pointed by symlink called "node_modules". That's why application should not contain folder/file with such name in application root

Other problems are caused by the choice of host but manually installing FFMPEG's binaries to the right directories seemingly would work. The problem here is on machines like Windows 10 OS builds you have to link the environment path as well before using ffmpeg in command line.

Other Problems

  • using the hosted server and configuring the bot through their node app environment page I come across the same errors when trying to run npm i in command line. The following error comes from the hosted node app

Error Expanded

 Traceback (most recent call last): File "/opt/alt/python27/lib/python2.7/site-packages/clselector/cl_selector.py", line 190, in run self.run_install_modules() File "/opt/alt/python27/lib/python2.7/site-packages/clselector/cl_selector.py", line 380, in run_install_modules skip_web_check=self._opts['--skip-web-check']) File "/opt/alt/python27/lib/python2.7/site-packages/clselector/selectorlib.py", line 671, in install_modules self._install_modules_for_stopped_app(user, app_root) File "/opt/alt/python27/lib/python2.7/site-packages/clselector/selectorlib.py", line 911, in _install_modules_for_stopped_app environment.extension_install(extension='-', cwd=cwd) File "/opt/alt/python27/lib/python2.7/site-packages/clselect/clselectnodejsuser/environments.py", line 124, in extension_install check_call(args=command, preexec_fn=self._demote(), cwd=cwd) File "/opt/alt/python27/lib/python2.7/site-packages/clselect/utils.py", line 91, in check_call check_output(*args, **kwargs) File "/opt/alt/python27/lib/python2.7/site-packages/clselect/utils.py", line 125, in check_output raise ClSelectExcept.ExternalProgramFailed(error or stderr or stdout) ExternalProgramFailed: Cloudlinux NodeJS Selector demands to store node modules for application in separate folder (virtual environment) pointed by symlink called "node_modules". That's why application should not contain folder/file with such name in application root 

The Problem

Simply is not installed on the remote server - riforik Cloudlinux NodeJS Selector demands to store node modules for application in separate folder (virtual environment) pointed by symlink called "node_modules". That's why application should not contain folder/file with such name in application root

The Solution

You need to actually install FFMPEG, the FFMPEG module on NPM simply exports a wrapper API for FFMPEG's command-line interface. - chroventer manually installing FFMPEG's binaries to the right directories seemingly would work - riforik

TL;DR

I'll be adding the FFMPEG binaries by hand to the server after finding out exactly where to place said files. The issue was clearly resolved best by chroventer