38 lines
661 B
Bash
Executable File
38 lines
661 B
Bash
Executable File
#!/bin/bash
|
|
|
|
adb tcpip 5555
|
|
sleep 1
|
|
adb connect 10.0.0.30:5555
|
|
read -p "Disconnect from USB and press Enter to continue"
|
|
|
|
set -e
|
|
trap 'kill 0' EXIT
|
|
|
|
screen_record() {
|
|
adb exec-out screenrecord \
|
|
--bit-rate=5m \
|
|
--output-format=h264 \
|
|
--size 1832x960 \
|
|
--time-limit=0 \
|
|
-
|
|
}
|
|
|
|
stream_play() {
|
|
ffplay \
|
|
-framerate 30 \
|
|
-fflags nobuffer+discardcorrupt\
|
|
-flags low_delay \
|
|
-framedrop \
|
|
-strict experimental \
|
|
-analyzeduration 100000 \
|
|
-probesize 32 \
|
|
-sync ext \
|
|
-vf "setpts=PTS-STARTPTS,crop=916:960:0:0" \
|
|
-
|
|
}
|
|
|
|
# uncomment for audio
|
|
scrcpy --no-video --audio-buffer=200 &
|
|
|
|
screen_record | stream_play
|