rien / reStream

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

Streamed video is too dark, recordings are corrupted #91

Closed Jacajack closed 6 months ago

Jacajack commented 1 year ago

I'm having issues with reStream v1.2.0. The streamed video (restream -s remarkable -p) appears really dark:

When I use restream -s remarkable -p -o test.mp4, I get a broken MP4 file which looks like this:

Remarkable firmware version: 3.3.2.1655 Ffmpeg version: 5.1.2

tbellembois commented 1 year ago

I have the same issue. Remarkable firmware version: 3.3.2.1655 Ffmpeg version: 4.4.2

Tried on WIFI and USB.

vunhatchuong commented 1 year ago

Heard it's a rm2fb issue, we just need to wait till rm2fb support the version.

plamenivanov257 commented 1 year ago

Can confirm that I am experiencing the same issue (dark screen). Reading the code in reStream.sh, it seems to be because it defaults to grayscale since it cannot find /dev/shm/swtfb.01 on the reMarkable device. Is this some shared-memory frame buffer that is no longer available on the latest firmware?

Not sure why the grayscale is so dark, but fortunately there is a workaround --- one can add a gamma filter to ffmpeg. To do this, simply modify line 15 of reStream.sh to read

video_filters="eq=gamma=10"

This cranks up the gamma to the max allowed value in ffmpeg. The result is not perfect but still very usable for many things.

Eeems commented 1 year ago

Can confirm that I am experiencing the same issue (dark screen). Reading the code in reStream.sh, it seems to be because it defaults to grayscale since it cannot find /dev/shm/swtfb.01 on the reMarkable device. Is this some shared-memory frame buffer that is no longer available on the latest firmware?

That would be provided by rm2fb. See the last couple comments before yours.

plamenivanov257 commented 1 year ago

Is it? I never installed rm2fb and I cannot find any references to rm2fb in either the host or device code for reStream...

Maybe I have always used grayscale without knowing and something somewhere somehow broke that?

Eeems commented 1 year ago

Is it? I never installed rm2fb and I cannot find any references to rm2fb in either the host or device code for reStream...

Maybe I have always used grayscale without knowing and something somewhere somehow broke that?

/dev/shm/swtfb.01 is a reference to rm2fb. It's shared memory provided by rm2fb. PR #41 added support for rm2fb. You can find lots of discussion on supporting the rM2 on #28

plamenivanov257 commented 1 year ago

Interesting... Apologies, I am new to this stuff. Thanks for the info!

So, just to be clear, does reStream somehow install rm2fb by itself? If not, then I guess I have always ran in grayscale mode and the darkness bug is not related to rm2fb...

Eeems commented 1 year ago

Interesting... Apologies, I am new to this stuff. Thanks for the info!

So, just to be clear, does reStream somehow install rm2fb by itself? If not, then I guess I have always ran in grayscale mode and the darkness bug is not related to rm2fb...

It does not, if it did, there would probably be several issues open with people saying it bricked their device due to trying to run it before rm2fb works for their OS version.

Yes, you would have always been running in greyscale mode.

plamenivanov257 commented 1 year ago

Yes, you would have always been running in greyscale mode.

This makes sense, thank you! I guess the question then is why the grayscale version is now broken since it was fine before the last OS update.

Eeems commented 1 year ago

My guess is that the framebuffer pixel format may have changed again.

StachuDotNet commented 1 year ago

Not sure why the grayscale is so dark, but fortunately there is a workaround --- one can add a gamma filter to ffmpeg. To do this, simply modify line 15 of reStream.sh to read

video_filters="eq=gamma=10"

This cranks up the gamma to the max allowed value in ffmpeg. The result is not perfect but still very usable for many things.

This is really useful, thanks. If you end up finding a more effective set of video filters, please follow up :) I've tried playing with ffmpeg settings and I feel like there's got to be a simple set of filters that would make the screen clear again in the interim, but haven't figured it out :)

D1mme commented 1 year ago

Not sure why the grayscale is so dark, but fortunately there is a workaround --- one can add a gamma filter to ffmpeg. To do this, simply modify line 15 of reStream.sh to read video_filters="eq=gamma=10" This cranks up the gamma to the max allowed value in ffmpeg. The result is not perfect but still very usable for many things.

This is really useful, thanks. If you end up finding a more effective set of video filters, please follow up :) I've tried playing with ffmpeg settings and I feel like there's got to be a simple set of filters that would make the screen clear again in the interim, but haven't figured it out :)

Hi. I've found a (near) perfect workaround using: video_filters="curves=all='0/0 0.07/1 1/1'"

Hope this helps.

kareiva commented 1 year ago

Should be there in the default settings I guess.

Hi. I've found a (near) perfect workaround using: video_filters="curves=all='0/0 0.07/1 1/1'"

Hope this helps.

rien commented 6 months ago

This should be fixed in the latest release by #100. Let me know if you encounter any additional issues.