Enable log output and remove video file from wasm mem after transcode

This commit is contained in:
Jerome Wu
2019-10-30 16:21:21 +08:00
parent ff4ae62146
commit 1e558c3a36
4 changed files with 8 additions and 14 deletions

View File

@@ -1,6 +1,4 @@
module.exports = [
'./ffmpeg', // args[0] is always binary path
'-nostdin', // Disable interaction mode
'-loglevel',
'quiet',
];

View File

@@ -52,7 +52,10 @@ const transcode = ({
const args = [...defaultArgs, ...`${options} -i file:${iPath} ${oPath}`.trim().split(' ')];
Module.FS.writeFile(iPath, data);
ffmpeg(args.length, strList2ptr(args));
res.resolve(Module.FS.readFile(oPath));
const out = Module.FS.readFile(oPath);
Module.FS.unlink(iPath);
Module.FS.unlink(oPath);
res.resolve(out);
};
exports.dispatchHandlers = (packet, send) => {