Two different outputs rather than rtmp output and two different methods

This commit is contained in:
Saxon Milton 2018-04-16 14:55:28 +09:30
parent 093df161f1
commit 3e9d7ef523
2 changed files with 15 additions and 11 deletions

View File

@ -82,6 +82,7 @@ const (
QuantizationOff = 16
Yes = 17
No = 18
NativeRtmp = 19
)
// Default config settings
@ -169,7 +170,13 @@ func (config *Config) Validate(r *revid) error {
switch config.Output {
case Http:
case File:
case Rtmp:
case NativeRtmp:
if config.RtmpUrl == "" {
return errors.New("Bad RTMP URL")
}
r.Log(Info, "Defaulting frames per clip to 1 for rtmp output!")
config.FramesPerClip = 1
case FfmpegRtmp:
if config.RtmpUrl == "" {
return errors.New("Bad RTMP URL")
}

View File

@ -154,15 +154,12 @@ func (r *revid) changeState(config Config) error {
case File:
r.sendClip = r.sendClipToFile
r.setupOutput = r.setupOutputForFile
case Rtmp:
switch r.config.RtmpMethod {
case Ffmpeg:
case FfmpegRtmp:
r.setupOutput = r.setupOutputForFfmpegRtmp
r.sendClip = r.sendClipToFfmpegRtmp
case LibRtmp:
case NativeRtmp:
r.setupOutput = r.setupOutputForLibRtmp
r.sendClip = r.sendClipToLibRtmp
}
case Http:
r.sendClip = r.sendClipToHTTP
}
@ -366,7 +363,7 @@ func (r *revid) outputClips() {
break
}
r.Log(Error, err.Error())
if r.config.RtmpMethod == LibRtmp && errorCount > 5 {
if r.config.Output == NativeRtmp && errorCount > 5 {
reboot()
}
}