muaz-khan / RecordRTC

RecordRTC is WebRTC JavaScript library for audio/video as well as screen activity recording. It supports Chrome, Firefox, Opera, Android, and Microsoft Edge. Platforms: Linux, Mac and Windows.
https://www.webrtc-experiment.com/RecordRTC/
MIT License
6.52k stars 1.75k forks source link

Chromium webm causes windows error: 0xc00d3e8c #720

Closed millzee01 closed 3 years ago

millzee01 commented 3 years ago

Hi,

If i use the following code to record a canvas animation:

        streamInput = parent.document.getElementById('whiteboard');
        stream = streamInput.captureStream();
        const recorder = RecordRTC(stream, {
             // audio, video, canvas, gif
            type: 'video',
            mimeType: 'video/webm',
            recorderType: MediaStreamRecorder,
            disableLogs: false,
            timeSlice: 1000,
            ondataavailable: function(blob) {},
            onTimeStamp: function(timestamp) {},
            bitsPerSecond: 3000000,
            frameInterval: 90,
            frameRate: 60,
            bitrate: 3000000,
        });
    recorder.stopRecording(function() {
            getSeekableBlob(recorder.getBlob(), function(seekableBlob) {
                url = URL.createObjectURL(recorder.getBlob());
                $("#exportedvideo").attr("src", url);
                $("#exportedvideo").attr("controls", true);
                $("#exportedvideo").attr("autoplay", true);
            })                                      
        });

The video plays fine and i can seek it in chrome/edge/firefox etc.

When i download the video using the following code:

getSeekableBlob(recorder.getBlob(), function(seekableBlob) {
        var file = new File([seekableBlob], "test.webm", {
            type: 'video/webm'
        });
        invokeSaveAsDialog(file, file.name);
}

The video downloads and plays fine, and the seekbar updates like normal.

If i then move the seekbar to any position, as soon as I move it I get a media player message: Can't play, Can't play because the item's file format isnt supported. Check store to see if this item is available here. 0xc00d3e8c

If i use firefox and download the file, it plays perfect and I can seek.

Do i need to do anything else to fix the Chromium webm?

i've been pulling my hair out all day trying to find a workaround.

i've tried using the following code to download the file:

            var file = new File([recorder.getBlob()], "test.webm", {
                type: 'video/webm'
            });
            invokeSaveAsDialog(file, file.name);

however, the file plays and i can move the seekbar but the video screen is black.

yet firefox works fine.

is there a step I am missing?