mirror of https://bitbucket.org/ausocean/av.git
Merge branch 'RevidCLI' of https://bitbucket.org/ausocean/av/src into RevidCLI
This commit is contained in:
commit
78d42be3ba
|
@ -30,6 +30,7 @@ package revid
|
|||
import (
|
||||
"errors"
|
||||
"strconv"
|
||||
"fmt"
|
||||
|
||||
"bitbucket.org/ausocean/utils/smartLogger"
|
||||
//"../../utils/smartLogger"
|
||||
|
@ -57,6 +58,7 @@ type Config struct {
|
|||
Quantization string
|
||||
Timeout string
|
||||
IntraRefreshPeriod string
|
||||
Rotate string
|
||||
Logger smartLogger.LogInstance
|
||||
}
|
||||
|
||||
|
@ -275,7 +277,7 @@ func (config *Config) Validate(r *revid) error {
|
|||
}
|
||||
}
|
||||
|
||||
if config.Rotate = "" {
|
||||
if config.Rotate == "" {
|
||||
r.Log(Warning, fmt.Sprintf("No rotate defined defaulting to: %v", defaultRotate) )
|
||||
r.config.Rotate = defaultRotate
|
||||
} else {
|
||||
|
|
|
@ -279,6 +279,7 @@ func (r *revid) Stop() {
|
|||
if r.cmd != nil && r.cmd.Process != nil {
|
||||
r.cmd.Process.Kill()
|
||||
}
|
||||
r.rtmpInst.EndSession()
|
||||
}
|
||||
|
||||
// getFrameNoPacketization gets a frame directly from the revid output chan
|
||||
|
@ -505,10 +506,10 @@ func (r *revid) setupOutputForFfmpegRtmp() error {
|
|||
// setupOutputForLibRtmp sets up rtmp output using the wrapper for the c based
|
||||
// librtmp library - makes connection and starts comms etc.
|
||||
func (r *revid) setupOutputForLibRtmp() error {
|
||||
for r.rtmpInst = rtmp.NewRTMPSession(r.config.RtmpUrl, rtmpConnectionTimout),
|
||||
err = r.rtmpInst.StartSession(), noOfTries := 0;
|
||||
err != nil && noOfTries < rtmpConnectionMaxTries; noOfTries++
|
||||
{
|
||||
r.rtmpInst = rtmp.NewRTMPSession(r.config.RtmpUrl, rtmpConnectionTimout)
|
||||
err := r.rtmpInst.StartSession()
|
||||
for noOfTries := 0; err != nil && noOfTries < rtmpConnectionMaxTries; noOfTries++ {
|
||||
r.rtmpInst.EndSession()
|
||||
r.Log(Error, err.Error())
|
||||
r.Log(Info, "Trying to establish rtmp connection again!")
|
||||
r.rtmpInst = rtmp.NewRTMPSession(r.config.RtmpUrl, rtmpConnectionTimout)
|
||||
|
|
Loading…
Reference in New Issue