Files
MultiRoombaRover/rover/profiles/video.yaml
T
2026-11-19 13:25:59 -05:00

33 lines
1.7 KiB
YAML

- id: v4l2
name: V4L2 camera (generic, NO hardware encoding, only use for testing...)
description: USB or other Linux V4L2 camera, encoded with software H.264.
setup: |
if ! command -v ffmpeg >/dev/null; then
apt-get update && apt-get install -y ffmpeg
fi
run: |
exec ffmpeg -nostdin -hide_banner -loglevel warning -fflags nobuffer -flags low_delay \
-thread_queue_size 4096 -f v4l2 -input_format mjpeg -framerate 30 \
-video_size 640x480 -i /dev/video0 -an \
-c:v libx264 -preset veryfast -tune zerolatency -profile:v baseline -pix_fmt yuv420p \
-b:v 2000000 -maxrate 2000000 -bufsize 1000000 \
-g 30 -keyint_min 30 -sc_threshold 0 -flush_packets 1 -muxdelay 0 -muxpreload 0 \
-f rtsp -rtsp_transport tcp "$ROVER_VIDEO_PUBLISH_URL"
- id: rpicam
name: Pi Zero 2 W Camera v2 (Carpet's Rovers)
description: Inverted Camera Module v2 on a Pi Zero 2 W, with H.264 republished through ffmpeg.
setup: |
if ! command -v ffmpeg >/dev/null || ! command -v rpicam-vid >/dev/null; then
apt-get update && apt-get install -y ffmpeg rpicam-apps
fi
run: |
rpicam-vid --inline --timeout 0 --rotation 180 --mode 1296:972 \
--width 640 --height 480 \
--framerate 30 --bitrate 2000000 \
--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 \
-use_wallclock_as_timestamps 1 -f h264 -i pipe:0 -c:v copy -an \
-flush_packets 1 -muxdelay 0 -muxpreload 0 \
-f rtsp -rtsp_transport tcp "$ROVER_VIDEO_PUBLISH_URL"