microsoft / HoloLensForCV

Sample code and documentation for using the Microsoft HoloLens for Computer Vision research
MIT License
472 stars 156 forks source link

Changing default PV resolution in Recorder app #question #130

Closed aaman-git closed 4 years ago

aaman-git commented 4 years ago

Can anyone please guide me how to adjust the Recorder app to record PV frames at 1344x756 resolution instead of the default (1280x720)

Thank you in advance :)

emeraldy commented 4 years ago

hello, I think you can try to modify the MediaCaptureInitializationSettings object settings in the function at https://github.com/microsoft/HoloLensForCV/blob/fb8b24deb54d7579695eb68b14c662ddbe76027e/Shared/HoloLensForCV/MediaFrameSourceGroup.cpp#L590 and refer to this page https://docs.microsoft.com/en-us/uwp/api/windows.media.capture.mediacaptureinitializationsettings?view=winrt-18362 for the class. I think one of those media description properties is the one you are looking for.

aaman-git commented 4 years ago

found it!

the GetSubtypeForFrameReader method gets a subtype of supported formats and returns first result https://github.com/microsoft/HoloLensForCV/blob/fb8b24deb54d7579695eb68b14c662ddbe76027e/Shared/HoloLensForCV/MediaFrameSourceGroup.cpp#L507-L510

I changed line 510 to only return if the format width is 1344 (which is also supported)

return (format->VideoFormat->Width == 1344) ? Windows::Media::MediaProperties::MediaEncodingSubtypes::Bgra8 : nullptr;

Thanks for your help @emeraldy :)