-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
const videoDecoderConfig = await demuxer.getDecoderConfig('video');
const decoder = new VideoDecoder({
output: frame => {
console.log('format', frame);
ctx.clearRect(0, 0, canvas.width, canvas.height);
const scale = Math.min(canvas.width / frame.displayWidth, canvas.height / frame.displayHeight);
ctx.drawImage(frame, 0, 0, frame.displayWidth * scale, frame.displayHeight * scale);
frame.close();
},
error: e => {
console.error('video decoder error:', e);
},
});
decoder.configure(videoDecoderConfig);
const videoEncodedChunk = await demuxer.seek('video', 1);
decoder.decode(videoEncodedChunk);
decoder.flush();上面的代码绘制的画面是黑色的,官方提供的Seek Video Frame 案例也是一样的
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels