mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-11-17 04:02:21 -05:00
streamer movement
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
- id: alsa
|
||||
name: ALSA microphone
|
||||
description: Uses the configured audio input device through roverd's ALSA conversion route.
|
||||
setup: |
|
||||
if ! command -v ffmpeg >/dev/null || ! command -v arecord >/dev/null; then
|
||||
apt-get update && apt-get install -y ffmpeg alsa-utils
|
||||
fi
|
||||
run: &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"
|
||||
- id: aiy
|
||||
name: Google AIY Voice HAT microphone
|
||||
description: Same configurable ALSA route; setup enables the HAT overlay. Reboot once after first enabling its hardware.
|
||||
setup: |
|
||||
set -euo pipefail
|
||||
# Capture/playback setup may run concurrently; serialize edits to boot config.
|
||||
exec 9>/var/lock/roverd-aiy.lock
|
||||
flock 9
|
||||
boot=/boot/firmware/config.txt
|
||||
[[ -f "$boot" ]] || boot=/boot/config.txt
|
||||
[[ -f "$boot" ]] || { echo 'AIY setup needs a Raspberry Pi boot config.txt' >&2; exit 1; }
|
||||
changed=0
|
||||
for setting in dtparam=i2s=on dtoverlay=googlevoicehat-soundcard; do
|
||||
if ! grep -Fxq "$setting" "$boot"; then
|
||||
printf '\n%s\n' "$setting" >> "$boot"
|
||||
changed=1
|
||||
fi
|
||||
done
|
||||
if [[ "$changed" == 1 ]]; then
|
||||
echo 'AIY hardware enabled. Reboot the host once before using this sound card.'
|
||||
fi
|
||||
if ! command -v ffmpeg >/dev/null || ! command -v aplay >/dev/null; then
|
||||
apt-get update && apt-get install -y ffmpeg alsa-utils
|
||||
fi
|
||||
run: *run
|
||||
@@ -0,0 +1,36 @@
|
||||
- id: alsa
|
||||
name: ALSA speaker
|
||||
description: Uses the configured output alongside TTS and horn with independent volume controls.
|
||||
setup: |
|
||||
if ! command -v ffmpeg >/dev/null || ! command -v aplay >/dev/null; then
|
||||
apt-get update && apt-get install -y ffmpeg alsa-utils
|
||||
fi
|
||||
run: &run |
|
||||
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"
|
||||
- id: aiy
|
||||
name: Google AIY Voice HAT speaker
|
||||
description: Enables the HAT hardware; uses the same configured ALSA routing as other devices. Reboot once after initial setup.
|
||||
setup: |
|
||||
set -euo pipefail
|
||||
# Capture/playback setup may run concurrently; serialize edits to boot config.
|
||||
exec 9>/var/lock/roverd-aiy.lock
|
||||
flock 9
|
||||
boot=/boot/firmware/config.txt
|
||||
[[ -f "$boot" ]] || boot=/boot/config.txt
|
||||
[[ -f "$boot" ]] || { echo 'AIY setup needs a Raspberry Pi boot config.txt' >&2; exit 1; }
|
||||
changed=0
|
||||
for setting in dtparam=i2s=on dtoverlay=googlevoicehat-soundcard; do
|
||||
if ! grep -Fxq "$setting" "$boot"; then
|
||||
printf '\n%s\n' "$setting" >> "$boot"
|
||||
changed=1
|
||||
fi
|
||||
done
|
||||
if [[ "$changed" == 1 ]]; then
|
||||
echo 'AIY hardware enabled. Reboot the host once before using this sound card.'
|
||||
fi
|
||||
if ! command -v ffmpeg >/dev/null || ! command -v aplay >/dev/null; then
|
||||
apt-get update && apt-get install -y ffmpeg alsa-utils
|
||||
fi
|
||||
run: *run
|
||||
@@ -0,0 +1,25 @@
|
||||
- id: v4l2
|
||||
name: V4L2 camera
|
||||
description: USB or other Linux V4L2 camera, encoded with software H.264.
|
||||
setup: |
|
||||
command -v ffmpeg >/dev/null || { apt-get update && apt-get install -y ffmpeg; }
|
||||
run: |
|
||||
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"
|
||||
- id: rpicam
|
||||
name: Raspberry Pi CSI camera
|
||||
description: rpicam/libcamera H.264 output, republished through ffmpeg.
|
||||
setup: |
|
||||
command -v ffmpeg >/dev/null || { apt-get update && apt-get install -y ffmpeg; }
|
||||
if ! command -v rpicam-vid >/dev/null && ! command -v libcamera-vid >/dev/null; then
|
||||
apt-get update
|
||||
apt-get install -y rpicam-apps
|
||||
fi
|
||||
run: |
|
||||
camera=$(command -v rpicam-vid || command -v libcamera-vid)
|
||||
options=()
|
||||
if [ "$ROVER_VIDEO_INVERTED" = true ]; then options+=(--hflip --vflip); fi
|
||||
if [ -n "$ROVER_VIDEO_SENSOR_MODE" ]; then options+=(--mode "$ROVER_VIDEO_SENSOR_MODE"); fi
|
||||
"$camera" --timeout 0 --nopreview --inline --codec h264 --width "$ROVER_VIDEO_WIDTH" --height "$ROVER_VIDEO_HEIGHT" --framerate "$ROVER_VIDEO_FPS" --bitrate "$ROVER_VIDEO_BITRATE" "${options[@]}" -o - |
|
||||
ffmpeg -nostdin -fflags +genpts -f h264 -i pipe:0 -c:v copy -an -f rtsp -rtsp_transport tcp "$ROVER_VIDEO_PUBLISH_URL"
|
||||
Reference in New Issue
Block a user