Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 3 tasks
robin840211 opened this issue Apr 18, 2024 · 3 comments
Open
1 of 3 tasks

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

robin840211 opened this issue Apr 18, 2024 · 3 comments
Labels

Comments

@robin840211
Copy link

robin840211 commented Apr 18, 2024

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:

  • Use System (or User - the same result) Environment Variable in "System" -> "Related Settings" -> "Advanced system settings" -> "Environment Variables...", instead of .env file, but still the same error.
    image

  • Cleared whole git clone and re-clone again from git here; same error

  • Cleared bot database and cache, then re-clone again also, to perform fresh run; same error

  • Upgraded ffmpeg (7.0 in current release) as I guess it's too old issue; same error

(note: upgrade ffmpeg will even worse when revert to muse 2.6.0, which will response 🚫 ope: Output format webm is not available or play a muted audio, but not an issue here, focus on muse versioning)

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

> [email protected] start
> npm run env:set-database-url -- tsx src/scripts/migrate-and-start.ts


> [email protected] 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:

  • Directly from the cloned repository
  • Inside a Docker container
  • Something else (please elaborate)

Versions

  • Muse: 2.6.0 -> 2.7.1
  • Docker: None
  • OS: Windows 8.1 x64
  • Node.js: v20.11.1 (with [email protected])
  • ffmpeg: 4.2.3-win64-static
@codetheweb
Copy link
Collaborator

Hmm, nothing changed around ffmpeg handling between versions (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
Copy link
Author

robin840211 commented Apr 19, 2024

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==

  • Tested even just 2.7.0, seems the issue still persist, though not sure what changed there.

  • Based on the error message FFmpeg/avconv not found, I searched online for a while and found that the issue can be solved by installing ffmpeg-static with the command npm i ffmpeg-static (which installed 5.2.0 automatically on my side). After this, each play command will make node_modules' ffmpeg to be called with some params, then call FFMPEG_PATH's ffmpeg to do stuff. Although still haven't figured out why directly call from ffmpeg won't work in 2.7.1 without that, at least it seems to be working now...except some issue.
    This way will accumulates a large number of ffmpeg processes, which is under node_modules. Each new ffmpeg process is generated and remains after each song is played, until muse is terminated, or one of these ffmpeg processes is killed which also causes muse to crash.
    image

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

@robin840211
Copy link
Author

robin840211 commented Jun 11, 2024

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

@robin840211 robin840211 changed the title ope: FFmpeg/avconv not found after upgrading from 2.6.0 to 2.7.1 ope: FFmpeg/avconv not found after upgrading from 2.6.0 to 2.7+ Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants