From: Guillaume Pellerin Date: Wed, 31 Jan 2024 21:59:56 +0000 (+0100) Subject: add script X-Git-Tag: 3.0~32 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=8b3ccbd475a9e7f7e9f9fd10783177c29593513a;p=telecaster-server.git add script --- diff --git a/bin/streaming/tc_video_simple_webm_stream-gst1-double.sh b/bin/streaming/tc_video_simple_webm_stream-gst1-double.sh new file mode 100644 index 0000000..165faae --- /dev/null +++ b/bin/streaming/tc_video_simple_webm_stream-gst1-double.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash + +set -e + +# Default TeleCaster video parameters + +source /etc/telecaster/telecaster.conf + +# V4L2 setup +if [ ! -z "${V4L2_ZOOM-}" ]; then +v4l2-ctl -d $V4L2_ID_1 -c power_line_frequency=1 +v4l2-ctl -d $V4L2_ID_1 -c zoom_absolute=$V4L2_ZOOM +v4l2-ctl -d $V4L2_ID_1 -c focus_auto=0 +v4l2-ctl -d $V4L2_ID_1 -c focus_absolute=1 +v4l2-ctl -d $V4L2_ID_1 -c sharpness=$V4L2_SHARPNESS +fi + +gst-launch-1.0 v4l2src device=/dev/video$V4L2_ID_1 ! $V4L2_FORMAT, width=$VIDEO_WIDTH, height=$VIDEO_HEIGHT, framerate=$VIDEO_FRAMERATE/1 \ + ! queue ! $V4L2_DEC \ + ! queue ! videoflip method=$VIDEO_FLIP \ + ! queue ! videoconvert \ + ! queue ! vp8enc threads=4 deadline=2 \ + ! queue ! muxout. \ + jackaudiosrc connect=2 ! audio/x-raw, format=F32LE, channels=$AUDIO_CHANNELS \ + ! queue ! audiocheblimit mode=high-pass cutoff=120 poles=4 \ + ! queue ! volume volume=$AUDIO_GAIN_PRE \ + ! queue ! audiodynamic characteristics=soft-knee mode=compressor threshold=0.125 ratio=0.125 \ + ! queue ! volume volume=$AUDIO_GAIN_POST \ + ! queue ! audiodynamic characteristics=hard-knee mode=compressor threshold=0.95 ratio=0.001 \ + ! queue ! audioconvert \ + ! 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_1.webm + > /dev/null + + +# V4L2 setup +if [ ! -z "${V4L2_ZOOM-}" ]; then +v4l2-ctl -d $V4L2_ID_2 -c power_line_frequency=1 +v4l2-ctl -d $V4L2_ID_2 -c zoom_absolute=$V4L2_ZOOM +v4l2-ctl -d $V4L2_ID_2 -c focus_auto=0 +v4l2-ctl -d $V4L2_ID_2 -c focus_absolute=1 +v4l2-ctl -d $V4L2_ID_2 -c sharpness=$V4L2_SHARPNESS +fi + +gst-launch-1.0 v4l2src device=/dev/video$V4L2_ID_2 ! $V4L2_FORMAT, width=$VIDEO_WIDTH, height=$VIDEO_HEIGHT, framerate=$VIDEO_FRAMERATE/1 \ + ! queue ! $V4L2_DEC \ + ! queue ! videoflip method=$VIDEO_FLIP \ + ! queue ! videoconvert \ + ! queue ! vp8enc threads=4 deadline=2 \ + ! queue ! muxout. \ + jackaudiosrc connect=2 ! audio/x-raw, format=F32LE, channels=$AUDIO_CHANNELS \ + ! queue ! audiocheblimit mode=high-pass cutoff=120 poles=4 \ + ! queue ! volume volume=$AUDIO_GAIN_PRE \ + ! queue ! audiodynamic characteristics=soft-knee mode=compressor threshold=0.125 ratio=0.125 \ + ! queue ! volume volume=$AUDIO_GAIN_POST \ + ! queue ! audiodynamic characteristics=hard-knee mode=compressor threshold=0.95 ratio=0.001 \ + ! queue ! audioconvert \ + ! 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_2.webm + > /dev/null + +done