5

I have a timeline project in Unity 2018.2.10f1. I use the Unity Recorder to export 360° video. This is the settings:

enter image description here

But the output is not equirectangular and cannot be played as 360° video:

enter image description here

What is wrong and how to fix it? Thank you

2:1 video

enter image description here

Free camera settings

enter image description here enter image description here

Leos Literak
  • 8,805
  • 19
  • 81
  • 156

1 Answers1

3

Edit3:
Apparantly the issue is caused by the Physical camera setting on the camera component. Turning off Physical Camera will export equirectangular images/movies as expected.

The information below is still relevant, but not the exact solution to this particulair problem.


Your settings do not export an equirectangular image right now but a square image. Equirectangular images require to have an aspect ratio of 2:1. Whereas your current aspect ratio is 1:1.

In the Unity recorder settings you have set "360 view output" to 2048x2048. Resulting in the square image you're seeing. Try setting this to 4096x2048. This will produce a 4k image with an aspect ratio of 2:1, which should work for equirectangular projection.

See this page for more information about how equirectangular projection works. (emphasis mine)

Scanning cameras sometimes cover more than one 360° turn but software often assumes that equirectangular images cover 360° horizontally and 180° vertically, i.e. make sure that your equirectangular image has a proper aspect ratio of 2:1.


Edit:
Looking at the 2:1 picture it seems that Unity your records a cubemap, and not an equirectangular image. You may need to convert the cubemap to equirectangular using RenderTexture.ConvertToEquirect from the docs:

if (renderStereo)
{
    cubemap.ConvertToEquirect(equirect, Camera.MonoOrStereoscopicEye.Left);
    cubemap2.ConvertToEquirect(equirect, Camera.MonoOrStereoscopicEye.Right);
}

Take a look at this Unity bog which goes into further detail on how unity uses cubemaps/equirectangular projection From the blog:

After stereo cubemaps are generated, we can convert these cubemaps to stereo equirectangular maps which is a projection format used by 360 video players [...] To convert cubemaps to stereo equirectangular maps, call RenderTexture.ConvertToEquirect()

The "Cube map" width parameter on the Recorder may need to be tweaked for the desired result. But not sure which value would work best.

Edit2:
I created a test project (on GitHub here). However I have do not get the same output as you, despite (seemingly) having the same settings. My output looks like a perfectly fine equirectangular image (Without needing to do any conversion as I thought may be required as explained in my first edit).

My settings: Settings of the Unity Recorder

The output: 360 equirectangular output image

Remy
  • 4,843
  • 5
  • 30
  • 60
  • Thanks, I thought it must have been some silly issue. – Leos Literak Dec 11 '19 at 10:42
  • The video is twice wider now but it looks the same. When I look at it in 360 degrees projection it seems to have box view (orthogonal sides). – Leos Literak Dec 11 '19 at 10:58
  • Could you please tell me how to use this script? Shall I append it to some object? It seems to use some textures. What parameters shall they have? The best would be a sample project I could import and analyze. Thanks! – Leos Literak Dec 11 '19 at 16:04
  • Thanks in advance! I appreciate it. – Leos Literak Dec 11 '19 at 16:11
  • @LeosLiterak I have updated my answer with a link to a GitHub repo containing a demo scene. For some reason I do not get the cubemap-like export you seem to be getting... I have also included a screenshot of my settings. The only other thing I can think of that *could* make a difference are camera settings. Could you post a picture of the Camera component in the editor of the camera you are targeting for your Capture (Or compare your camera to the one in my demo scene)? – Remy Dec 11 '19 at 19:07
  • Thank you. I have downloaded the latest Unity and run successfuly your project and I got the correct 360 video from it. Then I upgraded my project, fixed cubemap to 2048 pixels but the result was the same like before. I have attached my hierarchy and main camera settings. It is weird. – Leos Literak Dec 12 '19 at 18:55
  • @LeosLiterak Alright cool. I have applied your camera settings to my demo scene, and that causes my export to look like yours. So it is definitely one of the camera settings causing the problems! Can you try placing a default camera (or resetting your camera component) in your scene to see if that fixes your problems? EDIT: it appears to be caused by "physical camera" simply turning that off fixes the exports! – Remy Dec 12 '19 at 19:12
  • Thank you very much. I will try on Saturday. I am heading to Bushra trip now. – Leos Literak Dec 12 '19 at 20:40