ffmpeg.wasm
ffmpeg.wasm copied to clipboard
ffmpeg.exit() throws error form within and breaks its internals
Running ffmpeg.exit() breaks the ffmpeg instance.
All ffmpeg.run calls after ffmpeg.exit() would stall
with ffmpeg.isLoaded() left true, not able to ffmpeg.load().
To Reproduce Steps to reproduce the behavior:
- Run ffmpeg normally
- During execution, run ffmpeg.exit()
- Run the same ffmpeg instance again
- See the program stall
While executing ffmpeg.exit(), an error was thrown. Which is odd but tolerable.
After executing ffmpeg.exit(), the ffmpeg instance broke. Which is a Bug.
https://github.com/ffmpegwasm/ffmpeg.wasm/blob/2d6fae83888950f98483d0f7dfcde6745a34ac92/src/createFFmpeg.js#L176-L186
It seems the error thrown from https://github.com/ffmpegwasm/ffmpeg.wasm/blob/ea760ac892e943b0ee406ee1c7421d610c28dfae/src/createFFmpeg.js#L181 prevented the rest of the code be executed.
It turned out running ffmpeg.exit() during execution is not required to reproduce this issue.
Just ffmpeg.exit() and reuse the same instance.
Moving the Core.exit(1); to last line may solve this issue while retaining its bizarre throwing behavior.
But I think we need ffmpeg.exit() not throw any error
And related behavior be tested.
If the current behavior that the ffmpeg instance after exit would not be useable again is expected,
then it should be renamed to destroy
Any chance of merging this fix soon?
If I understand correctly I need to run exit to free up memory and atm running exit throws an error.
- remove node_moudules;
- modify your package.json file:
"dependencies": { "@ffmpeg/core": "^0.10.0", "@ffmpeg/ffmpeg": "git+ssh://[email protected]:xiaofei1996/ffmpeg.wasm.git", // better fork it into your repo ... }, - npm install
[email protected]:xiaofei1996/ffmpeg.wasm.git is my repo which i fix the bug on the top of #274