]> git.parisson.com Git - telecaster-server.git/commitdiff
use the h264 stream of the webcam
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 9 Jan 2024 15:45:55 +0000 (16:45 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 9 Jan 2024 15:45:55 +0000 (16:45 +0100)
src/home/telecaster/.fluxbox/scripts/tc_video_simple_webm_stream-gst1-h264.sh [new file with mode: 0755]
src/home/telecaster/.fluxbox/startup

diff --git a/src/home/telecaster/.fluxbox/scripts/tc_video_simple_webm_stream-gst1-h264.sh b/src/home/telecaster/.fluxbox/scripts/tc_video_simple_webm_stream-gst1-h264.sh
new file mode 100755 (executable)
index 0000000..44043a4
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/env bash
+
+set -e
+
+# Default TeleCaster video parameters
+
+# v4l2
+V4L2_ID=0
+V4L2_ZOOM=140
+V4L2_SHARPNESS=128
+
+# C920
+#VIDEO_WIDTH=864
+#VIDEO_HEIGHT=480
+#VIDEO_FRAMERATE=24
+
+# C922
+VIDEO_WIDTH=864
+VIDEO_HEIGHT=480
+VIDEO_FRAMERATE=24
+VIDEO_FLIP=none
+
+# Audio
+AUDIO_CHANNELS=2
+AUDIO_OPUS_BITRATE=96000
+AUDIO_GAIN_PRE=2.5
+AUDIO_GAIN_POST=1.5
+
+source /etc/telecaster/telecaster.conf
+
+# 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
+
+# GST launch
+gst-launch-1.0 v4l2src device=/dev/video$V4L2_ID ! video/x-h264, width=$VIDEO_WIDTH, height=$VIDEO_HEIGHT, framerate=$VIDEO_FRAMERATE/1  \
+       ! queue ! avdec_h264 \
+       ! 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.webm
+       > /dev/null
index 9ac6941ad33146c6afa73562167e79aa87dedb4d..baf3b0820fc6e5eb9b8fa7619f1feaceb97cc7d3 100644 (file)
@@ -43,7 +43,7 @@ $FLUXBOX_DIR/scripts/tc_audio_mp3_icecast-gst1.sh &
 
 sleep 1
 
-$FLUXBOX_DIR/scripts/tc_video_simple_webm_stream-gst1.sh &
+$FLUXBOX_DIR/scripts/tc_video_simple_webm_stream-gst1-h264.sh &
 
 sleep 1