mirror of https://bitbucket.org/ausocean/av.git
Two different outputs rather than rtmp output and two different methods
This commit is contained in:
parent
093df161f1
commit
3e9d7ef523
|
@ -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")
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue