rien / reStream

Stream your reMarkable screen over SSH.
MIT License
734 stars 56 forks source link

Support reMarkable 2 #31

Closed rien closed 3 years ago

rien commented 3 years ago

TODO:

Closes #28

Stivanification commented 3 years ago

Doesn't work for me with with reMarkable 2 v2.3.1.27. This is the output I get:

WARNING: unknown reMarkable 2 release version
consider updating if reStream doesn't work
awk: cmd. line:1: Unexpected token
ffplay version 4.2.4-1ubuntu0.1 Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  WARNING: library configuration mismatch
  avcodec     configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libaribb24 --enable-liblensfun --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, rawvideo, from 'pipe:':  0KB vq=    0KB sq=    0B f=0/0   
  Duration: N/A, bitrate: 525657 kb/s
    Stream #0:0: Video: rawvideo (Y800 / 0x30303859), gray, 1404x1872, 525657 kb/s, 25 tbr, 25 tbn, 25 tbc
^C  nan M-V:    nan fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   
rien commented 3 years ago

If someone with an rM2 and version 2.3.1.17 could test this PR out it that would be awesome! If someone can find the right skills to find the framebuffer pointer in 2.4.* then we can support the most recent update.

Stivanification commented 3 years ago

I'm getting the following

./reStream.sh: 113: dd if=/proc/238/mem bs=4096 skip=1006 count=1 2>/dev/null | dd if=/dev/stdin skip=448 bs=4 count=1 2>/dev/null: not found
sh: command substitution: line 1: syntax error near unexpected token `|'
sh: command substitution: line 1: ` | hexdump | awk '{print $3$2}')'
./reStream.sh: 113: dd if=/proc/238/mem bs=4096 skip=0 count=642 2>/dev/null | dd if=/dev/stdin skip=0 bs=2628288 count=1 2>/dev/null: not found
ffplay version 4.2.4-1ubuntu0.1 Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  WARNING: library configuration mismatch
  avcodec     configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libaribb24 --enable-liblensfun --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
sh: -c: line 0: syntax error near unexpected token `;'   0B f=0/0   
sh: -c: line 0: `whil./reStream.sh: 113: dd if=/proc/238/mem bs=4096 skip=1006 count=1 2>/dev/null | dd if=/dev/stdin skip=448 bs=4 count=1 2>/dev/null: not found
sh: command substitution: line 1: syntax error near unexpected token `|'
sh: command substitution: line 1: ` | hexdump | awk '{print $3$2}')'
./reStream.sh: 113: dd if=/proc/238/mem bs=4096 skip=0 count=642 2>/dev/null | dd if=/dev/stdin skip=0 bs=2628288 count=1 2>/dev/null: not found
ffplay version 4.2.4-1ubuntu0.1 Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  WARNING: library configuration mismatch
  avcodec     configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libaribb24 --enable-liblensfun --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
sh: -c: line 0: syntax error near unexpected token `;'   0B f=0/0   
sh: -c: line 0: `while ; do true; done | $HOME/lz4'
Input #0, rawvideo, from 'pipe:':
  Duration: N/A, bitrate: 525657 kb/s
    Stream #0:0: Video: rawvideo (Y800 / 0x30303859), gray, 1872x1404, 525657 kb/s, 25 tbr, 25 tbn, 25 tbc
^C  nan M-V:    nan fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0e ; do true; done | $HOME/lz4'
Input #0, rawvideo, from 'pipe:':

unfortunately I'm a beginner with bash so I'm afraid I can't help with the debugging.

thomsten commented 3 years ago

Using head doesn't seem to work on 2.4.1.30 at least. It's running Busybox v1.3, apparently without ENABLE_FANCY_HEAD :( https://git.busybox.net/busybox/tree/coreutils/head.c?h=1_3_stable#n72

levincoolxyz commented 3 years ago

After bypassing the lack of "head -c" issue using "dd bs=$window_bytes", I was able to get still frames out perfectly (e.g. using convert). But with ffplay it still have significant drifting artifacts during the stream. Not able to comprehend the inconsistency between these two outcomes... (on version 2.3.1.27)

sdatko commented 3 years ago

Software version 2.4.1.30 here, works properly after applying the following changes mentioned by others in comments:

diff --git a/reStream.sh b/reStream.sh
index 39a50e7..1f5d589 100755
--- a/reStream.sh
+++ b/reStream.sh
@@ -121,7 +121,7 @@ case "$rm_version" in

         # Using dd with bs=1 is too slow, so we first carve out the pages our desired
         # bytes are located in, and then we trim the resulting data with what we need.
-        head_fb0="dd if=/proc/$pid/mem bs=$page_size skip=$window_start_blocks count=$window_length_blocks 2>/dev/null | tail -c+$window_offset | head -c $window_bytes"
+        head_fb0="dd if=/proc/$pid/mem bs=$page_size skip=$window_start_blocks count=$window_length_blocks 2>/dev/null | tail -c+$window_offset | dd count=$window_bytes bs=1 2>/dev/null"
         ;;
     *)
         echo "Unsupported reMarkable version: $rm_version."
@@ -180,7 +180,7 @@ video_filters=""
 set --

 # rotate 90 degrees if landscape=true
-$landscape && video_filters="$video_filters,transpose=1"
+$landscape && video_filters="$video_filters,transpose=2"

 # Scale and add padding if we are targeting a webcam because a lot of services
 # expect a size of exactly 1280x720 (tested in Firefox, MS Teams, and Skype for

Though, the latency is for me very big – it takes about 40-45 seconds after any change is made when used the lz4 binary provided in the repository, while it takes about 20-25 seconds without this binary.

Also I have doubts about the rotation at all – the variable suggests that the default mode is landscape and optionally it should be portrait orientation. If I read this correctly, then we actually have the opposite – by default the displayed stream is exactly as you hold reMarkable in your hands, which for me is portrait (taller than wider). If you then add -p mode, then the screen is rotated by 90 degrees, which would correspond with rotating the device on your desk to have it wider than taller. Was it different on reMarkable1 or we just have bad naming here?

ladnir commented 3 years ago

What is the status of this? I pulled this branch but get the following error. I'm on v2.4.1.30, also tried the change that @sdatko mentions above and scp'ed head to root@remarkable:/usr/local/bin/.

peter@DESKTOP-31JUF3C:~/reStream$ ./reStream.sh
[SSH] true
[SSH] cat /sys/devices/soc0/machine
[SSH] pidof xochitl
xochitl's PID: 247
[SSH] grep -C1 '/dev/fb0' /proc/247/maps | tail -n1 | sed 's/-.*$//'
framebuffer is at 0x72afa000
[SSH] [ -f /opt/bin/lz4 ]
[SSH] [ -f ~/lz4 ]
Your remarkable does not have lz4.
Falling back to gzip, your experience may not be optimal.
Go to https://github.com/rien/reStream/#sub-second-latency for a better experience.
[SSH] while dd if=/proc/247/mem bs=4096 skip=469754 count=642 2>/dev/null | tail -c+8 | dd count=2628288 bs=1 2>/dev/null; do true; done | gzip
ffplay version 4.2.4-1ubuntu0.1 Copyright (c) 2003-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
error: XDG_RUNTIME_DIR not set in the environment.
Could not initialize SDL - No available video device
(Did you set the DISPLAY variable?)
^C
sdatko commented 3 years ago

What is the status of this? I pulled this branch but get the following error. I'm on v2.4.1.30, also tried the change that @sdatko mentions above and scp'ed head to root@remarkable:/usr/local/bin/.

peter@DESKTOP-31JUF3C:~/reStream$ ./reStream.sh
...
error: XDG_RUNTIME_DIR not set in the environment.
Could not initialize SDL - No available video device
(Did you set the DISPLAY variable?)

@ladnir What OS do you use? It seems like you have problem with your Desktop Environment... The problem is that ffmpeg does not know where to launch the video window. If you are on Windows, you may need Xming.

ladnir commented 3 years ago

aww, I was using WSL. Thanks!

hirowatari commented 3 years ago

Please ignore if this is not helpful. With the patch that sdatko mentioned, I was able to get this to work. Without lz4, latency was about 30 seconds. With the reMarkable 1, it was very fast.

I'm using version 2.4.1.30.

Thanks a lot for all the work on this.

jkopanski commented 3 years ago

With lz4 and using dd instead of head I am having a lot of latency. With head copied from coreutils I have smooth experience.

mirodietiker commented 3 years ago

Like jkopanski i was able to make this work with a 45sec delay with the adjustments from https://github.com/rien/reStream/pull/31#issuecomment-730231134

Adding / removing lz4 didn't make an improvement for me performance wise.

I copied head from debian armhf coreutils as well, but couldn't make it work at all. What did i miss here?

murph commented 3 years ago

version 2.4.1.30 0) Have l4z 1) Installed coreutils-head via remarkable_entware and opt install coreutils-head. 2) Applied small patches to fix rotation and use correct 'head' binary:

diff --git a/reStream.sh b/reStream.sh
index 39a50e7..9227f91 100755
--- a/reStream.sh
+++ b/reStream.sh
@@ -121,7 +121,7 @@ case "$rm_version" in

         # Using dd with bs=1 is too slow, so we first carve out the pages our desired
         # bytes are located in, and then we trim the resulting data with what we need.
-        head_fb0="dd if=/proc/$pid/mem bs=$page_size skip=$window_start_blocks count=$window_length_blocks 2>/dev/null | tail -c+$window_offset | head -c $window_bytes"
+        head_fb0="dd if=/proc/$pid/mem bs=$page_size skip=$window_start_blocks count=$window_length_blocks 2>/dev/null | tail -c+$window_offset | /opt/bin/head -c $window_bytes"
         ;;
     *)
         echo "Unsupported reMarkable version: $rm_version."
@@ -179,8 +179,8 @@ video_filters=""
 # store extra ffmpeg arguments in $@
 set --

-# rotate 90 degrees if landscape=true
-$landscape && video_filters="$video_filters,transpose=1"
+# rotate 90˚ counter-clockwise for portrait mode
+! $landscape && video_filters="$video_filters,transpose=2"

3) It works great, sub-second latency.

Is this sufficient for this project?

Some options for the binary: 1) We could add a head binary to the repo 2) We could have people use entware. 3) We could build our own tiny binary that just does the dd and cut and head stuff. Would be a trivial program.

Eeems commented 3 years ago

Likely using entware would be the better solution longer term.

rien commented 3 years ago

Thank you all for your input and my apologies for the radio silence lately. I've started working on a small executable to do all the reMarkable-sided stuff (reading the framebuffer, compressing with lz4). Initial results on my rM1 are promising. I will finish this PR soon and hopefully we'll have a working reStream for rM2!

tjdevries commented 3 years ago

Is there anything that currently needs testing on a remarkable 2 / guide to confirm that things are working as they are at the moment? There are a lot of comments above and I'm new to the remarkable world :) If not, feel free to ignore me for now :)

Foxei commented 3 years ago

@rien How is you progress? I have a working prototype that archives around 12-15fps. Currently the visualization is done by a tweak version of the rMview python script but the image data is extracted with a custom C++ executable running on my rM2.

https://user-images.githubusercontent.com/25650006/103177413-a2d4d800-487a-11eb-887c-bc4868b6a13e.mov

aenario commented 3 years ago

Tested https://github.com/rien/reStream/pull/31#issuecomment-743344940 on v2.5.0.27 and everything work fine with sub-second latency.

Thanks everyone, awesome project !

Foxei commented 3 years ago

I published the code of my framebuffer dumping tool called reDump and updated the Code of reStream to work with my tool. Pull request #35 is related to this. 😄

In the future it might be feasible to adapt reDump to work with the rM1 as well so that those users can enjoy 12-14 FPS as well. Unfortunately, I do not own an rM1. 😢

rien commented 3 years ago

Hi everyone! I've adjusted the README and added a compiled version of the dumping script to the repository. Can someone with a reMarkable 2 test if it works and test if the orientation is correct by default it should be in landscape mode, with -p it should be in portrait mode. If this doesn't work, please try changing the transpose=1 option here to something else ffmpeg accepts (documentation: https://ffmpeg.org/ffmpeg-filters.html#transpose-1).

danielebruneo commented 3 years ago

Hi everyone! I've adjusted the README and added a compiled version of the dumping script to the repository. Can someone with a reMarkable 2 test if it works and test if the orientation is correct by default it should be in landscape mode, with -p it should be in portrait mode. If this doesn't work, please try changing the transpose=1 option here to something else ffmpeg accepts (documentation: https://ffmpeg.org/ffmpeg-filters.html#transpose-1).

Confirmed as working in reMarkable 2, orientation behaves correctly as well. Great job!

axelson commented 3 years ago

I confirmed this as working on my reMarkable 2 also (and with correct orientation). Thanks for the software! :heart:

pascalw commented 3 years ago

I tried this on my RM and while FPS seems to be pretty good, I noticed that quite often after about 20s the updates completely stop, the view my computer just doesn't update anymore. Has anyone else seen this?

I'm on macOS. Here's some output:

[SSH] true
[SSH] cat /sys/devices/soc0/machine
[SSH] [ ! -f ~/restream ]
[SSH] ./restream
ffplay version 4.3.1 Copyright (c) 2003-2020 the FFmpeg developers
  built with Apple clang version 11.0.3 (clang-1103.0.32.62)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, rawvideo, from 'pipe:':
  Duration: N/A, start: 0.000000, bitrate: 525657 kb/s
    Stream #0:0: Video: rawvideo (Y800 / 0x30303859), gray, 1872x1404, 525657 kb/s, 25 tbr, 25 tbn, 25 tbc
  48.00 M-V:  0.001 fd= 319 aq=    0KB vq=15400KB sq=    0B f=0/0
rien commented 3 years ago

@pascalw I haven't encountered this. Can you please open a new issue with some additional information:

I do know this can happen is the reMarkable goes to sleep, but that only happens after a period of inactivity on the reMarkable.