codetheweb / muse

🎧 a self-hosted midwestern Discord music bot that doesn't suck
MIT License
799 stars 201 forks source link

ope: FFmpeg/avconv not found after upgrading from 2.6.0 to 2.7+ #1020

Open robin840211 opened 2 months ago

robin840211 commented 2 months ago

What's happening? Firstly many thanks for this bot that it's a really great bot I'm currently using. But there's some problem that I can only use old version now, and not sure why. I'm first use this since 2.5.0, and even 2.6.0 works like a charm; but after tried updating from 2.6.0 to 2.7.1, FFMPEG_PATH broke with unknown reason, and revert to 2.6.0 works, detailed below.

Currently I have add extra environment variable in .env file to prevent Windows not find FFMPEG issue: FFMPEG_PATH=D:/ffmpeg/bin/ffmpeg.exe

And it works normally when in 2.6.0, but after upgrade to 2.7.1, then tried npm i and npm run start, all looks fine, but got response 🚫 ope: FFmpeg/avconv not found! in Discord channel when trying to play something, and seems no error appear in console (or will log appear in somewhere that I've not noticed?) image image

Since that, I've tried stuffs below, but all of them does not work:

So I finally revert to muse 2.6.0 with ffmpeg 4.2.3, with .env's (or System/User Environment Variable's) FFMPEG_PATH, all works very well whether fresh or downgrade. image

Can't figure out why cause this happen, but might be something broken in nodes lib or else...? I like this great bot project, just wanna know if can be solved or not. though won't affect if using old version. Many thanks.

Logs

npm run start

> muse@2.7.1 start
> npm run env:set-database-url -- tsx src/scripts/migrate-and-start.ts

> muse@2.7.1 env:set-database-url
> tsx src/scripts/run-with-database-url.ts tsx src/scripts/migrate-and-start.ts

(node:14500) ExperimentalWarning: `--experimental-loader` may be removed in the
future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import {
pathToFileURL } from "node:url"; register("file%3A///D%3A/GitProject/muse/node_m
odules/tsx/dist/loader.js", pathToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)
(node:15824) ExperimentalWarning: `--experimental-loader` may be removed in the
future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import {
pathToFileURL } from "node:url"; register("file%3A///D%3A/GitProject/muse/node_m
odules/tsx/dist/loader.js", pathToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)
========================================
========================================
================= muse =================
========================================
=========== Made with 🎶 by ============
==== https://github.com/codetheweb =====
========================================
========================================

Running version 2.7.1 built on unknown date (commit unknown)

🔧 Need help? https://github.com/codetheweb/muse/discussions/new
🐛 Bug? https://github.com/codetheweb/muse/issues/new
✨ New feature? https://github.com/codetheweb/muse/issues/new
☕ Discussion? https://github.com/codetheweb/muse/discussions/new
💰 Help me? https://www.paypal.me/codetheweb https://github.com/sponsors/codethe
web

√ Database migrations applied.
√ Ready! Invite the bot with *link hide here*

Runtime I'm running Muse:

Versions

codetheweb commented 2 months ago

Hmm, nothing changed around ffmpeg handling between versions (https://github.com/codetheweb/muse/compare/v2.6.0...v2.7.1) so I'm not sure what's going on.

It sounds like setting the FFMPEG_PATH variable should work with the most recent version though?

robin840211 commented 2 months ago

Saw that handling part changes nothing also...

About FFMPEG_PATH, currently find that FFMPEG_PATH actually works in muse 2.7.1, which ffmpeg does actually called and appeared in task manager when called by user command, just can't play as error message shows. Did a small try using Process Explorer to copy-paste whole commands to directly run from ffmpeg, such like: D:/ffmpeg/bin/ffmpeg.exe -reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5 -to 241 -i https://the-really-long.video.url.here -acodec libopus -vn -f webm -filter:a volume=-6.04dB pipe:1 or D:/ffmpeg/bin/ffmpeg.exe -ss 5 -to 241 -i D:\GitProject\muse\data\cache\cache_name_with_long_number_and_alphabat -acodec libopus -vn -f webm -filter:a volume=1 pipe:1

All works fine in ffmpeg side, and the command from muse 2.6.0 / 2.7.1 passed to ffmpeg are the same, so... may it just the muse can't play the streams returned from ffmpeg with some reason, and cause it says FFmpeg/avconv not found...?

==Other tests==

These are what I found now, hope something can be helpful there.

robin840211 commented 1 month ago

New update though nothing new, since my small server got php's CVE-2024 hacked these days so dropped old system...lol Updated to 2.8.1, issue persist with same result/situation even fresh install from git on new pc...might be nodejs issue or lib? Environments changed just OS from Win8.1 to Win10, nodejs also updated to 20.14.0 but results the same...

Might test in free weekends recently otz