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.47k stars 1.75k forks source link

When I recorded large Video, Web Application Crashed #510

Open vgokul129 opened 5 years ago

vgokul129 commented 5 years ago

I have the following source code to record Video stream(Video constraints: width: 1920, height: 1080, frameRate: 60).

function startRecord(){
        recorder = RecordRTC(window.stream, {
            type: 'video',
            mimeType: 'video/webm;codecs=vp8',
            recorderType: MediaStreamRecorder,
        });

        recorder.startRecording();
}

function stopRecord(){
  recorder.stopRecording(function() {
     var blob = recorder.getBlob();
        getSeekableBlob(blob, function(seekableBlob){
        var fileName = 'video.webm';
        var file = new File([seekableBlob], fileName, {
            type: 'video/webm'
        });

         invokeSaveAsDialog(file);
            });

    });
}

When I try to record video for long time (Say 1/2 an hour) video my application crashed in a while after invoking stopRecording() method.

Note: For small Video records its working well.

Platform: Chromebook OS Version: 73.0.3683.88 (Official Build)

I found an exact similar issue when tried with MediaStream API. When the same code works good in Linux and Windows Chrome Browsers.

vgokul129 commented 5 years ago

@muaz-khan : Please look into this issue. I am struck with this so long. Any idea ?

flyfly6 commented 5 years ago

I've encounted the same problem and here is my solution:

Hope this helps

vctormb commented 5 years ago

@flyfly6 Is it possible to show some example on how to increase the maximum recording interval? I have cases that the user can record videos for about 3 hours+. Which size is great to put and how? Thanks!

tonai commented 2 years ago

@flyfly6 using timeslice and ondataavailable does not prevent the data to be stored inside local variable arrayOfBlobs. You just get them So in fact you should still have memory problems.

gnidustotalus commented 5 months ago

@muaz-khan Is there any way to empty the local arrayOfBlobs after each ondataavailable event?

tonai commented 5 months ago

There is an opened PR to fix this issue but not sure this repository is still very active.

gnidustotalus commented 5 months ago

image

The last commit was yesterday.

tonai commented 5 months ago

Yes after 2 years of inactivity