How to Make Mixed Reality VR Videos in Unity
Part 8: Final Output
Your scene should now be looking good. It’s time to get it ready for recording or streaming. We won’t do this in the Unity editor, as you want something full screen, and to drop the editor’s burden on performance. We’re going to build your project into a standalone application.
Building your Project
Go to File -> Build Settings to open up a new menu. If you haven’t yet done this for your current project, you’ll have to add the scene to the Scenes In Build section by clicking “Add Open Scenes.”
Hit Build and Run. You’ll get a prompt asking where you want to save your game. You’ll be able to run this application in the future without the editor, so remember where you put it. Hit Save, and wait for it to build your game. Once it’s done, it will open a new window. You should see your scene inside like before, and your ZED will start automatically.
Now, open OBS, which you can download and install here if you haven’t done so already. OBS is free software for capturing video inputs, processing them in real-time, and recording or streaming them. (If you prefer to use another program for capture, you may do so and skip the rest of this section.)
Click the plus sign under Sources. Click “Game Capture.”
Note: Choosing “Window Capture” can provide similar results, and the configuration process is basically identical. It’s less performant and won’t work if you want to make your game full-screen, but it’s more stable than Game Capture.
Name this new Source whatever you want and hit OK.
In the next screen, change the Mode to “Capture Specific Window.” This will create some new options. Change the Window setting to the name of your application. Disable Capture Cursor and press OK.
To capture your game’s audio, add another source and choose “Audio Output Capture.” Again, name it what you’d like. You’ll get another window like the one where you configured your Game Source, but with only one relevant option: Device. Choose the output device, like your speakers or VR headset headphones. Leaving it as “Default” may also work. Then hit OK.
Note: Your scene may have started with an audio output capture source when you created it. If so, double-click that one to check the settings instead.
If you want to record your voice, which is likely if you’re streaming, add an “Audio Input Capture” and choose the relevant microphone (usually your headset).
Back at the main window, you’ll see your game window displayed in the main screen with a red outline. If your window resolution matches the OBS canvas resolution, your game window should neatly fit the output window in OBS. If it doesn’t, you can click and drag the corners of the red box to scale it, and drag anywhere on the image to move it around.
Note: If you want to configure OBS’s output resolution, which we’ll summarize later, it’s a good idea to do that before you position the frame as it may change.
Another way to adjust the positioning and scale is to right-click anywhere on the scene and hover over Transform. You’ll have a number of options, like “Fit to Screen,” which can quickly fit it. You can fine-tune the settings by clicking on “Edit Transform,” which lets you move or scale the images pixel by pixel.
With your scene set up, you’re just about ready to go! The last step is to configure your Video and Output settings to match what you want. To get to the settings, find the Settings button on the lower right. It’ll open up this window:
As the proper configuration varies wildly depending on your intended final product, your target platform, your system and other factors, we’ll just skim over these.
- General: Preferences for OBS itself. Not related to the output.
- Stream: Some settings you’ll have to provide before the “Start Streaming” button on the main window will do anything. Setting it up is different depending on your platform, so you should seek out a different tutorial specific for that platform – many make use of OBS.
- Output: Quality and formatting sefttings for both streaming and recording, along with some miscellaneous settings. This is also where you set the path that recorded files are saved in. If you’re recording, note that the default recording format is .flv, which is less portable than other file formats like .mp4, so consider changing it before recording.
- Audio: Quality settings for your sound, along with optional hotkey settings if you want to quickly enable/disable an input device mid-stream (push-to-talk).
- Video: The resolution of the output. Note that the settings are separate for the Canvas (the preview window) and the actual output. Ideally, you should make these resolutions the same. But if you can’t, at least make sure they’re the same aspect ratio or else your output will get cropped and/or distorted.
- Hotkeys: Exactly what you’d expect.
- Advanced: Non-critical but useful functions (such as adding a delay to your stream) and settings for experts (like color formats).
And you’re done! Go back to the main window and hit “Start Streaming” or “Start Recording” to create awesome mixed reality content for the world.
We’d love to see what you create! Tell our MR developer evangelist Chris about any cool content you make, we’ll even help share it.