Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update reStream.sh #100

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 32 additions & 13 deletions reStream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,24 @@
# 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
output_path=- # display output through ffplay
format=- # automatic output format
webcam=false # not to a webcam
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
remarkable="10.11.99.1" # remarkable connected through USB
nicksen782 marked this conversation as resolved.
Show resolved Hide resolved
landscape=false # rotate 90 degrees to the right
nicksen782 marked this conversation as resolved.
Show resolved Hide resolved
output_path=- # display output through ffplay
format=- # automatic output format
webcam=false # not to a webcam
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=true # Establish a unsecure connection that is faster
nicksen782 marked this conversation as resolved.
Show resolved Hide resolved

# loop through arguments and process them
while [ $# -gt 0 ]; do
Expand Down Expand Up @@ -143,12 +150,24 @@ 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:"
pixel_format="gray8"
video_filters="$video_filters,transpose=2"

# Use updated video settings?
if [ $(ssh_cmd 'stat -c "%Y" /usr/bin/xochitl') -ge $rm2_old_xochitl_date ]; then
nicksen782 marked this conversation as resolved.
Show resolved Hide resolved
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
;;
*)
Expand Down