mirror of https://bitbucket.org/ausocean/av.git
revid: created CameraChan config field to allow selection of GeoVision camera channel
This commit is contained in:
parent
f74e3a3d7c
commit
f1c0fc1dbf
|
@ -118,6 +118,7 @@ const (
|
|||
defaultVBRQuality = qualityStandard
|
||||
defaultBurstPeriod = 10 // Seconds
|
||||
defaultVBRBitrate = 500 // kbps
|
||||
defaultCameraChan = 2
|
||||
|
||||
// Raspivid video defaults.
|
||||
defaultBrightness = 50
|
||||
|
@ -241,6 +242,9 @@ type Config struct {
|
|||
// variable bitrate.
|
||||
VBRBitrate int
|
||||
|
||||
// This is the channel we're using for the GeoVision camera.
|
||||
CameraChan int
|
||||
|
||||
// MinFrames defines the frequency of key NAL units SPS, PPS and IDR in
|
||||
// number of NAL units. This will also determine the frequency of PSI if the
|
||||
// output container is MPEG-TS. If ClipDuration is less than MinFrames,
|
||||
|
@ -525,6 +529,11 @@ func (c *Config) Validate() error {
|
|||
c.VBRBitrate = defaultVBRBitrate
|
||||
}
|
||||
|
||||
if c.CameraChan != 1 && c.CameraChan != 2 {
|
||||
c.Logger.Log(logger.Info, pkg+"CamChan bad or unset, defaulting", "CamChan", defaultCameraChan)
|
||||
c.CameraChan = defaultCameraChan
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -188,6 +188,7 @@ func (r *Revid) startRTSPCamera() (func() error, error) {
|
|||
|
||||
err := gvctrl.Set(
|
||||
r.config.CameraIP,
|
||||
gvctrl.Channel(r.config.CameraChan),
|
||||
gvctrl.CodecOut(
|
||||
map[uint8]gvctrl.Codec{
|
||||
codecutil.H264: gvctrl.CodecH264,
|
||||
|
|
|
@ -645,6 +645,13 @@ func (r *Revid) Update(vars map[string]string) error {
|
|||
break
|
||||
}
|
||||
r.config.VBRBitrate = v
|
||||
case "CameraChan":
|
||||
v, err := strconv.Atoi(value)
|
||||
if err != nil || (v != 1 && v != 2) {
|
||||
r.config.Logger.Log(logger.Warning, pkg+"invalid CameraChan var", "value", value)
|
||||
break
|
||||
}
|
||||
r.config.CameraChan = v
|
||||
}
|
||||
}
|
||||
r.config.Logger.Log(logger.Info, pkg+"revid config changed", "config", fmt.Sprintf("%+v", r.config))
|
||||
|
|
Loading…
Reference in New Issue