Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion demo/vr/src/scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ export class Scene {
// Layout for the picture according to projection and stereo
layout(projection?: Projection, stereo?: string) {
this.#projection = projection;
this.#stereo = stereo && stereo in PACKING ? stereo : "mono";
// An unknown packing, inherited names like "constructor" included, plays as mono.
this.#stereo = stereo && Object.hasOwn(PACKING, stereo) ? stereo : "mono";
this.#build();
}

Expand Down
3 changes: 2 additions & 1 deletion doc/bin/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ desktop tab. It lays a broadcast out by the catalog's
[spatial fields](/concept/hang#catalog): an equirectangular `projection` wraps
the picture on a sphere spanning its field of view, `stereo` crops each eye
from a packed frame, and an `ambisonic` audio layout decodes the sound field
around the viewer's head. Without them it shows a flat screen with the sound
around the viewer's head, at first order: a higher order plays only its first
four channels. Without them it shows a flat screen with the sound
coming from it.

```bash
Expand Down
7 changes: 5 additions & 2 deletions quest/m1/vr-demo-try.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ moq.dev with a looping VR180 broadcast once it plays well in a headset
The harness (`just test vr`) proves the layout in headless Chromium on a
desktop view only; a headset's per-eye render, recentre, and HRTF audio have
had no human check. Run it with `just relay`, the `moq import fmp4` command in
`doc/bin/demo.md#vr`, and `just vr serve`, then open the page on the headset
(it needs a secure context, so serve it over HTTPS or tunnel to localhost).
`doc/bin/demo.md#vr`, and `just vr serve`, then open the page on the headset.
It needs a secure context, so serve it over HTTPS or tunnel it to the
headset's localhost, and make the relay reachable too: `localhost:4443` on the
headset is the headset itself, so forward that port as well or point the page
at the relay with `?url=`.

## Waiting

Expand Down
7 changes: 5 additions & 2 deletions test/vr/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ source "$DIR/../lib/harness.sh"
harness_begin vr 'just test vr'
cd "$WORKSPACE"
cargo build --locked -p moq-relay -p moq-cli
# Staged at once, so a clean elsewhere during the setup below cannot remove them.
harness_stage bin/moq-relay "$WORKSPACE/target/debug/moq-relay"
harness_stage bin/moq "$WORKSPACE/target/debug/moq"
uv run --no-project python sh/js/install.py frozen
(cd demo/vr && bunx vite build --outDir "$HARNESS_RUN/vr-dist" --emptyOutDir)

Expand All @@ -29,14 +32,14 @@ uv run --no-project python -I "$DIR/spherical.py" "$HARNESS_RUN/flat.mp4" "$HARN
harness_port relay
URL="http://127.0.0.1:$HARNESS_PORT"
sed "s/4443/$HARNESS_PORT/g" "$DIR/relay.toml" >"$HARNESS_RUN/relay.toml"
harness_spawn relay "$HARNESS_RUN/relay.log" "$WORKSPACE/target/debug/moq-relay" "$HARNESS_RUN/relay.toml"
harness_spawn relay "$HARNESS_RUN/relay.log" "$HARNESS_RUN/bin/moq-relay" "$HARNESS_RUN/relay.toml"
harness_ready "$URL/certificate.sha256" 30 "$HARNESS_PID"
# ffmpeg carries st3d and sv3d into each fragmented init segment only past -strict unofficial.
# shellcheck disable=SC2329 # invoked by harness_spawn
publish_vr() {
ffmpeg -hide_banner -loglevel error -re -stream_loop -1 -i "$HARNESS_RUN/vr180.mp4" -c copy -strict unofficial \
-movflags cmaf+frag_keyframe+empty_moov+default_base_moof -f mp4 - |
"$WORKSPACE/target/debug/moq" --connect "$URL" --connect-version moq-lite-07-wip --broadcast vr.hang import fmp4
"$HARNESS_RUN/bin/moq" --connect "$URL" --connect-version moq-lite-07-wip --broadcast vr.hang import fmp4
}
harness_spawn publisher "$HARNESS_RUN/publisher.log" publish_vr
cd test/interop/clients/js
Expand Down