- 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: | 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 [ "$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: 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: | width=640 height=480 fps=30 bitrate=2000000 rpicam-vid --inline --timeout 0 --rotation 180 --mode 1296:972 \ --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 \ -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"