diff --git a/internal/conf/path.go b/internal/conf/path.go index df06137f..a89719a2 100644 --- a/internal/conf/path.go +++ b/internal/conf/path.go @@ -494,6 +494,18 @@ func (pconf *Path) validate( return fmt.Errorf("invalid 'rpiCameraAfSpeed' value") } + switch pconf.RPICameraProfile { + case "baseline", "main", "high": + default: + return fmt.Errorf("invalid 'rpiCameraProfile' value") + } + + switch pconf.RPICameraLevel { + case "4.0", "4.1", "4.2": + default: + return fmt.Errorf("invalid 'rpiCameraLevel' value") + } + if !pconf.RPICameraSecondary { switch pconf.RPICameraCodec { case "auto", "hardwareH264", "softwareH264": diff --git a/mediamtx.yml b/mediamtx.yml index b5b33c6e..890597c6 100644 --- a/mediamtx.yml +++ b/mediamtx.yml @@ -562,22 +562,20 @@ pathDefaults: # values: normal, short, long, custom. rpiCameraExposure: normal # Auto-white-balance mode. - # values: auto, incandescent, tungsten, fluorescent, indoor, daylight, cloudy, custom. + # (auto, incandescent, tungsten, fluorescent, indoor, daylight, cloudy or custom). rpiCameraAWB: auto # Auto-white-balance fixed gains. This can be used in place of rpiCameraAWB. # format: [red,blue]. rpiCameraAWBGains: [0, 0] - # Denoise operating mode. - # values: off, cdn_off, cdn_fast, cdn_hq. + # Denoise operating mode (off, cdn_off, cdn_fast, cdn_hq). rpiCameraDenoise: "off" # Fixed shutter speed, in microseconds. rpiCameraShutter: 0 - # Metering mode of the AEC/AGC algorithm. - # values: centre, spot, matrix, custom. + # Metering mode of the AEC/AGC algorithm (centre, spot, matrix or custom). rpiCameraMetering: centre # Fixed gain. rpiCameraGain: 0 - # EV compensation of the image [-10, 10]. + # EV compensation of the image in range [-10, 10]. rpiCameraEV: 0 # Region of interest, in format x,y,width,height (all normalized between 0 and 1). rpiCameraROI: @@ -590,14 +588,11 @@ pathDefaults: rpiCameraMode: # frames per second. rpiCameraFPS: 30 - # Autofocus mode. - # values: auto, manual, continuous. + # Autofocus mode (auto, manual or continuous). rpiCameraAfMode: continuous - # Autofocus range. - # values: normal, macro, full. + # Autofocus range (normal, macro or full). rpiCameraAfRange: normal - # Autofocus speed. - # values: normal, fast. + # Autofocus speed (normal or fast). rpiCameraAfSpeed: normal # Lens position (for manual autofocus only), will be set to focus to a specific distance # calculated by the following formula: d = 1 / value @@ -605,7 +600,7 @@ pathDefaults: # 0.5 moves the lens to focus on objects 2m away. # 2 moves the lens to focus on objects 50cm away. rpiCameraLensPosition: 0.0 - # Specifies the autofocus window, in the form x,y,width,height where the coordinates + # Autofocus window, in the form x,y,width,height where the coordinates # are given as a proportion of the entire image. rpiCameraAfWindow: # Manual flicker correction period, in microseconds. @@ -615,15 +610,16 @@ pathDefaults: # Text that is printed on each frame. # format is the one of the strftime() function. rpiCameraTextOverlay: '%Y-%m-%d %H:%M:%S - MediaMTX' - # Codec. Available values: auto, hardwareH264, softwareH264, mjpeg. + # Codec (auto, hardwareH264, softwareH264 or mjpeg). + # When auto, hardwareH264 is used if the Raspberry has a H264 encoder, otherwise softwareH264. rpiCameraCodec: auto - # Period between H264 IDR frames. + # Period between IDR frames (when codec is hardwareH264 or softwareH264). rpiCameraIDRPeriod: 60 - # H264 Bitrate. + # Bitrate (when codec is hardwareH264 or softwareH264). rpiCameraBitrate: 5000000 - # H264 profile. + # H264 profile (baseline, main or high). rpiCameraProfile: main - # H264 level. + # H264 level (4.0, 4.1 or 4.2). rpiCameraLevel: '4.1' # JPEG quality. rpiCameraJPEGQuality: 60