diff --git a/revid/config/config.go b/revid/config/config.go index 9a19f4ab..fd9c2fcf 100644 --- a/revid/config/config.go +++ b/revid/config/config.go @@ -292,6 +292,7 @@ var TypeData = map[string]string{ "MTSRBSize": "int", "MTSRBWriteTimeout": "int", "OutputPath": "string", + "Output": "enum:File,Http,Rtmp,Rtp", "Outputs": "string", "Quantization": "uint", "Rotation": "uint", diff --git a/revid/revid.go b/revid/revid.go index 8389939f..6d2832a3 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -523,7 +523,7 @@ func (r *Revid) Update(vars map[string]string) error { default: r.cfg.Logger.Log(logger.Warning, pkg+"invalid InputCodec variable value", "value", value) } - case "Output": + case "Outputs": outputs := strings.Split(value, ",") r.cfg.Outputs = make([]uint8, len(outputs)) @@ -538,10 +538,25 @@ func (r *Revid) Update(vars map[string]string) error { case "Rtp": r.cfg.Outputs[i] = config.OutputRTP default: - r.cfg.Logger.Log(logger.Warning, pkg+"invalid output param", "value", value) + r.cfg.Logger.Log(logger.Warning, pkg+"invalid outputs param", "value", value) continue } } + case "Output": + r.cfg.Outputs = make([]uint8, 1) + switch value { + case "File": + r.cfg.Outputs[0] = config.OutputFile + case "Http": + r.cfg.Outputs[0] = config.OutputHTTP + case "Rtmp": + r.cfg.Outputs[0] = config.OutputRTMP + case "Rtp": + r.cfg.Outputs[0] = config.OutputRTP + default: + r.cfg.Logger.Log(logger.Warning, pkg+"invalid output param", "value", value) + continue + } case "RtmpUrl": r.cfg.RTMPURL = value