Skip to content

Commit

Permalink
skip compression if lz4 not installed on tablet #12
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudsftp committed Jul 23, 2023
1 parent 0410015 commit abf37fa
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions reSnap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,25 +145,27 @@ else

fi

# don't remove, related to this pr
# https://github.com/cloudsftp/reSnap/pull/6
FFMPEG_ABS="$(command -v ffmpeg)"
LZ4_ABS="$(command -v lz4)"
decompress="${LZ4_ABS} -d"

# compression commands
if ssh_cmd "[ -f /opt/bin/lz4 ]"; then
compress="/opt/bin/lz4"
elif ssh_cmd "[ -f ~/lz4 ]"; then # backwards compatibility
compress="\$HOME/lz4"
else
echo "lz4 not found on $rm_version. Please refer to the README"
exit 2
echo "WARNING: lz4 not found on $rm_version. Please refer to the README"
compress="tee"
decompress="tee"
fi

# don't remove, related to this pr
# https://github.com/cloudsftp/reSnap/pull/6
FFMPEG_ABS="$(command -v ffmpeg)"
LZ4_ABS="$(command -v lz4)"

# read and compress the data on the reMarkable
# decompress and decode the data on this machine
ssh_cmd "$head_fb0 | $compress" |
"${LZ4_ABS}" -d |
$decompress |
"${FFMPEG_ABS}" -y \
-f rawvideo \
-pixel_format $pixel_format \
Expand Down

0 comments on commit abf37fa

Please sign in to comment.