diff --git a/reStream.sh b/reStream.sh index 076de16..0e64aed 100755 --- a/reStream.sh +++ b/reStream.sh @@ -95,18 +95,17 @@ set -e # stop if an error occurs # shellcheck disable=SC2089 restream_rs="PATH=\"\$PATH:/opt/bin/:.\" restream" listen_port=16789 -ssh_cmd "$restream_rs --listen $listen_port" & +ssh_cmd "$restream_rs --port $listen_port --format mono" & sleep 1 # give some time to restream.rs to start listening receive_cmd="nc $remarkable $listen_port" # TODO: return this from stdout width=1872 height=1404 -pixel_format="gray8" +pixel_format="monob" # shellcheck disable=SC2086,SC2090 $receive_cmd | - pv | ( "$output_cmd" \ -vcodec rawvideo \ diff --git a/src/main.rs b/src/main.rs index 9ac9baf..96cadd0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,7 @@ use std::{ io::{BufRead, BufReader, Read, Write}, net::{TcpListener, TcpStream}, process::Command, - time::{Duration, Instant}, + time::Duration, }; mod reduce; @@ -53,10 +53,8 @@ impl Format { Self::Gray16be => { let mut buf = [0u8; IN_SIZE]; loop { - let now = Instant::now(); src.read_exact(&mut buf)?; tgt.write_all(&buf[0..IN_SIZE])?; - println!("{:?}", now.elapsed().as_millis()); } } @@ -64,12 +62,9 @@ impl Format { const OUT: usize = reduce::gray8::out_size(IN_SIZE); let mut buf = [0u8; IN_SIZE]; loop { - let now = Instant::now(); src.read_exact(&mut buf)?; - reduce::gray8::run(&mut buf); tgt.write_all(&buf[0..OUT])?; - println!("{:?}", now.elapsed().as_millis()); } } @@ -77,12 +72,9 @@ impl Format { const OUT: usize = reduce::gray8_simd::out_size(IN_SIZE); let mut buf = [0u8; IN_SIZE]; loop { - let now = Instant::now(); src.read_exact(&mut buf)?; - reduce::gray8_simd::run(&mut buf); tgt.write_all(&buf[0..OUT])?; - println!("{:?}", now.elapsed().as_millis()); } } @@ -90,12 +82,9 @@ impl Format { const OUT: usize = reduce::mono::out_size(IN_SIZE); let mut buf = [0u8; IN_SIZE]; loop { - let now = Instant::now(); src.read_exact(&mut buf)?; - reduce::mono::run(&mut buf); tgt.write_all(&buf[0..OUT])?; - println!("{:?}", now.elapsed().as_millis()); } } @@ -103,12 +92,9 @@ impl Format { const OUT: usize = reduce::mono_simd::out_size(IN_SIZE); let mut buf = [0u8; IN_SIZE]; loop { - let now = Instant::now(); src.read_exact(&mut buf)?; - reduce::mono_simd::run(&mut buf); tgt.write_all(&buf[0..OUT])?; - println!("{:?}", now.elapsed().as_millis()); } } }