Fix one second issue

This commit is contained in:
Jerome Wu 2023-07-27 00:14:48 +08:00
parent 7d499dd4ff
commit 198bf57467

View File

@ -161,7 +161,7 @@ function() {
await fetchFile('/video/video-15s.avi') await fetchFile('/video/video-15s.avi')
); );
// The exec should stop after 1 second. // The exec should stop after 1 second.
await ffmpeg.exec(['-i', 'input.avi', 'output.mp4'], 1); await ffmpeg.exec(['-i', 'input.avi', 'output.mp4'], 1000);
const data = await ffmpeg.readFile('output.mp4'); const data = await ffmpeg.readFile('output.mp4');
videoRef.current.src = videoRef.current.src =
URL.createObjectURL(new Blob([data.buffer], {type: 'video/mp4'})); URL.createObjectURL(new Blob([data.buffer], {type: 'video/mp4'}));