Replace arrays with variable substitutions for POSIX compliance
Co-Authored-By: Rien <rien.maertens@posteo.be>
This commit is contained in:
parent
4344903438
commit
d0323daef5
15
reStream.sh
15
reStream.sh
@ -78,14 +78,14 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
output_args=()
|
output_args=""
|
||||||
video_filters=()
|
video_filters=""
|
||||||
|
|
||||||
# calculate how much bytes the window is
|
# calculate how much bytes the window is
|
||||||
window_bytes="$(($width*$height*$bytes_per_pixel))"
|
window_bytes="$(($width*$height*$bytes_per_pixel))"
|
||||||
|
|
||||||
# rotate 90 degrees if landscape=true
|
# rotate 90 degrees if landscape=true
|
||||||
$landscape && video_filters+=('transpose=1')
|
$landscape && video_filters="$video_filters,transpose=1"
|
||||||
|
|
||||||
# read the first $window_bytes of the framebuffer
|
# read the first $window_bytes of the framebuffer
|
||||||
head_fb0="dd if=/dev/fb0 count=1 bs=$window_bytes 2>/dev/null"
|
head_fb0="dd if=/dev/fb0 count=1 bs=$window_bytes 2>/dev/null"
|
||||||
@ -99,17 +99,16 @@ else
|
|||||||
output_command=ffmpeg
|
output_command=ffmpeg
|
||||||
|
|
||||||
if [ "$format" != - ]; then
|
if [ "$format" != - ]; then
|
||||||
output_args+=('-f' "$format")
|
output_args="$output_args -f '$format' "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
output_args+=("$output_path")
|
output_args="$output_args '$output_path'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set frame presentation time to the time it was received
|
# set frame presentation time to the time it was received
|
||||||
video_filters+=('setpts=(RTCTIME - RTCSTART) / (TB * 1000000)')
|
video_filters="$video_filters,setpts=(RTCTIME - RTCSTART) / (TB * 1000000)"
|
||||||
|
|
||||||
joined_filters=$(IFS=,; echo "${video_filters[*]}")
|
output_args="$output_args -vf '${video_filters#,}'"
|
||||||
output_args+=('-vf' "$joined_filters")
|
|
||||||
|
|
||||||
set -e # stop if an error occurs
|
set -e # stop if an error occurs
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user