Merge pull request #104 from ad-m/patch-1

Use promises to writeFile in README
This commit is contained in:
jeromewu 2020-11-05 08:49:21 +08:00 committed by GitHub
commit 8e51e9099e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,7 +66,7 @@ const ffmpeg = createFFmpeg({ log: true });
await ffmpeg.load(); await ffmpeg.load();
ffmpeg.FS('writeFile', 'test.avi', await fetchFile('./test.avi')); ffmpeg.FS('writeFile', 'test.avi', await fetchFile('./test.avi'));
await ffmpeg.run('-i', 'test.avi', 'test.mp4'); await ffmpeg.run('-i', 'test.avi', 'test.mp4');
fs.writeFileSync('./test.mp4', ffmpeg.FS('readFile', 'test.mp4')); await fs.promises.writeFile('./test.mp4', ffmpeg.FS('readFile', 'test.mp4'));
process.exit(0); process.exit(0);
})(); })();
``` ```