Recording and livestreaming from Oculus Quest, with audio - Eric Cheng

Recording and livestreaming from Oculus Quest, with audio

Articles

Oculus Quest and Oculus Go have a screen recording feature built-in, but if you’re looking to livestream in realtime or to record with audio synchronization, you might find one of these options more useful. Also, you can use these methods to cast both video and audio to a display for use at parties and other gatherings.

Cast video to Chromecast, audio using Bluetooth

This method is hardware intensive, but it’s super flexible and allows for the streaming of synchronized video and audio from an Oculus Quest.

Hardware required:

This method does not require your Oculus Quest or Go to have developer mode turned on, and works with a standard headset. It’s also completely wireless—there are no cables to deal with. Output is decent, but video compression is evident; this is the direct trade off of going wireless using out-of-box streaming support.

Steps:

  1. Set up your Chromecast, and make sure it’s on the same wireless network as your Oculus
  2. Connect the Chromecast’s HDMI output to the input on the HDMI splitter (required—connecting Chromecast directly to the HDMI capture interface will not work)
  3. Connect the HDMI splitter’s output to your USB HDMI capture interface, and plug the USB capture interface into a USB 3.0 port on your computer
  4. Pair the Bluetooth Tx and Rx units. If you’re using the TaoTronics units I linked to above, set one of them to Tx mode, and the other to Rx mode. Place them close to each other, turn them on, and they should automatically pair.
  5. Plug the Bluetooth Rx unit into your computer’s 1/8” microphone input. In Windows, you’ll likely get a pop-up when you plug the device in, asking what it is. Select “Microphone.” If you don’t, you might have to open the Sound control panel and select the proper input.
  6. Enable casting to the Chromecast from your Oculus Quest or Oculus Go
  7. Run OBS and set up two inputs:
    1. Video input from USB HDMI capture device
    2. Audio input from computer’s microphone input
  8. Record / stream using OBS. Verify that sync is good. It should be, but if it’s not, you can dial in a manual delay in OBS.
  9. Here is a sample capture. Note that this capture also muxes in video and audio of me, in the room (using a webcam, external microphone, and additional OBS inputs)

If your goal is to stream to a display for use at parties, you can use the same hardware, but you’ll need a way to associate the HDMI video feed from Chromecast and the audio output from the Bluetooth Rx. Most receivers and some TVs should have a way to do this. Another option I will test soon is using an HDMI audio inserter, which in theory should mux the video signal from the Chromecast and the audio input from the Bluetooth Rx and let you send a single HDMI output to any TV or capture device.

Chromecast Ultra -> HDMI splitter -> Magewell USB Capture dongle -> computer
TaoTronics Bluetooth Tx connected to Oculus Quest, with second module for Rx

Capture video using ADB, audio using Bluetooth

If you know how to enable Developer Mode and use ADB, there is a higher-quality way of recording video from your Oculus device. There is a YouTube video that describes the method. You can use the Bluetooth interfaces linked above, for audio. Here’s an example I captured using this method.

Short cuts / things to try

Trigger onboard screenrecord at higher resolutions, using adb:

adb shell screenrecord --size 1920x1080 --bit-rate 12000000 /sdcard/video.mp4

Trigger local mirroring over adb

adb exec-out screenrecord \
--size 960x800 --output-format h264 - \
| vlc --file-caching=0 --live-caching=0 --disc-caching=0 --network-caching=0 \
--demux=h264 --h264-fps=72 \
--video-filter=adjust:croppadd --croppadd-cropright=530 --croppadd-croptop=200 --croppadd-cropbottom=200 --croppadd-cropleft=50 \
--gamma=1.4 --aspect-ratio=16:9 -

Use scrcpy, per the YouTube link above

This seems to be the highest quality way to capture (either over wireless, or wires):

Shortcut to assets used in the video:

clean left eye crop

scrcpy -c 1280:960:105:256

full left eye

scrcpy -c 1440:1536:0:0

both eyes, full

scrcpy -c 2880:1536:0:0

To grab video and dump to a file:

scrcpy -c 1280:960:105:256 --record recording.mp4

The recorded mp4 is AVC with wildly-swinging variable framerate, and video editors like Adobe Premiere Pro do not like it. For example, one of my captures reported variable framerates between 8.184 FPS And 192.175 FPS, with an average of 61.281 FPS.

Use ffmpeg to convert to a constant-framerate before trying to share or import into an editor. Here’s a command that will re-encode as h.264, 60fps, trimming the recorded file to start 5 seconds in, for 10 seconds of video duration (from second 5 to 15 of the video).

ffmpeg -i "recording.mp4" -ss 00:00:5 -t 00:00:10 -c:v libx264 -preset fast -crf 18 -r 60 -pix_fmt yuv420p -c:a copy -movflags faststart "output.mp4"