Hi!
I see in the LocalVideoSource you can select to manually override certain properties. I have tried to manually set a lower resolution on the HoloLens side in the hopes it might improve the framerate on the PC receiving the frames (works perfectly the other way around, i.e. PC -> HL1). However, when I set it to manual and set a lower resolution, _it prevents it from sending anything at all_.
I saw something in the docs about how 'automatic' will override WebRTC defaults, but how does manual work with the HoloLens?
You have to specify a resolution and framerate that is supported by the device. You can get the available devices by calling
List<VideoCaptureDevice> captureDevices
= await PeerConnection.GetVideoCaptureDevicesAsync();
and then iterate over the available formats with
List<VideoCaptureFormat> formats
= await PeerConnection.GetVideoCaptureFormatsAsync(captureDevices[i].id);
You have to assign a resolution and framerate that is in the list of formats for your desired capture device.
Yes that would be my guess too that you provided a { resolution, framerate } couple not supported by the device.
Aha! I see, thanks very much. I implemented that and printed the (rather unique) HL camera configurations and just set the resolution (896 x 504) in the LocalVideoSource component with the Profile Kind set to 'Unspecified' and it appears to have retrieved the highest framerate possible for that resolution. I'm not sure where you are supposed to set the FPS, but this has worked to modify the resolution at least, thanks!
A suggestion would be that if a non-existent resolution/fps is set, have it drop back to either the nearest to defined, or a default one instead of not displaying at all.
Thanks @djee-ms and @eirikhollis!
@jmc-crash
See #86 for discussion regarding what should be done if a non-existent resolution/fps is set.
See #86 for a discussion about this. This is a design choice; this library is for developers, not for end-users like the Google implementation is when integrated inside Chromium. And developers can implement whatever selection and/or fallback mechanism they want this way. Using a default resolution means the developers cannot be sure that the format they selected is the one used, which for some applications would be an error and for some others wouldn't.
Closing as answered question if there's nothing more. Please feel free to reopen if there is still an issue.
Most helpful comment
You have to specify a resolution and framerate that is supported by the device. You can get the available devices by calling
and then iterate over the available formats with
You have to assign a resolution and framerate that is in the list of formats for your desired capture device.