From 30ac3b714daaa70e3999d029d4340fe543d70566 Mon Sep 17 00:00:00 2001 From: Fabian Weik Date: Fri, 20 Nov 2020 12:14:45 +0100 Subject: [PATCH 1/6] add option to change the window title (default: reStream) --- reStream.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reStream.sh b/reStream.sh index 0c3c810..e407d18 100755 --- a/reStream.sh +++ b/reStream.sh @@ -7,6 +7,7 @@ output_path=- # display output through ffplay format=- # automatic output format webcam=false # not to a webcam measure_throughput=false # measure how fast data is being transferred +window_tile=reStream # stream windoe title is reStream # loop through arguments and process them while [ $# -gt 0 ]; do @@ -55,8 +56,13 @@ while [ $# -gt 0 ]; do fi shift ;; + --window_title) + window_title="$2" + shift + shift + ;; -h | --help | *) - echo "Usage: $0 [-p] [-s ] [-o ] [-f ]" + echo "Usage: $0 [-p] [-s ] [-o ] [-f ] [--window_title ]" echo "Examples:" echo " $0 # live view in landscape" echo " $0 -p # live view in portrait" @@ -189,5 +195,6 @@ ssh_cmd "$read_loop" \ -f rawvideo \ -pixel_format rgb565le \ -video_size "$width,$height" \ + -window_title "$window_title" \ -i - \ "$@" From e775e8707bb145ce5db21cfd9d0ca865735f23c4 Mon Sep 17 00:00:00 2001 From: Fabian Weik <fabian.weik@protonmail.com> Date: Fri, 20 Nov 2020 12:23:15 +0100 Subject: [PATCH 2/6] enable recording to output --- reStream.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reStream.sh b/reStream.sh index e407d18..6288af5 100755 --- a/reStream.sh +++ b/reStream.sh @@ -173,6 +173,8 @@ set -- "$@" -vf "${video_filters#,}" if [ "$output_path" = - ]; then output_cmd=ffplay + + window_title_option="-window_title $window_title" else output_cmd=ffmpeg @@ -195,6 +197,6 @@ ssh_cmd "$read_loop" \ -f rawvideo \ -pixel_format rgb565le \ -video_size "$width,$height" \ - -window_title "$window_title" \ + $window_title_option \ -i - \ "$@" From 7a44de286257162ede1ba7a8a425a90e55f36cb1 Mon Sep 17 00:00:00 2001 From: Fabian Weik <fabian.weik@protonmail.com> Date: Fri, 20 Nov 2020 12:29:32 +0100 Subject: [PATCH 3/6] fix typos --- reStream.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reStream.sh b/reStream.sh index 6288af5..2309648 100755 --- a/reStream.sh +++ b/reStream.sh @@ -7,7 +7,7 @@ output_path=- # display output through ffplay format=- # automatic output format webcam=false # not to a webcam measure_throughput=false # measure how fast data is being transferred -window_tile=reStream # stream windoe title is reStream +window_title=reStream # stream window title is reStream # loop through arguments and process them while [ $# -gt 0 ]; do From 8ef4a6993b1c8d9a122145a511657183fe17ebb7 Mon Sep 17 00:00:00 2001 From: Fabian Weik <fabian.weik@protonmail.com> Date: Fri, 20 Nov 2020 12:34:16 +0100 Subject: [PATCH 4/6] add description of option to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index db3e17e..91d8678 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ reMarkable screen sharing over SSH. - `-f --format`: when recording to an output, this option is used to force the encoding format; if this is `-`, `ffmpeg`’s auto format detection based on the file extension is used (default: `-`). - `-w --webcam`: record to a video4linux2 web cam device. By default the first found web cam is taken, this can be overwritten with `-o`. The video is scaled to 1280x720 to ensure compatibility with MS Teams, Skype for business and other programs which need this specific format. - `-t --throughput`: use `pv` to measure how much data throughput you have (good to experiment with parameters to speed up the pipeline) +- `--window_title`: set a custom window title for the video stream. The default title is "reStream". This option is disabled when using `-o --output` If you have problems, don't hesitate to [open an issue](https://github.com/rien/reStream/issues/new) or [send me an email](mailto:rien.maertens@posteo.be). From f1cb66b66392a980e1513efe8d75799b9c2d52d0 Mon Sep 17 00:00:00 2001 From: Murph Finnicum <murph@murph.cc> Date: Wed, 23 Dec 2020 06:04:51 -0800 Subject: [PATCH 5/6] Use ffmpeg native options to do scaling and padding math (#34) * Use ffmpeg native options to do scaling and padding math * whitespace --- reStream.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/reStream.sh b/reStream.sh index 2309648..83015fd 100755 --- a/reStream.sh +++ b/reStream.sh @@ -148,16 +148,8 @@ $landscape && video_filters="$video_filters,transpose=1" # for business). Send a PR is you can get a heigher resolution working. if $webcam; then video_filters="$video_filters,format=pix_fmts=yuv420p" - if $landscape; then - render_width=$((720 * height / width)) - else - render_width=$((720 * width / height)) - fi - - # center - offset_left=$(((1280 - render_width) / 2)) - video_filters="$video_filters,scale=${render_width}x720" - video_filters="$video_filters,pad=1280:720:$offset_left:0:#eeeeee" + video_filters="$video_filters,scale=-1:720" + video_filters="$video_filters,pad=1280:0:-1:0:#eeeeee" fi # set each frame presentation time to the time it is received From 6f55f735b0ee63202d83e1521eb013bb156c3a01 Mon Sep 17 00:00:00 2001 From: Rien Maertens <rien.maertens@posteo.be> Date: Thu, 31 Dec 2020 15:22:11 +0100 Subject: [PATCH 6/6] Simplify cli options --- reStream.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reStream.sh b/reStream.sh index 83015fd..9df3de4 100755 --- a/reStream.sh +++ b/reStream.sh @@ -31,7 +31,7 @@ while [ $# -gt 0 ]; do shift shift ;; - -t | --throughput) + -m | --measure) measure_throughput=true shift ;; @@ -56,13 +56,13 @@ while [ $# -gt 0 ]; do fi shift ;; - --window_title) + -t | --title) window_title="$2" shift shift ;; -h | --help | *) - echo "Usage: $0 [-p] [-s <source>] [-o <output>] [-f <format>] [--window_title <title>]" + echo "Usage: $0 [-p] [-s <source>] [-o <output>] [-f <format>] [-t <title>]" echo "Examples:" echo " $0 # live view in landscape" echo " $0 -p # live view in portrait"