# HausBots robot camera server (MediaMTX v1.21.0).
# Replace the PTZ source below with the camera's real RTSP URL before starting.
# Verify it first from the robot: ffprobe -rtsp_transport tcp <url>
rtsp: yes
rtspAddress: :8554
# RTSP only: the other servers are off so MediaMTX never generates a TLS cert.
hls: no
webrtc: no
rtmp: no
moq: no
api: no
metrics: no
pprof: no

paths:
  # USB camera, published as H.264. Must stay on one line.
  # This pipeline publishes from MediaMTX start and runs continuously while
  # the service is up (runOnInit) — not only while a client is watching.
  # MJPEG decode is software here (~17% of one core at 720p30); the hardware
  # JPEG decoder stalls on this kernel, so keep jpegdec.
  static:
    runOnInit: gst-launch-1.0 -e v4l2src device=/dev/video0 ! image/jpeg,width=1280,height=720,framerate=30/1 ! jpegdec ! videoconvert ! v4l2h264enc extra-controls="controls,h264_i_frame_period=30,video_bitrate=2500000" ! h264parse config-interval=1 ! rtspclientsink location=rtsp://127.0.0.1:8554/static
    runOnInitRestart: yes
  # PTZ camera, forwarded untouched (no decode, no re-encode).
  # sourceOnDemand opens the camera only while someone is watching.
  ptz:
    source: rtsp://<PTZ-CAMERA-IP>/stream-1.sdp
    sourceOnDemand: yes
    sourceOnDemandCloseAfter: 30s
