mirror of
https://github.com/bluenviron/mediamtx.git
synced 2026-01-09 11:52:02 -08:00
This allows to use the RPI camera on the Raspberry Pi 5 too.
This commit is contained in:
parent
f4051eb63d
commit
41a3fd503d
7 changed files with 71 additions and 57 deletions
|
|
@ -69,14 +69,15 @@ func TestConfFromFile(t *testing.T) {
|
|||
RPICameraDenoise: "off",
|
||||
RPICameraMetering: "centre",
|
||||
RPICameraFPS: 30,
|
||||
RPICameraIDRPeriod: 60,
|
||||
RPICameraBitrate: 1000000,
|
||||
RPICameraProfile: "main",
|
||||
RPICameraLevel: "4.1",
|
||||
RPICameraAfMode: "continuous",
|
||||
RPICameraAfRange: "normal",
|
||||
RPICameraAfSpeed: "normal",
|
||||
RPICameraTextOverlay: "%Y-%m-%d %H:%M:%S - MediaMTX",
|
||||
RPICameraCodec: "auto",
|
||||
RPICameraIDRPeriod: 60,
|
||||
RPICameraBitrate: 1000000,
|
||||
RPICameraProfile: "main",
|
||||
RPICameraLevel: "4.1",
|
||||
RunOnDemandStartTimeout: 5 * StringDuration(time.Second),
|
||||
RunOnDemandCloseAfter: 10 * StringDuration(time.Second),
|
||||
}, pa)
|
||||
|
|
|
|||
|
|
@ -152,10 +152,6 @@ type Path struct {
|
|||
RPICameraTuningFile string `json:"rpiCameraTuningFile"`
|
||||
RPICameraMode string `json:"rpiCameraMode"`
|
||||
RPICameraFPS float64 `json:"rpiCameraFPS"`
|
||||
RPICameraIDRPeriod int `json:"rpiCameraIDRPeriod"`
|
||||
RPICameraBitrate int `json:"rpiCameraBitrate"`
|
||||
RPICameraProfile string `json:"rpiCameraProfile"`
|
||||
RPICameraLevel string `json:"rpiCameraLevel"`
|
||||
RPICameraAfMode string `json:"rpiCameraAfMode"`
|
||||
RPICameraAfRange string `json:"rpiCameraAfRange"`
|
||||
RPICameraAfSpeed string `json:"rpiCameraAfSpeed"`
|
||||
|
|
@ -164,6 +160,11 @@ type Path struct {
|
|||
RPICameraFlickerPeriod int `json:"rpiCameraFlickerPeriod"`
|
||||
RPICameraTextOverlayEnable bool `json:"rpiCameraTextOverlayEnable"`
|
||||
RPICameraTextOverlay string `json:"rpiCameraTextOverlay"`
|
||||
RPICameraCodec string `json:"rpiCameraCodec"`
|
||||
RPICameraIDRPeriod int `json:"rpiCameraIDRPeriod"`
|
||||
RPICameraBitrate int `json:"rpiCameraBitrate"`
|
||||
RPICameraProfile string `json:"rpiCameraProfile"`
|
||||
RPICameraLevel string `json:"rpiCameraLevel"`
|
||||
|
||||
// Hooks
|
||||
RunOnInit string `json:"runOnInit"`
|
||||
|
|
@ -211,14 +212,15 @@ func (pconf *Path) setDefaults() {
|
|||
pconf.RPICameraDenoise = "off"
|
||||
pconf.RPICameraMetering = "centre"
|
||||
pconf.RPICameraFPS = 30
|
||||
pconf.RPICameraIDRPeriod = 60
|
||||
pconf.RPICameraBitrate = 1000000
|
||||
pconf.RPICameraProfile = "main"
|
||||
pconf.RPICameraLevel = "4.1"
|
||||
pconf.RPICameraAfMode = "continuous"
|
||||
pconf.RPICameraAfRange = "normal"
|
||||
pconf.RPICameraAfSpeed = "normal"
|
||||
pconf.RPICameraTextOverlay = "%Y-%m-%d %H:%M:%S - MediaMTX"
|
||||
pconf.RPICameraCodec = "auto"
|
||||
pconf.RPICameraIDRPeriod = 60
|
||||
pconf.RPICameraBitrate = 1000000
|
||||
pconf.RPICameraProfile = "main"
|
||||
pconf.RPICameraLevel = "4.1"
|
||||
|
||||
// Hooks
|
||||
pconf.RunOnDemandStartTimeout = 10 * StringDuration(time.Second)
|
||||
|
|
@ -550,6 +552,11 @@ func (pconf *Path) validate(
|
|||
default:
|
||||
return fmt.Errorf("invalid 'rpiCameraAfSpeed' value")
|
||||
}
|
||||
switch pconf.RPICameraCodec {
|
||||
case "auto", "hardwareH264", "softwareH264":
|
||||
default:
|
||||
return fmt.Errorf("invalid 'rpiCameraCodec' value")
|
||||
}
|
||||
|
||||
// Hooks
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
v2.1.0
|
||||
v2.2.0
|
||||
|
|
|
|||
|
|
@ -25,10 +25,6 @@ type params struct {
|
|||
TuningFile string
|
||||
Mode string
|
||||
FPS float64
|
||||
IDRPeriod int
|
||||
Bitrate int
|
||||
Profile string
|
||||
Level string
|
||||
AfMode string
|
||||
AfRange string
|
||||
AfSpeed string
|
||||
|
|
@ -37,4 +33,9 @@ type params struct {
|
|||
FlickerPeriod int
|
||||
TextOverlayEnable bool
|
||||
TextOverlay string
|
||||
Codec string
|
||||
IDRPeriod int
|
||||
Bitrate int
|
||||
Profile string
|
||||
Level string
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,10 +50,6 @@ func paramsFromConf(logLevel conf.LogLevel, cnf *conf.Path) params {
|
|||
TuningFile: cnf.RPICameraTuningFile,
|
||||
Mode: cnf.RPICameraMode,
|
||||
FPS: cnf.RPICameraFPS,
|
||||
IDRPeriod: cnf.RPICameraIDRPeriod,
|
||||
Bitrate: cnf.RPICameraBitrate,
|
||||
Profile: cnf.RPICameraProfile,
|
||||
Level: cnf.RPICameraLevel,
|
||||
AfMode: cnf.RPICameraAfMode,
|
||||
AfRange: cnf.RPICameraAfRange,
|
||||
AfSpeed: cnf.RPICameraAfSpeed,
|
||||
|
|
@ -62,6 +58,11 @@ func paramsFromConf(logLevel conf.LogLevel, cnf *conf.Path) params {
|
|||
FlickerPeriod: cnf.RPICameraFlickerPeriod,
|
||||
TextOverlayEnable: cnf.RPICameraTextOverlayEnable,
|
||||
TextOverlay: cnf.RPICameraTextOverlay,
|
||||
Codec: cnf.RPICameraCodec,
|
||||
IDRPeriod: cnf.RPICameraIDRPeriod,
|
||||
Bitrate: cnf.RPICameraBitrate,
|
||||
Profile: cnf.RPICameraProfile,
|
||||
Level: cnf.RPICameraLevel,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue