Files
scripts/quest-cast2.sh
T
2026-06-11 13:47:48 -04:00

44 lines
1.1 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# Enable ADB over TCP (run once usually)
adb tcpip 5555
sleep 1
adb connect 10.0.0.30:5555 || { echo "Connection failed - check IP/Wi-Fi"; exit 1; }
read -p "Disconnect USB now if desired, then press Enter..."
set -e
trap 'kill 0' EXIT INT TERM
stream_play() {
ffplay \
-fflags nobuffer+discardcorrupt+flush_packets \
-flags low_delay \
-framedrop \
-probesize 32 \
-analyzeduration 0 \
-sync ext \
-vf "setpts=PTS-STARTPTS" \
-
}
# Optional audio (low buffer, background)
# scrcpy --no-video --audio-buffer=80 --audio-bit-rate=128K &
echo "Starting low-latency Quest mirror (Wi-Fi). Ctrl+C to stop."
echo "Expect 150500 ms latency depending on network."
while true; do
echo "[$(date '+%H:%M:%S')] (Re)starting screenrecord segment..."
adb exec-out screenrecord \
--bit-rate=8M \
--output-format=h264 \
--size 1280x720 \
--time-limit 120 \
- | stream_play
# Small delay to let ffplay drain & avoid rapid respawn spam on error
sleep 0.5
done