-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
feat: replace native ffmpeg with bundled wasm version #305
Conversation
🐋 🤖 A docker image for this PR has been built! docker pull freyrcli/freyrjs-git:pr-305
What's this?This docker image is a self-contained sandbox that includes all the patches made in this PR. Allowing others to easily use your patches without waiting for it to get merged and released officially. For more context, see https://github.com/miraclx/freyr-js#docker-development. |
Hello, may I ask what node version this uses, as well as how you are able to run the embedding queue without running into errors? Thanks! EDIT: That was what the new ffmpeg instances were used for, see the logs from the tests. |
Yeah, so I found out that The hack that worked was to remove that function from the global scope. So when Line 974 in c500eaf
Didn't run into any embedding errors. The only issue I see now is not being able to run one command at a time. I saw your approach to fix that was to load Because for a 100-track playlist, it would load the 8 MB WASM blob, allocate resources to assign context etc. 100 times. |
That was an extremely smart trick regarding the fetch api :) Then again, I believe that most computers running this will have enough RAM to run the 8 MB contexts. Maybe another trick would be to wipe MEMFS to help clear memory usage because running ffmpeg.exit() seems to make freyr exit with code 1 |
Resolved. Made it so that there's only By default, this is 6 concurrent processes. Spawned on demand and reused for more tracks, if need be. Can be less than the defined value, but never more than. |
Excellent idea, thanks for the ideas! |
This comment was marked as off-topic.
This comment was marked as off-topic.
Finally, found 6 hours to investigate the issue with this. 😪 |
Closes #294.
This patches #297 a bit to avoid depending on modified versions of
@ffmpeg/{core,ffmpeg}
.All credit to @hard-shutdown for investigating this.