Recently our client asked us if can we detect if the camera used by examinee during the exam is fake camera or real live camera. One of their examinee had most possibly used manycam or may be a fake media which can be done by passing a flag to Chrome -use-fake-ui-for-media-stream.

# On macOS

/Applications/Google\\ Chrome --use-fake-device-for-media-stream --use-file-for-fake-video-capture=/Users/anil/Movies/movie.mjpeg

Client didn't want to candidates to fake the camera. They needed this check as they are into online examinations domain. They want to end their exam if someone does it.

After some research, we found out that media stream's track has a field named label, so after getUserMedia success, you can access label from the track as

 function getUserMediaSuccess(stream) {
   console.log("Camera Name::", stream.getVideoTracks()[0].label);

This is how fake media would get printed

This is how real camera would get

As per Philipp Hancke, a WebRTC expert, this solution is not as reliable or reommended to conclude that it's a fake camera.

For the time being, client is using this to end the exams if student tries to use any fake camera or fake media.