In chrome browser, I am using MacBook to record a 30 minutes class, in code, use getDisplayMedia to get the screen stream:
navigator.mediaDevices.getDisplayMedia({audio:true,video:true}).then((mediaStream)=>{
mediaRecorder = new MediaRecorder(mediaStream,{mineType:'video/webm'})
})
2.When the recording started 5 minutes later, I connected an external microphone to the MacBook, then lectured through the microphone, and then hoped that my voice would be recorded through the microphone, but the strange thing is that since the microphone is connected, there is no recording screen behind The sound is down, what’s the matter, how can I operate so that I can continue recording when switching microphones?
Related
My question is similar to this
In my web-app, I call replaceTrack() to switch between webcam and screen share content. Everything works fine till replaceTrack() isn't called but when its called some camera reference is still there due to which even after stopping the medaistreams the webcam led is still on. It seems the localstream is still on but no luck even after manually stopping it
I have two or more cameras connected to my pc. My goal is, to switch between the local cameras in an ongoing webrtc videoconference - but only to switch video from camera 1 to camera 2 NOT audio. Audio should always come from camera 1.
How to toggle between the two videoTracks?
See this answer.
Basically you can use replaceTrack() in Firefox to do this today for a seamless replacement of a camera. This is being added to the spec, but Chrome doesn't support it yet.
The best you can do in Chrome today is to get a new stream with the same mic but a different camera, remove the old stream/tracks from the PeerConnection and add the new one, and then handle onnegotiationneeded and renegotiate. This will likely cause a glitch, and will require at least a couple of round-trip-times to complete. (This will work in Firefox as well.
Currently, the video mute functionality in webrtc is achieved by setting the enabled property of a video track to false
stream.getVideoTracks().forEach(function (track) {
track.enabled = false;
});
But the above code would not only mute the outgoing video, but the local self-view which is rendered using that local stream, also gets black frames.
Is there a way, to ONLY mute the outgoing video frames, but still be able to show a local self-view?
There's no easy way yet. Once MediaStreamTrack.clone() is supported by browsers, you could clone the video track to get a second instance of it with a separately controllable mute property, and send one track to your self-view and the other to the peerConnection. This would let you turn off video locally and remotely independently.
Today, the only workarounds I know of would be to call getUserMedia twice on Chrome (should work on https at least, where permissions will be persisted so the user won't be prompted twice) which would get you two tracks you could video-mute independently, or on Firefox you could use RTCRtpSender.replaceTrack() with a second "fake" video stream from getUserMedia using the non-standard { video: true, fake: true } constraint like this.
I have successfully got a live video window from a Creative VF0350 webcam.
However if I remove the webcam and plug in a Hauppauge WinTv usb 7, the Creative webcam still shows up as a capture device, even after a reboot. No sign of the WinTv device either.
I'm calling capGetDriverDescriptionA to get a list of capture devices (in the avicap32.dll).
Is this a wintv driver problem?
I have tried to check activity, fps, status. nothing is triggered when an active camera is unplugged in as3/air. Has anyone found a working way? In my case i have a kiosk running air 2.7 running two webcams. In some cases a usb webcam might be unplugged and plugged back in. I have been trying find a way to detect when its unplugged so I can restart it. Ideas?
Unfortunately i have no USB camera to test this with (only got insight).
You could try ActivityEvent and set motionlevel to some low value.
ActivityEvent will give you response if and when motion is detected in camera. I belive when Camera is physically disconnected, activity event should trigger since no activity will be detected.
Here's a piece of example:
import flash.media.Camera;
import flash.display.Stage;
import flash.media.Video;
import flash.events.ActivityEvent;
import flash.events.StatusEvent;
var camera:Camera = Camera.getCamera();
camera.setMode(stage.stageWidth, stage.stageHeight,25);
camera.addEventListener(ActivityEvent.ACTIVITY, activityEventHandler,false,0,true);
camera.setMotionLevel(3);
var video:Video = new Video();
video.width = stage.stageWidth;
video.height = stage.stageHeight;
video.attachCamera(camera);
addChild(video);
function activityEventHandler(a:ActivityEvent):void{
trace('Motion detected: '+a.activating);
}
Note:
setMotionlevel default value is 50 so if you set it to eg. 3 then camera still notices some small changes, even eye-blinking. That would help you to detect if there is any kind of motion at all. If no motion is detected then camera is probably dead.
You maybe even can use motionlevel as 1, but this value is very sensitive and even slightest change in room lightning is probably detected as motion.
Let me know if that helps, would be interesting to hear about this in practice with real USB camera.