VIDEO_WIDTH=848
VIDEO_HEIGHT=480
VIDEO_FRAMERATE=24
-VIDEO_FLIP=none
+VIDEO_FLIP=rotate-180
# Audio
AUDIO_CHANNELS=2
AUDIO_OPUS_BITRATE=96000
+AUDIO_MP3_QUALITY="4.0"
\ No newline at end of file
-#!/bin/sh
+#!/usr/bin/env bash
+set -e
+
+# Audio
AUDIO_CHANNELS=2
+AUDIO_OPUS_BITRATE=96000
+AUDIO_MP3_QUALITY="4.0"
-if [ -f .env ]; then
- source .env
+LOCAL_DIR=$(dirname "$0")
+if [ -f $LOCAL_DIR/.env ]; then
+ source $LOCAL_DIR/.env
fi
+# GST launch
gst-launch-1.0 jackaudiosrc connect=$AUDIO_CHANNELS ! audio/x-raw, format=F32LE, channels=$AUDIO_CHANNELS \
! queue ! audioconvert \
! queue ! rgvolume pre-amp=12.0 \
! queue ! audiodynamic characteristics=soft-knee mode=compressor threshold=0.25 ratio=4.0 \
! queue ! rgvolume pre-amp=12.0 \
! queue ! rglimiter \
- ! queue ! audioconvert ! queue ! lamemp3enc quality=4.0 \
+ ! queue ! audioconvert ! queue ! lamemp3enc quality=$AUDIO_MP3_QUALITY \
! queue ! shout2send ip=127.0.0.1 port=8000 password=source2parisson mount=telecaster_live.mp3
> /dev/null
AUDIO_CHANNELS=2
AUDIO_OPUS_BITRATE=96000
-if [ -f .env ]; then
- source .env
+LOCAL_DIR=$(dirname "$0")
+if [ -f $LOCAL_DIR/.env ]; then
+ source $LOCAL_DIR/.env
fi
+# 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=128
-# ! queue ! videoflip method=rotate-180 \
-
+# GST launch
gst-launch-1.0 v4l2src device=/dev/video$V4L2_ID ! video/x-raw, format=YUY2, width=$VIDEO_WIDTH, height=$VIDEO_HEIGHT, framerate=$VIDEO_FRAMERATE/1 \
! queue ! videoflip method=$VIDEO_FLIP \
! queue ! videoconvert \