2020-02-12 13:13:14 +01:00
|
|
|
#!/bin/sh
|
2020-03-02 09:34:16 +01:00
|
|
|
ssh_host="root@10.11.99.1"
|
2020-02-12 13:13:14 +01:00
|
|
|
landscape=true
|
|
|
|
|
|
|
|
width=1408
|
|
|
|
height=1872
|
|
|
|
bytes_per_pixel=2
|
2020-02-12 14:47:47 +01:00
|
|
|
loop_wait="true"
|
|
|
|
loglevel="info"
|
|
|
|
|
2020-02-12 13:13:14 +01:00
|
|
|
if ! ssh "$ssh_host" true; then
|
|
|
|
echo "$ssh_host unreachable"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-02-12 14:47:47 +01:00
|
|
|
# Gracefully degrade to gzip if zstd is not present
|
2020-03-02 09:34:16 +01:00
|
|
|
if which zstd && ssh "$ssh_host" "[ -f /opt/bin/zstd ]"; then
|
2020-02-12 14:47:47 +01:00
|
|
|
compress="/opt/bin/zstd"
|
|
|
|
decompress="zstd -d"
|
|
|
|
else
|
|
|
|
compress="gzip"
|
|
|
|
decompress="gzip -d"
|
|
|
|
fi
|
2020-02-12 13:13:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
window_bytes="$(($width*$height*$bytes_per_pixel))"
|
2020-02-24 09:30:12 +01:00
|
|
|
landscape_param="$($landscape && echo '-vf transpose=1')"
|
2020-02-12 14:47:47 +01:00
|
|
|
head_fb0="dd if=/dev/fb0 count=1 bs=$window_bytes 2>/dev/null"
|
|
|
|
read_loop="while $head_fb0; do $loop_wait; done | $compress"
|
|
|
|
|
|
|
|
set -e
|
2020-02-12 13:13:14 +01:00
|
|
|
|
|
|
|
ssh "$ssh_host" "$read_loop" \
|
2020-02-12 14:47:47 +01:00
|
|
|
| $decompress \
|
2020-02-12 13:13:14 +01:00
|
|
|
| ffplay -vcodec rawvideo \
|
2020-02-12 14:47:47 +01:00
|
|
|
-loglevel "$loglevel" \
|
2020-02-12 13:13:14 +01:00
|
|
|
-f rawvideo \
|
|
|
|
-pixel_format gray16le \
|
|
|
|
-video_size "$width,$height" \
|
|
|
|
$landscape_param \
|
|
|
|
-i -
|
2020-02-12 14:47:47 +01:00
|
|
|
|