no config only profiles

This commit is contained in:
legop3
2026-11-17 20:51:07 -05:00
parent 14f425744a
commit 0ea99d0158
13 changed files with 99 additions and 131 deletions
+16 -11
View File
@@ -6,7 +6,15 @@
apt-get update && apt-get install -y ffmpeg alsa-utils
fi
run: |
exec ffmpeg -nostdin -f alsa -ar "$ROVER_AUDIO_SAMPLE_RATE" -ac "$ROVER_AUDIO_CHANNELS" -i "$ROVER_AUDIO_INPUT_DEVICE" -c:a libopus -b:a "$ROVER_AUDIO_BITRATE" -f rtsp -rtsp_transport tcp "$ROVER_AUDIO_PUBLISH_URL"
sample_rate=48000
channels=2
bitrate=510000
arecord -D "$ROVER_AUDIO_INPUT_DEVICE" -f S32_LE -c "$channels" -r "$sample_rate" -B 16384 -F 1024 -q -t raw |
ffmpeg -nostdin -hide_banner -loglevel warning -fflags nobuffer \
-rtbufsize 0 -thread_queue_size 4096 -f s32le -ar "$sample_rate" -ac "$channels" -i pipe:0 \
-af "volume=20dB" -c:a libopus -b:a "$bitrate" -ar:a "$sample_rate" -ac:a "$channels" \
-application audio -frame_duration 20 -compression_level 0 \
-flush_packets 1 -muxdelay 0 -muxpreload 0 -f rtsp -rtsp_transport tcp "$ROVER_AUDIO_PUBLISH_URL"
- id: aiy
name: Google AIY Voice HAT microphone
description: HAT capture with S32_LE input, 20 dB microphone boost, and low-latency Opus settings. Reboot once after first enabling its hardware.
@@ -34,15 +42,12 @@
apt-get update && apt-get install -y ffmpeg alsa-utils
fi
run: |
# Preserve the HAT capture format, gain, and low-cost Opus settings.
arecord -D "$ROVER_AUDIO_INPUT_DEVICE" -f S32_LE \
-c "$ROVER_AUDIO_CHANNELS" -r "$ROVER_AUDIO_SAMPLE_RATE" \
-B "${AUDIO_ALSA_BUFFER_BYTES:-16384}" -F "${AUDIO_ALSA_PERIOD_BYTES:-1024}" -q -t raw |
sample_rate=48000
channels=2
bitrate=510000
arecord -D "$ROVER_AUDIO_INPUT_DEVICE" -f S32_LE -c "$channels" -r "$sample_rate" -B 16384 -F 1024 -q -t raw |
ffmpeg -nostdin -hide_banner -loglevel warning -fflags nobuffer \
-rtbufsize 0 -thread_queue_size 4096 -f s32le \
-ar "$ROVER_AUDIO_SAMPLE_RATE" -ac "$ROVER_AUDIO_CHANNELS" -i pipe:0 \
-af "volume=20dB" -c:a libopus -b:a "$ROVER_AUDIO_BITRATE" \
-ar:a "$ROVER_AUDIO_SAMPLE_RATE" -ac:a "$ROVER_AUDIO_CHANNELS" \
-rtbufsize 0 -thread_queue_size 4096 -f s32le -ar "$sample_rate" -ac "$channels" -i pipe:0 \
-af "volume=20dB" -c:a libopus -b:a "$bitrate" -ar:a "$sample_rate" -ac:a "$channels" \
-application audio -frame_duration 20 -compression_level 0 \
-flush_packets 1 -muxdelay 0 -muxpreload 0 \
-f rtsp -rtsp_transport tcp "$ROVER_AUDIO_PUBLISH_URL"
-flush_packets 1 -muxdelay 0 -muxpreload 0 -f rtsp -rtsp_transport tcp "$ROVER_AUDIO_PUBLISH_URL"
+12 -7
View File
@@ -6,9 +6,14 @@
apt-get update && apt-get install -y ffmpeg alsa-utils
fi
run: |
normalize=true
normalize_filter='dynaudnorm=f=75:g=15:m=10:p=0.9,alimiter=limit=0.85:level=disabled'
filters=()
if [ "$ROVER_AUDIO_NORMALIZE" = true ]; then filters=(-af "$ROVER_AUDIO_NORMALIZE_FILTER"); fi
exec ffmpeg -nostdin -rtsp_transport tcp -i "$ROVER_AUDIO_PLAYBACK_URL" -vn "${filters[@]}" -f alsa "$ROVER_AUDIO_OUTPUT_DEVICE"
if [ "$normalize" = true ]; then filters=(-af "$normalize_filter"); fi
ffmpeg -nostdin -hide_banner -loglevel warning -fflags nobuffer -flags low_delay \
-analyzeduration 200k -probesize 32k -rtsp_transport tcp -i "$ROVER_AUDIO_PLAYBACK_URL" \
-vn "${filters[@]}" -ac 1 -ar 16000 -f s16le pipe:1 |
aplay -q -D "$ROVER_AUDIO_OUTPUT_DEVICE" -t raw -f S16_LE -r 16000 -c 1
- id: aiy
name: Google AIY Voice HAT speaker
description: HAT playback with low-latency decoding and 16 kHz mono output through the configured audio route. Reboot once after initial setup.
@@ -36,11 +41,11 @@
apt-get update && apt-get install -y ffmpeg alsa-utils
fi
run: |
normalize=true
normalize_filter='dynaudnorm=f=75:g=15:m=10:p=0.9,alimiter=limit=0.85:level=disabled'
filters=()
if [ "$ROVER_AUDIO_NORMALIZE" = true ]; then filters=(-af "$ROVER_AUDIO_NORMALIZE_FILTER"); fi
# Decode to the same explicit HAT playback format as the previous listener.
if [ "$normalize" = true ]; then filters=(-af "$normalize_filter"); fi
ffmpeg -nostdin -hide_banner -loglevel warning -fflags nobuffer -flags low_delay \
-analyzeduration 200k -probesize 32k -rtsp_transport tcp \
-i "$ROVER_AUDIO_PLAYBACK_URL" -vn "${filters[@]}" \
-ac 1 -ar 16000 -f s16le pipe:1 |
-analyzeduration 200k -probesize 32k -rtsp_transport tcp -i "$ROVER_AUDIO_PLAYBACK_URL" \
-vn "${filters[@]}" -ac 1 -ar 16000 -f s16le pipe:1 |
aplay -q -D "$ROVER_AUDIO_OUTPUT_DEVICE" -t raw -f S16_LE -r 16000 -c 1
+27 -6
View File
@@ -4,9 +4,24 @@
setup: |
command -v ffmpeg >/dev/null || { apt-get update && apt-get install -y ffmpeg; }
run: |
device=/dev/video0
input_format=mjpeg
width=640
height=480
fps=30
bitrate=2000000
inverted=false
input_options=()
if [ -n "$input_format" ]; then input_options=(-input_format "$input_format"); fi
filters=()
if [ "$ROVER_VIDEO_INVERTED" = true ]; then filters=(-vf hflip,vflip); fi
exec ffmpeg -nostdin -f v4l2 -input_format "$ROVER_VIDEO_INPUT_FORMAT" -video_size "${ROVER_VIDEO_WIDTH}x${ROVER_VIDEO_HEIGHT}" -framerate "$ROVER_VIDEO_FPS" -i "$ROVER_VIDEO_DEVICE" "${filters[@]}" -an -c:v libx264 -preset ultrafast -tune zerolatency -pix_fmt yuv420p -b:v "$ROVER_VIDEO_BITRATE" -f rtsp -rtsp_transport tcp "$ROVER_VIDEO_PUBLISH_URL"
if [ "$inverted" = true ]; then filters=(-vf "transpose=2,transpose=2"); fi
exec ffmpeg -nostdin -hide_banner -loglevel warning -fflags nobuffer -flags low_delay \
-thread_queue_size 4096 -f v4l2 "${input_options[@]}" -framerate "$fps" \
-video_size "${width}x${height}" -i "$device" "${filters[@]}" -an \
-c:v libx264 -preset veryfast -tune zerolatency -profile:v baseline -pix_fmt yuv420p \
-b:v "$bitrate" -maxrate "$bitrate" -bufsize "$((bitrate / 2))" \
-g "$fps" -keyint_min "$fps" -sc_threshold 0 -flush_packets 1 -muxdelay 0 -muxpreload 0 \
-f rtsp -rtsp_transport tcp "$ROVER_VIDEO_PUBLISH_URL"
- id: rpicam
name: Raspberry Pi CSI camera
description: rpicam/libcamera H.264 output, republished through ffmpeg.
@@ -17,14 +32,20 @@
apt-get install -y rpicam-apps
fi
run: |
width=640
height=480
fps=30
bitrate=2000000
inverted=true
sensor_mode=1296:972
camera=$(command -v rpicam-vid || command -v libcamera-vid)
options=()
if [ "$ROVER_VIDEO_INVERTED" = true ]; then options+=(--rotation 180); fi
if [ -n "$ROVER_VIDEO_SENSOR_MODE" ]; then options+=(--mode "$ROVER_VIDEO_SENSOR_MODE"); fi
if [ "$inverted" = true ]; then options+=(--rotation 180); fi
if [ -n "$sensor_mode" ]; then options+=(--mode "$sensor_mode"); fi
# Preserve the previous Pi publisher's camera tuning and packet timing.
"$camera" --inline --timeout 0 "${options[@]}" \
--width "$ROVER_VIDEO_WIDTH" --height "$ROVER_VIDEO_HEIGHT" \
--framerate "$ROVER_VIDEO_FPS" --bitrate "$ROVER_VIDEO_BITRATE" \
--width "$width" --height "$height" \
--framerate "$fps" --bitrate "$bitrate" \
--codec h264 --intra 120 --profile baseline --denoise auto --nopreview \
--metering centre --ev 0.1 --awb auto --saturation 0.6 --brightness 0 --output - |
ffmpeg -nostdin -hide_banner -loglevel warning -fflags nobuffer \