FFmpegOut icon indicating copy to clipboard operation
FFmpegOut copied to clipboard

Issues with VR?

Open NITechLabs opened this issue 5 years ago • 2 comments

Hi, For internal scientific research (so no direct issues with licenses) I want to use your runtime option of the recorder. In a default project it works fine, but using VR (legacy XR because of using OpenVR with HTC Vive Pro) in 2019.4.1 with HDRP 7.4.1 the camera stops reacting to the headset. So there is an image, no errors, just the tracking stops. There is also no video saved in the project's root folder. Is this recording solution compatible with the legacy XR in Unity? If so, are there any special settings?

Cheers!

Marco

NITechLabs avatar Jul 01 '20 09:07 NITechLabs

I don't have any experience on VR, so I'm not sure what's happening in it, but I think you can't grab the main camera (headset) without interrupting VR things. It might be better to add a second camera and capture it, I'm not sure how it can be done with VR though.

keijiro avatar Jul 01 '20 09:07 keijiro

I think you can create a new GameObject with a Camera attached and put it under the main Camera.

        Transform camPar = Camera.main.transform;
        GameObject camGo = new GameObject("ScreenShotCamera");
        camGo.transform.parent = camPar;
        camGo.transform.localPosition = Vector3.zero;
        camGo.transform.localRotation = Quaternion.identity;

        screenshotCam = camGo.AddComponent<Camera>();
        screenshotCam.nearClipPlane = Camera.main.nearClipPlane;
        screenshotCam.farClipPlane = Camera.main.farClipPlane;
        screenshotCam.stereoTargetEye = StereoTargetEyeMask.None;
        screenshotCam.targetDisplay = 3;

        camGo.AddComponent<CameraCapture>();

eusebiu avatar Oct 02 '20 13:10 eusebiu