RecordRTC icon indicating copy to clipboard operation
RecordRTC copied to clipboard

record media local+ remote

Open ghost opened this issue 7 years ago • 6 comments

Is it possible to record both remote and local video+audio at a time to node js folder

ghost avatar May 10 '18 03:05 ghost

var recorder = RecordRTC([localStream], {
    type: 'video'
});

recorder.startRecording();

// now call "appendRemoteVideo" whenever you have remote video
function appendRemoteVideo(stream) {
    recorder.getInternalRecorder().addStreams([stream]);
}

First Step

Pass array of streams to RecordRTC. E.g.

var recorder = RecordRTC([localStream], {
    type: 'video'
});

Second & Last Step

Call getInternalRecorder method to access MultiStreamRecorder which has addStreams method:

peer.onaddstream = function(event) {
     recorder.getInternalRecorder().addStreams([event.stream]);
};

muaz-khan avatar May 11 '18 14:05 muaz-khan

image recorder.getInternalRecorder() don't have the property 'addStreams' image

huhaibing avatar May 15 '18 15:05 huhaibing

Just came across the same issue while using MRecordRTC, I used: recorder.videoRecorder.getInternalRecorder().addStreams([stream]); I don't know if it's the same for RecordRTC

giorgioma avatar Sep 12 '18 15:09 giorgioma

For RecordRTC

recorder.getInternalRecorder().addStreams([stream]);

For MRecordRTC

recorder.videoRecorder.getInternalRecorder().addStreams([stream]);

muaz-khan avatar Sep 14 '18 06:09 muaz-khan

Hi, I am using MRecordRTC and I can't add more streams, I need some help, please

controller.onLocalStream = function (stream){
recorder = new MRecordRTC();
recorder.mediaType = {
      audio: true, // or StereoAudioRecorder
      video: true, // or WhammyRecorder
};
recorder.mimeType = {
      audio: 'audio/wav',
      video: 'video/webm',
};
// This works
recorder.addStream(stream);

recorder.startRecording();

// This not works, Error recorder.videoRecorder.getInternalRecorder().addStreams is not a function (yes, I know I am adding the same stream one more time, it's just a test)
recorder.videoRecorder.getInternalRecorder().addStreams([stream]);
}

If I "console.log" my recorder.videoRecorder.getInternalRecorder() object, I get:

MediaStreamRecorder blob: null clearRecordedData: ƒ () getAllStates: ƒ () getArrayOfBlobs: ƒ () getInternalRecorder: ƒ () getState: ƒ () name: "MediaStreamRecorder" pause: ƒ () record: ƒ () resume: ƒ () stop: ƒ (callback) timestamps: [] toString: ƒ () proto: Object

Thanks for any help

lcavero avatar Oct 15 '18 14:10 lcavero

Use RecordRTC function MultiStreamRecorder, this will be work.

let options = {

mimeType: 'video/mp4', }; let arrayOfStreams = [this.localStream.data, this.remoteStream.data]; this.recorder = new RecordRTC.MultiStreamRecorder(arrayOfStreams, options); this.recorder.record();

rahimmashkraft avatar Sep 19 '23 14:09 rahimmashkraft