Basic example of streaming video from a stereoscopic camera to Meta Quest using LiveKit.
Important
This repository contains large files stored with Git LFS; ensure Git LFS is installed on your system prior to cloning the repository.
This repository includes a minimal stereo viewer application for Meta Quest built with the Spatial SDK. To get started:
- Open project root in Android Studio (LiveKitStereoViewer/)
- Set
LK_SERVER
andLK_TOKEN
in ImmersiveActivity.kt. - Build and run on device
When run, a viewer panel will appear in the immersive environment. Once a stereoscopic video track is published by a remote participant, it will be displayed on the panel. See the following section for setting up ingress to get a video to display.
Currently, the viewer expects to receive a side-by-side video stream with a resolution of 3840x1080 (1920x1080 per eye)—this example will be updated in the future to demonstrate dynamic configuration and additional formats.
LiveKit supports ingestion of external live streams using Ingress. Please refer to the Rover Teleop demo for a concrete example of ingesting live camera input.
For testing purposes, you can ingest a stereoscopic video from a static file instead of from a live camera feed. With the LiveKit CLI installed on your system, run the following command:
export LIVEKIT_URL=<your LiveKit server URL>
export LIVEKIT_API_KEY=<your API Key>
export LIVEKIT_API_SECRET=<your API Secret>
lk room join --publish h264://drive.google.com/uc?id=1ENQQrTUcCqcP5xrDz6PjRwfq-_qHLetx stereo-demo
If using your own file, please note:
- It will need to be hosted publicly on an HTTP server (see below).
- If it is encoded with VP8 instead of h264, use the
vp8://
scheme instead.
The video file needs to be served from an HTTP server with the proper MIME type set in order for ingress to work. For quick testing, the file can be hosted on Google Drive using this procedure:
- Upload video to Google Drive
- Share the video, set access to "Anyone with link". Copy the share URL
- The share URL will have the following format:
https://drive.google.com/file/d/<id>/view?usp=sharing
. Using the file's ID, rewrite the URL as follows:https://drive.google.com/uc?id=<id>
for direct access.