Commit d4b1fab2 authored by Jerome Wu's avatar Jerome Wu

Add time logging

parent 22920837
......@@ -13,6 +13,7 @@ Module.onRuntimeInitialized = () => {
Module.writeAsciiToMemory(s, buf);
Module.setValue(argsPtr + (Uint32Array.BYTES_PER_ELEMENT * idx), buf, 'i32');
});
console.time('execution time');
ffmpeg(args.length, argsPtr);
/*
......@@ -27,6 +28,8 @@ Module.onRuntimeInitialized = () => {
clearInterval(timer);
const output = Module.FS.readFile('flame.mp4');
fs.writeFileSync('flame.mp4', output);
console.timeEnd('execution time');
process.exit(1);
}
}
}, 500);
......
......@@ -46,6 +46,7 @@
Module.setValue(argsPtr + (Uint32Array.BYTES_PER_ELEMENT * idx), buf, 'i32');
});
message.innerHTML = 'Start to transcode';
console.time('execution time');
ffmpeg(args.length, argsPtr);
/*
......@@ -62,12 +63,13 @@
const out = Module.FS.readFile('out.mp4');
const video = document.getElementById('output-video');
video.src = URL.createObjectURL(new Blob([out.buffer], { type: 'video/mp4' }));
console.timeEnd('execution time');
}
}
}, 500);
};
document.getElementById('uploader').addEventListener('change', transcode);
</script>
<script type="text/javascript" src="./dist/ffmpeg-core.js"></script>
<script type="text/javascript" src="./dist-old/ffmpeg-core.js"></script>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment