rien / reStream

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

Terminate script when ffmplay window closes #43

Closed rien closed 3 years ago

rien commented 3 years ago

This PR should solve #42.

This currently only terminates the script on the host, but restream keeps running on the reMarkable (consuming a lot of resources). So we still need to find a way to correctly terminate the ssh session.

levincoolxyz commented 3 years ago

what I did for an old version is just adding to the output cmd a line that looks for a process with "lz4" on remarkable and kill it. Now I guess someone can modify it to make it look for the restream binary process and kill it. e.g. before I had

ssh_cmd "$read_loop" \ | $decompress_only | ~/.bin/xorstream $tmpfile /dev/null d \ | ( $output_cmd \ -fflags nobuffer -flags low_delay -probesize 32 \ -vcodec rawvideo \ -loglevel "$loglevel" \ -f rawvideo \ -pixel_format "$pixel_format" \ -video_size "$width,$height" \ $landscape_param \ -i - \ "$@" \ ; echo "streaming service stopped."; kill -15 $(ps -elf | grep "lz4" | grep "root@$ssh_host" | awk '{print $4}') )

I imagine replacing "lz4" in the last line to "restream" and add the parentheses to the current one-liner should work? too lazy to test at the moment :p

Toorero commented 3 years ago

Yep can confirm this at least resolves #42 Thanks a lot.

SIR-unit commented 3 years ago

This fix worked for me