RecordRTC: record in mp4 container instead of matroska

Viewed 1717

I'm using RecordRTC library to record screen and audio. I need h264 codec in mp4 container, but with my settings I get h264 codec in matroska container. I'm using the following code:

this.captureUserMedia(screenConstraints, function(screenStream) {
            that.captureUserMedia(audioConstraints, function(audioStream) {
                var arrOfStreams = [screenStream, audioStream];

                var options = {
                    type: 'video',
                    mimeType: 'video/webm\;codecs=h264', // or video/webm\;codecs=h264 or video/webm\;codecs=vp9
                    audioBitsPerSecond: 192000,
                    recorderType: MultiStreamRecorder,
                    video: {
                        width: desiredWidth,
                        height: desiredWidth / screenAspectRatio
                    }
                };

                that.recorder = RecordRTC(arrOfStreams, options);

                that.recorder.startRecording();

                that.btnStopRecording.onclick = function () {
                    console.log("recording stopped");
                    that.recorder.stopRecording(that.postFiles.bind(that));
                }
            });
        });
    }

Is it possible with RecordRTC library? Here is issue on project's github, but they recommend the options I have used. Is the only way to use ffmpeg to repackage from matroska to mp4?

0 Answers
Related