I have the following code to stream connected Video Source in my Google Chrome Browser. getUserMedia of WebRTC does this. The following code snippet is to configure Resolution and frame Rate of my external camera device.
function configureVideo()
{
const video_constraints ={};
//Create the following keys for Constraint
video_constraints.video = {};
//set camera name
video_constraints.video.deviceId = {};
video_constraints.video.deviceId.exact = <device_id_comes_here>
//set resolution Width
video_constraints.video.width = {};
video_constraints.video.width.exact = 640;
//set resolution height
video_constraints.video.height = 480;
video_constraints.video.height.exact = streamHeight;
//set fps
video_constraints.video.frameRate = 60;
video_constraints.video.frameRate.exact = streamFps;
console.log("Selected Contraints is :", video_constraints);
navigator.mediaDevices.getUserMedia(video_constraints).then(streamCallback).catch(handleError);
}
And yes i was successfully able to stream the video from my external Camera device.The camera provides 2 types of Frame Format YUYV and BY8. But i truly don't have any idea what Frame Format is streaming currently.
Is there any method to configure my interested Video Frame Format in WebRTC.