hflip: eventually restore the correct orientation of web cam
This commit is contained in:
parent
2eb60e4c87
commit
edabacfb55
@ -99,6 +99,7 @@ $ ssh root@10.11.99.1 'chmod +x /home/root/restream'
|
|||||||
- `-o --output`: path of the output where the video should be recorded, as understood by `ffmpeg`; if this is `-`, the video is displayed in a new window and not recorded anywhere (default: `-`)
|
- `-o --output`: path of the output where the video should be recorded, as understood by `ffmpeg`; if this is `-`, the video is displayed in a new window and not recorded anywhere (default: `-`)
|
||||||
- `-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: `-`).
|
- `-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. See [Video4Linux Loopback](#video4linux-loopback) for installation instructions.
|
- `-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. See [Video4Linux Loopback](#video4linux-loopback) for installation instructions.
|
||||||
|
- `--hflip`: mirror the web cam video (`--webcam` has to be set). By default or as only choice, some programs, such as Zoom and Discord, mirror the camera. This flag restores the correct orientation.
|
||||||
- `-m --measure`: use `pv` to measure how much data throughput you have (good to experiment with parameters to speed up the pipeline)
|
- `-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`
|
- `-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.
|
- `-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.
|
||||||
|
16
reStream.sh
16
reStream.sh
@ -6,6 +6,7 @@ landscape=true # rotate 90 degrees to the right
|
|||||||
output_path=- # display output through ffplay
|
output_path=- # display output through ffplay
|
||||||
format=- # automatic output format
|
format=- # automatic output format
|
||||||
webcam=false # not to a webcam
|
webcam=false # not to a webcam
|
||||||
|
hflip=false # horizontal flip webcam
|
||||||
measure_throughput=false # measure how fast data is being transferred
|
measure_throughput=false # measure how fast data is being transferred
|
||||||
window_title=reStream # stream window title is reStream
|
window_title=reStream # stream window title is reStream
|
||||||
video_filters="" # list of ffmpeg filters to apply
|
video_filters="" # list of ffmpeg filters to apply
|
||||||
@ -58,6 +59,11 @@ while [ $# -gt 0 ]; do
|
|||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--hflip)
|
||||||
|
# do nothing if --webcam is not set
|
||||||
|
hflip=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
-t | --title)
|
-t | --title)
|
||||||
window_title="$2"
|
window_title="$2"
|
||||||
shift
|
shift
|
||||||
@ -68,15 +74,15 @@ while [ $# -gt 0 ]; do
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-h | --help | *)
|
-h | --help | *)
|
||||||
echo "Usage: $0 [-p] [-u] [-s <source>] [-o <output>] [-f <format>] [-t <title>]"
|
echo "Usage: $0 [-p] [-u] [-s <source>] [-o <output>] [-f <format>] [-t <title>] [-m] [-w] [--hflip]"
|
||||||
echo "Examples:"
|
echo "Examples:"
|
||||||
echo " $0 # live view in landscape"
|
echo " $0 # live view in landscape"
|
||||||
echo " $0 -p # live view in portrait"
|
echo " $0 -p # live view in portrait"
|
||||||
echo " $0 -s 192.168.0.10 # connect to different IP"
|
echo " $0 -s 192.168.0.10 # connect to different IP"
|
||||||
echo " $0 -o remarkable.mp4 # record to a file"
|
echo " $0 -o remarkable.mp4 # record to a file"
|
||||||
echo " $0 -o udp://dest:1234 -f mpegts # record to a stream"
|
echo " $0 -o udp://dest:1234 -f mpegts # record to a stream"
|
||||||
echo " $0 -w # write to a webcam (yuv420p + resize)"
|
echo " $0 -w --hflip # write to a webcam (yuv420p + resize + mirror)"
|
||||||
echo " $0 -u # establish a unsecure but faster connection"
|
echo " $0 -u # establish a unsecure but faster connection"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -174,6 +180,10 @@ if $webcam; then
|
|||||||
video_filters="$video_filters,format=pix_fmts=yuv420p"
|
video_filters="$video_filters,format=pix_fmts=yuv420p"
|
||||||
video_filters="$video_filters,scale=-1:720"
|
video_filters="$video_filters,scale=-1:720"
|
||||||
video_filters="$video_filters,pad=1280:0:-1:0:#eeeeee"
|
video_filters="$video_filters,pad=1280:0:-1:0:#eeeeee"
|
||||||
|
|
||||||
|
# Some applications, eg Zoom and Discord, mirror by default the webcam video
|
||||||
|
# Restore the correct orientation
|
||||||
|
$hflip && video_filters="$video_filters,hflip"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set each frame presentation time to the time it is received
|
# set each frame presentation time to the time it is received
|
||||||
|
Loading…
x
Reference in New Issue
Block a user