我正在尝试使用节点包'recordrtc‘(使用angular)从我的网络摄像头录制视频。
即使我在选项中将mime类型设置为'video/webm‘,它似乎总是将其切换回'x-matroska'...
下面是我的代码:
[...]
this.options = {
mimeType: 'video/webm',
bitsPerSecond: 51200000,
frameRate: 60
}
// After getting the Video Devices
this.recordRTC = RecordRTC(stream, this.options);
[...]
startRecording() {
this.recordRTC.startRecording();
}
stopRecording() {
this.recordRTC.stopRecording(this.processVideo.bind(this));
}
processVideo(videoWebMural) {
console.log(this.recordRTC.getBlob());
this.recordRTC.getDataURL((url) => {
console.log(url);
})
}出于某种原因,当我在控制台上记录这个blob时,它说
> Blob {size: 149322, type: 'video/x-matroska;codecs=avc1'}当我用'this.recordRTC.getDataURL‘记录视频的base64字符串时,它也是以:
> data:video/x-matroska [...]我在这里做错了什么?
发布于 2021-07-29 18:44:20
也许你可以试试这个
this.options = {
type: 'video',
mimeType: 'video/webm\;codecs=vp9',
recorderType: MediaStreamRecorder,
bitsPerSecond: 51200000,
frameRate: 60
}https://stackoverflow.com/questions/62342640
复制相似问题