Closed miraclx closed 2 years ago
Actually, seems I mixed things up. ffmpeg.exit
was broken on v10
.
Forgive my misconstruction. It would appear that yarn
messed up the versions somehow. Perhaps because it thought minor versions bumps are safe to interchange.
I cleaned my workspace, and ensured all versions are on v11
, works as it should. Although v11
now requires calling .exit
to terminate the worker.
Thanks!
EDIT: disregard the original issue, read the second comment
> **Describe the bug** > Calling `ffmpeg.exit()` causes the node.js process to quit with exit code `1`. > > Tracked this down a bit, and it seems the final “default” logic on node.js is to call `process.exit` method (excerpt from the `ffmpeg-core.js`): > > ```js > function ja(a, b) { > throw b; > } > // ... > h = 'object' === typeof process && 'object' === typeof process.versions && 'string' === typeof process.versions.node; > // ... > if (h) { > // ... > ja = function (a) { > process.exit(a); > }; > // ... > } > function Cb(a, b) { > // ... > ja(a, new wa(a)); > // ... > } > // ... > f.exit = Cb; > ``` > > Looks like https://github.com/ffmpegwasm/ffmpeg.wasm-core/blob/1f3461d4162ea41dd714c5cae7fff08fda362ad8/wasm/src/pre.js should have patched this behaviour, and well enough on versions pre-v11, this was the case. > > But it seems `v11` doesn't apply this patch. Causing the node.js process to exit right after calling `ffmpeg.exit`. > > **To Reproduce** > Literally do anything after calling `ffmpeg.exit` on `>= v11` and see. > > **Research** > As seen in this side-by-side diff of `v10`->`v11`, the patch in https://github.com/ffmpegwasm/ffmpeg.wasm-core/blob/1f3461d4162ea41dd714c5cae7fff08fda362ad8/wasm/src/pre.js is not applied. > > ![CleanShot 2022-10-22 at 23 06 03@2x](https://user-images.githubusercontent.com/16881812/197358295-1099f8a3-bde0-41a1-a1d5-cbd99785a280.png)