From: Guillaume Pellerin Date: Wed, 31 Jan 2024 20:56:53 +0000 (+0100) Subject: convert V4L2_ID to list X-Git-Tag: 3.0~41 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=b82b84737550ebfd7222ad1cfe957f33739b054f;p=telecaster-server.git convert V4L2_ID to list --- diff --git a/bin/streaming/tc_video_simple_webm_stream-gst1.sh b/bin/streaming/tc_video_simple_webm_stream-gst1.sh index b6c3c83..c4898ec 100755 --- a/bin/streaming/tc_video_simple_webm_stream-gst1.sh +++ b/bin/streaming/tc_video_simple_webm_stream-gst1.sh @@ -32,19 +32,20 @@ AUDIO_GAIN_POST=1.5 source /etc/telecaster/telecaster.conf -# use 1rst arg for webcam ID -V4L2_ID=$1 -echo $V4L2_ID - # V4L2 setup -v4l2-ctl -d $V4L2_ID -c power_line_frequency=1 -v4l2-ctl -d $V4L2_ID -c zoom_absolute=$V4L2_ZOOM -v4l2-ctl -d $V4L2_ID -c focus_auto=0 -v4l2-ctl -d $V4L2_ID -c focus_absolute=1 -v4l2-ctl -d $V4L2_ID -c sharpness=$V4L2_SHARPNESS +if [ ! -z "${V4L2_ZOOM-}" ]; then +v4l2-ctl -d $ID -c power_line_frequency=1 +v4l2-ctl -d $ID -c zoom_absolute=$V4L2_ZOOM +v4l2-ctl -d $ID -c focus_auto=0 +v4l2-ctl -d $ID -c focus_absolute=1 +v4l2-ctl -d $ID -c sharpness=$V4L2_SHARPNESS +fi # GST launch -gst-launch-1.0 v4l2src device=/dev/video$V4L2_ID ! $V4L2_FORMAT, width=$VIDEO_WIDTH, height=$VIDEO_HEIGHT, framerate=$VIDEO_FRAMERATE/1 \ + +for ID in ${V4L2_ID[@]}; do + +gst-launch-1.0 v4l2src device=/dev/video$ID ! $V4L2_FORMAT, width=$VIDEO_WIDTH, height=$VIDEO_HEIGHT, framerate=$VIDEO_FRAMERATE/1 \ ! queue ! $V4L2_DEC \ ! queue ! videoflip method=$VIDEO_FLIP \ ! queue ! videoconvert \ @@ -60,5 +61,7 @@ gst-launch-1.0 v4l2src device=/dev/video$V4L2_ID ! $V4L2_FORMAT, width=$VIDEO_WI ! queue ! opusenc bitrate=$AUDIO_OPUS_BITRATE \ ! queue ! muxout. \ webmmux streamable=true name=muxout \ - ! queue ! shout2send ip=127.0.0.1 port=8000 password=source2parisson mount=telecaster_live_$V4L2_ID.webm + ! queue ! shout2send ip=127.0.0.1 port=8000 password=source2parisson mount=telecaster_live_$ID.webm > /dev/null + +done diff --git a/etc/telecaster/telecaster.conf b/etc/telecaster/telecaster.conf index e3e51fd..b742476 100755 --- a/etc/telecaster/telecaster.conf +++ b/etc/telecaster/telecaster.conf @@ -11,7 +11,7 @@ PORT="1" #OPTIONS="-geometry 1024x768 -depth 8" # v4l2 -V4L2_ID=0 +V4L2_ID=(0) V4L2_ZOOM=140 V4L2_SHARPNESS=144