Created
December 26, 2020 21:35
-
-
Save JackDesBwa/a4ae355d32695e2f9b5570a694919ab2 to your computer and use it in GitHub Desktop.
Stream Oculus Quest to sView via adb (start with USB and setup TCP)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$1" == "" ] | |
then | |
# Check devices to avoid error in next commands | |
NB_DEVICES=$(adb devices -l | grep model:Quest_2 | wc -l) | |
if [ $NB_DEVICES == 0 ] | |
then | |
echo "Device not found" | |
exit | |
fi | |
if [ $NB_DEVICES -gt 1 -a "$ANDROID_SERIAL" == "" ] | |
then | |
echo "Several devices found, please define \$ANDROID_SERIAL" | |
exit | |
fi | |
# Get IP of the device | |
DEVICE_IP=$(adb exec-out ip route | cut -d ' ' -f 9) | |
DEVICE_PORT=5555 | |
if [ "$DEVICE_IP" == "" ] | |
then | |
echo "IP not found" | |
exit | |
fi | |
echo "IP found: $DEVICE_IP" | |
# Change to TCP debug link | |
adb tcpip $DEVICE_PORT | |
adb connect $DEVICE_IP:$DEVICE_PORT | |
else | |
DEVICE_IP=$1 | |
[ "$2" == "" ] && DEVICE_PORT=5555 || DEVICE_PORT=$2 | |
fi | |
# Get stream | |
adb -s "$DEVICE_IP:$DEVICE_PORT" exec-out "while true; do screenrecord --bit-rate=16m --output-format=h264 --time-limit 10 --size 2060x1080 -; done" | sView /dev/stdin --in=video --monitorId=1 --srcFormat=parallelpair --fullscreen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment