Why does RecordRTC always set my mime type to x-matroska

Viewed 680

Im trying to record a video from my webcam with the node package 'recordrtc' (im using angular).

Even though i set the mime type in the options to 'video/webm' it always seems to switch it back to 'x-matroska'...

Here is my code:

[...]

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);
    })
}

For some reason when i console log this blob, it says

> Blob {size: 149322, type: 'video/x-matroska;codecs=avc1'}

And when i log the base64 string of the video with 'this.recordRTC.getDataURL' it aswell starts with:

> data:video/x-matroska [...]

What am i doing wrong here?

1 Answers

Maybe you can try this

this.options = { 
    type: 'video',
    mimeType: 'video/webm\;codecs=vp9',
    recorderType: MediaStreamRecorder,
    bitsPerSecond: 51200000,
    frameRate: 60
}
Related