Use IDBFS and NODEFS to process big file
This commit is contained in:
@@ -38,8 +38,13 @@
|
||||
await worker.write(`tmp.${num}.png`, `../../tests/assets/triangle/tmp.${num}.png`);
|
||||
}
|
||||
message.innerHTML = 'Start transcoding';
|
||||
await worker.run('-framerate 30 -pattern_type glob -i *.png -i audio.ogg -c:a copy -shortest -c:v libx264 -pix_fmt yuv420p out.mp4');
|
||||
await worker.run('-framerate 30 -pattern_type glob -i /data/*.png -i /data/audio.ogg -c:a copy -shortest -c:v libx264 -pix_fmt yuv420p out.mp4', { outputPath: 'out.mp4' });
|
||||
const { data } = await worker.read('out.mp4');
|
||||
await worker.remove('audio.ogg');
|
||||
for (let i = 0; i < 60; i += 1) {
|
||||
const num = `00${i}`.slice(-3);
|
||||
await worker.remove(`tmp.${num}.png`);
|
||||
}
|
||||
|
||||
const video = document.getElementById('output-video');
|
||||
video.src = URL.createObjectURL(new Blob([data.buffer], { type: 'video/mp4' }));
|
||||
|
||||
Reference in New Issue
Block a user