Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra filters option #108

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ $ ssh root@10.11.99.1 'chmod +x /home/root/restream'
- `-m --measure`: use `pv` to measure how much data throughput you have (good to experiment with parameters to speed up the pipeline)
- `-t --title`: set a custom window title for the video stream. The default title is "reStream". This option is disabled when using `-o --output`
- `-u --unsecure-connection`: send framebuffer data over an unencrypted TCP-connection, resulting in more fps and less load on the reMarkable. See [Netcat](#netcat) for installation instructions.
- `-e --extra-filters`: pass extra video-filters to ffplay/ffmpeg (pass as a comma-seperated list)

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).

Expand Down
14 changes: 12 additions & 2 deletions reStream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ measure_throughput=false # measure how fast data is being trans
window_title=reStream # stream window title is reStream
video_filters="" # list of ffmpeg filters to apply
unsecure_connection=false # Establish a unsecure connection that is faster
extra_video_filters="" # Extra video filters to add at the end

# loop through arguments and process them
while [ $# -gt 0 ]; do
Expand All @@ -47,6 +48,11 @@ while [ $# -gt 0 ]; do
shift
shift
;;
-e | --extra-filters)
extra_video_filters="$2"
shift
shift
;;
-f | --format)
format="$2"
shift
Expand Down Expand Up @@ -170,7 +176,11 @@ case "$rm_version" in
echo "Using the newer :mem: video settings."
bytes_per_pixel=2
pixel_format="gray16be"
video_filters="$video_filters colorlevels=rimin=0:rimax=29/255:gimin=0:gimax=29/255:bimin=0:bimax=29/255,transpose=3"
BWindey marked this conversation as resolved.
Show resolved Hide resolved
# "curves" modifies the intensity of an RGB-value.
# The remarkable's max output is 1/8th of the normal brightness
# so the curves filter sets the scale from 0 -> 1 to 0 -> 0.125
# (https://ffmpeg.org/ffmpeg-filters.html#toc-Examples-63)
video_filters="$video_filters,curves=all='0/0 0.125/1 1/1',transpose=3"
# Use the previous video settings.
else
echo "Using the older :mem: video settings."
Expand Down Expand Up @@ -242,7 +252,7 @@ fi
# set each frame presentation time to the time it is received
video_filters="$video_filters,setpts=(RTCTIME - RTCSTART) / (TB * 1000000)"

set -- "$@" -vf "${video_filters#,}"
set -- "$@" -vf "${video_filters#,},${extra_video_filters}"

if [ "$output_path" = - ]; then
output_cmd=ffplay
Expand Down