Update reStream.sh

Can now detect if the Remarkable version is older than 2023-10-02. Versions ahead of this date use a different format for the video settings.
This commit is contained in:
Nickolas Andersen 2023-11-13 21:10:05 -05:00 committed by GitHub
parent 3862d9c5c8
commit ed20ef64df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,9 +3,16 @@
# Current reStream.sh version
version="1.2.0"
# video_filters links:
# https://ffmpeg.org/doxygen/trunk/pixfmt_8h_source.html
# https://ffmpeg.org/ffmpeg-filters.html#eq
# This date is used to determine video_filters. (1696246154 == 2023-10-02 11:29:14.927044663 +0000)
rm2_old_xochitl_date=1696246154
# default values for arguments
remarkable="${REMARKABLE_IP:-10.11.99.1}" # remarkable IP address
landscape=true # rotate 90 degrees to the right
remarkable="10.11.99.1" # remarkable connected through USB
landscape=false # rotate 90 degrees to the right
output_path=- # display output through ffplay
format=- # automatic output format
webcam=false # not to a webcam
@ -13,7 +20,7 @@ hflip=false # horizontal flip webcam
measure_throughput=false # measure how fast data is being transferred
window_title=reStream # stream window title is reStream
video_filters="" # list of ffmpeg filters to apply
unsecure_connection=false # Establish a unsecure connection that is faster
unsecure_connection=true # Establish a unsecure connection that is faster
# loop through arguments and process them
while [ $# -gt 0 ]; do
@ -143,13 +150,25 @@ case "$rm_version" in
fb_file="/dev/shm/swtfb.01"
pixel_format="rgb565le"
else
# Get the Remarkable software version before proceeding (File date of xochitl.)
width=1872
height=1404
bytes_per_pixel=1
fb_file=":mem:"
# Use updated video settings?
if [ $(ssh_cmd 'stat -c "%Y" /usr/bin/xochitl') -ge $rm2_old_xochitl_date ]; then
echo "Using the newer :mem: video settings."
bytes_per_pixel=2
pixel_format="gray16be"
video_filters="$video_filters eq=gamma=0.125:brightness=0.825,transpose=3"
# Use the previous video settings.
else
echo "Using the older :mem: video settings."
bytes_per_pixel=1
pixel_format="gray8"
video_filters="$video_filters,transpose=2"
fi
fi
;;
*)
echo "Unsupported reMarkable version: $rm_version."