I'm trying to record the remote video stream in a WebRTC call. I think the main problem is that I can't use codecs to compress the recorded video.
I've tried this code
let options = {mimeType: 'video/mp4;codecs=vp9'};
if (!MediaRecorder.isTypeSupported(options.mimeType)) {
console.error(`${options.mimeType} is not Supported`);
options = {mimeType: 'video/mp4;codecs=vp8'};
if (!MediaRecorder.isTypeSupported(options.mimeType)) {
console.error(`${options.mimeType} is not Supported`);
options = {mimeType: 'video/mp4'};
if (!MediaRecorder.isTypeSupported(options.mimeType)) {
console.error(`${options.mimeType} is not Supported`);
options = {mimeType: ''};
}
}
}
In the snippet above I'm trying .mp4 type but codecs are rejected. Same happens if I try other codecs like h.264 instead of vp9.
The only file type that is accepted is .webm with vp9 encoding but its size is too big.
Code is based on this source