From 9d1d2914a4d34e921f8b8210f441cb0f54c071bf Mon Sep 17 00:00:00 2001 From: Saxon Date: Sat, 2 Mar 2019 13:46:43 +1030 Subject: [PATCH 01/15] cmd/revid-cli: removing fatal error if we get an error during run() --- cmd/revid-cli/main.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/revid-cli/main.go b/cmd/revid-cli/main.go index 056687de..da9f5e73 100644 --- a/cmd/revid-cli/main.go +++ b/cmd/revid-cli/main.go @@ -100,9 +100,7 @@ func main() { return } - if err := run(cfg); err != nil { - log.Log(logger.Fatal, pkg+"failed to run revid", "error", err.Error()) - } + run(cfg) } // handleFlags parses command line flags and returns a revid configuration From 01474ee87026df594531b18ab53d335aa12b0c22 Mon Sep 17 00:00:00 2001 From: Saxon Date: Sat, 2 Mar 2019 14:54:49 +1030 Subject: [PATCH 02/15] cmd/revid-cli: made general changes to make revi-cli more robust i.e. not so trigger happy with fatals --- cmd/revid-cli/main.go | 92 +++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 51 deletions(-) diff --git a/cmd/revid-cli/main.go b/cmd/revid-cli/main.go index da9f5e73..468b89d3 100644 --- a/cmd/revid-cli/main.go +++ b/cmd/revid-cli/main.go @@ -45,14 +45,6 @@ import ( "bitbucket.org/ausocean/utils/logger" ) -const ( - // progName is the program name for logging purposes. - progName = "revid-cli" - - // Logging is set to INFO level. - defaultLogVerbosity = logger.Info -) - // Revid modes const ( normal = "Normal" @@ -62,17 +54,19 @@ const ( // Other misc consts const ( - netSendRetryTime = 5 * time.Second - defaultRunDuration = 24 * time.Hour - revidStopTime = 5 * time.Second - defaultLogPath = "/var/log/netsender" - pkg = "revid-cli:" + netSendRetryTime = 5 * time.Second + defaultRunDuration = 24 * time.Hour + revidStopTime = 5 * time.Second + defaultLogPath = "/var/log/netsender" + pkg = "revid-cli:" + defaultLogVerbosity = logger.Info + defaultSleepTime = 60 // Seconds ) // canProfile is set to false with revid-cli is built with "-tags profile". var canProfile = true -// The logger that will be used throughout +// The logger that will be used throughout. var log *logger.Logger const ( @@ -265,16 +259,17 @@ func handleFlags() revid.Config { } // initialize then run the main NetSender client -func run(cfg revid.Config) error { +func run(cfg revid.Config) { log.Log(logger.Info, pkg+"running in NetSender mode") - var vars map[string]string - var rv *revid.Revid readPin := func(pin *netsender.Pin) error { switch { case pin.Name == "X23": + if rv == nil { + pin.Value = 0 + } pin.Value = rv.Bitrate() case pin.Name[0] == 'X': return sds.ReadSystem(pin) @@ -286,35 +281,10 @@ func run(cfg revid.Config) error { ns, err := netsender.New(log, nil, readPin, nil) if err != nil { - return err - } - - rv, err = revid.New(cfg, ns) - if err != nil { - log.Log(logger.Fatal, pkg+"could not initialise revid", "error", err.Error()) - } - - vars, _ = ns.Vars() - vs := ns.VarSum() - - // Update revid to get latest config settings from netreceiver. - err = rv.Update(vars) - if err != nil { - return err - } - - // If mode on netreceiver isn't paused then we can start revid. - if ns.Mode() != paused && ns.Mode() != burst { - err = rv.Start() - if err != nil { - return err - } - } - - if ns.Mode() == burst { - ns.SetMode(paused, &vs) + log.Log(logger.Fatal, pkg+"could not initialise netsender client") } + var vs int for { err = ns.Run() if err != nil { @@ -323,10 +293,13 @@ func run(cfg revid.Config) error { continue } - // If var sum hasn't change we continue - if vs == ns.VarSum() { + // If var sum hasn't changed we continue. + var vars map[string]string + newVs := ns.VarSum() + if vs == newVs { goto sleep } + vs = newVs vars, err = ns.Vars() if err != nil { @@ -334,35 +307,52 @@ func run(cfg revid.Config) error { time.Sleep(netSendRetryTime) continue } - vs = ns.VarSum() + + if rv == nil { + rv, err = revid.New(cfg, ns) + if err != nil { + log.Log(logger.Error, pkg+"could not initialise revid", "error", err.Error()) + goto sleep + } + } err = rv.Update(vars) if err != nil { - return err + log.Log(logger.Error, pkg+"Couldn't update revid", "error", err.Error()) + goto sleep } switch ns.Mode() { case paused: + rv.Stop() case normal: err = rv.Start() if err != nil { - return err + log.Log(logger.Error, pkg+"could not start revid", "error", err.Error()) + ns.SetMode(paused, &vs) + goto sleep } case burst: log.Log(logger.Info, pkg+"Starting burst...") + err = rv.Start() if err != nil { - return err + log.Log(logger.Error, pkg+"could not start burst", "error", err.Error()) + ns.SetMode(paused, &vs) + goto sleep } + time.Sleep(time.Duration(rv.Config().BurstPeriod) * time.Second) log.Log(logger.Info, pkg+"Stopping burst...") rv.Stop() ns.SetMode(paused, &vs) } + sleep: sleepTime, err := strconv.Atoi(ns.Param("mp")) if err != nil { - return err + log.Log(logger.Error, pkg+"could not get sleep time, using default") + sleepTime = defaultSleepTime } time.Sleep(time.Duration(sleepTime) * time.Second) } From 562c8effc333865614ba87cd67d2b38bba99e4a8 Mon Sep 17 00:00:00 2001 From: Saxon Date: Sat, 2 Mar 2019 15:23:33 +1030 Subject: [PATCH 03/15] cmd/revid-cli: adjusted logging levels to make more appropriate --- cmd/revid-cli/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/revid-cli/main.go b/cmd/revid-cli/main.go index 468b89d3..59c9b00e 100644 --- a/cmd/revid-cli/main.go +++ b/cmd/revid-cli/main.go @@ -311,14 +311,14 @@ func run(cfg revid.Config) { if rv == nil { rv, err = revid.New(cfg, ns) if err != nil { - log.Log(logger.Error, pkg+"could not initialise revid", "error", err.Error()) + log.Log(logger.Warning, pkg+"could not initialise revid", "error", err.Error()) goto sleep } } err = rv.Update(vars) if err != nil { - log.Log(logger.Error, pkg+"Couldn't update revid", "error", err.Error()) + log.Log(logger.Warning, pkg+"Couldn't update revid", "error", err.Error()) goto sleep } @@ -328,7 +328,7 @@ func run(cfg revid.Config) { case normal: err = rv.Start() if err != nil { - log.Log(logger.Error, pkg+"could not start revid", "error", err.Error()) + log.Log(logger.Warning, pkg+"could not start revid", "error", err.Error()) ns.SetMode(paused, &vs) goto sleep } @@ -337,7 +337,7 @@ func run(cfg revid.Config) { err = rv.Start() if err != nil { - log.Log(logger.Error, pkg+"could not start burst", "error", err.Error()) + log.Log(logger.Warning, pkg+"could not start burst", "error", err.Error()) ns.SetMode(paused, &vs) goto sleep } From d5af370d7121a6e0c4fc9f3abd53458ee552228e Mon Sep 17 00:00:00 2001 From: Saxon Date: Sat, 2 Mar 2019 20:46:12 +1030 Subject: [PATCH 04/15] cmd/revid-cli: corrected value assignment for an undefined pin when revid is not yet initialised --- cmd/revid-cli/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/revid-cli/main.go b/cmd/revid-cli/main.go index 59c9b00e..625d9356 100644 --- a/cmd/revid-cli/main.go +++ b/cmd/revid-cli/main.go @@ -268,7 +268,7 @@ func run(cfg revid.Config) { switch { case pin.Name == "X23": if rv == nil { - pin.Value = 0 + pin.Value = -1 } pin.Value = rv.Bitrate() case pin.Name[0] == 'X': From 36182d7e6dcb26002589f394fdce7114e71fb2c7 Mon Sep 17 00:00:00 2001 From: Alan Noble Date: Sat, 2 Mar 2019 11:40:54 +0000 Subject: [PATCH 05/15] Make pi the owner of netsender.conf and install syncreboot. --- init/Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/init/Makefile b/init/Makefile index 5da13286..787d3149 100644 --- a/init/Makefile +++ b/init/Makefile @@ -1,16 +1,18 @@ # install files and directories required by NetSender clients (such as gpio-netsender, revid-cli, etc.) # NB: the default (soft) install does not override conf files USER := $(shell whoami) +PATH := /usr/local/go/bin:$(PATH) .SILENT:make_dirs .SILENT:soft_copy_files .SILENT:hard_copy_files +.SILENT:syncreboot .SILENT:clean -install: as_root make_dirs soft_copy_files +install: as_root make_dirs soft_copy_files syncreboot @echo "Install complete" -install_hard: as_root make_dirs hard_copy_files +install_hard: as_root make_dirs hard_copy_files syncreboot @echo "Hard install complete" as_root: @@ -38,6 +40,7 @@ soft_copy_files: echo "/etc/netsender.conf left unmodified" ; \ else \ cp netsender.conf /etc; \ + chown pi /etc/netsender.conf; \ fi hard_copy_files: @@ -51,6 +54,10 @@ hard_copy_files: cp /etc/netsender.conf /etc/netsender.conf.bak ; \ fi cp -f netsender.conf /etc + chown pi /etc/netsender.conf + +syncreboot: + cd ../../utils/cmd/syncreboot; make; make install clean: as_root rm -rf /var/netsender From cb206ff92b0631afd5c8b571dacab5d7fd797546 Mon Sep 17 00:00:00 2001 From: Saxon Date: Sun, 3 Mar 2019 13:35:25 +1030 Subject: [PATCH 06/15] revid: adjust ringBuffer element size for flv --- revid/revid.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/revid/revid.go b/revid/revid.go index 0ffdd46c..24f62c23 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -54,7 +54,7 @@ const ( mtsRbSize = 100 mtsRbElementSize = 150000 flvRbSize = 1000 - flvRbElementSize = 10000 + flvRbElementSize = 100000 writeTimeout = 10 * time.Millisecond readTimeout = 10 * time.Millisecond ) From b5954d3f5371b358d86120e3117cc7c31242924f Mon Sep 17 00:00:00 2001 From: Saxon Date: Sun, 3 Mar 2019 13:46:02 +1030 Subject: [PATCH 07/15] revid: if start not successfull stop is called to stop output clips routine --- revid/revid.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/revid/revid.go b/revid/revid.go index 24f62c23..22f094ee 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -355,6 +355,9 @@ func (r *Revid) Start() error { go r.outputClips() r.config.Logger.Log(logger.Info, pkg+"setting up input and receiving content") err := r.setupInput() + if err != nil { + r.Stop() + } return err } From b92466bab8117ee4f5133103e0becb08d840e888 Mon Sep 17 00:00:00 2001 From: Saxon Date: Sun, 3 Mar 2019 16:38:03 +1030 Subject: [PATCH 08/15] revid: defaulting to sendRetry on for Rtmp output --- revid/config.go | 5 +++-- revid/revid.go | 11 ++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/revid/config.go b/revid/config.go index 77226520..b3d91964 100644 --- a/revid/config.go +++ b/revid/config.go @@ -57,8 +57,8 @@ type Config struct { FramesPerClip uint RtmpUrl string Bitrate uint - OutputPath string - InputPath string + OutputPath string + InputPath string Height uint Width uint FrameRate uint @@ -187,6 +187,7 @@ func (c *Config) Validate(r *Revid) error { "framesPerClip", defaultFramesPerClip) c.FramesPerClip = defaultFramesPerClip c.Packetization = Flv + c.SendRetry = true case NothingDefined: c.Logger.Log(logger.Warning, pkg+"no output defined, defaulting", "output", defaultOutput) diff --git a/revid/revid.go b/revid/revid.go index 22f094ee..74f591d3 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -540,7 +540,7 @@ loop: err = dest.send() if err == nil { r.config.Logger.Log(logger.Debug, pkg+"sent clip to output "+strconv.Itoa(i)) - } else if r.config.SendRetry == false { + } else if !r.config.SendRetry { r.config.Logger.Log(logger.Warning, pkg+"send to output "+strconv.Itoa(i)+" failed", "error", err.Error()) } else { r.config.Logger.Log(logger.Error, pkg+"send to output "+strconv.Itoa(i)+ @@ -549,19 +549,16 @@ loop: if err != nil && chunk.Len() > 11 { r.config.Logger.Log(logger.Error, pkg+"second send attempted failed, restarting connection", "error", err.Error()) for err != nil { - time.Sleep(sendFailedDelay) if rs, ok := dest.(restarter); ok { r.config.Logger.Log(logger.Debug, pkg+"restarting session", "session", rs) err = rs.restart() if err != nil { r.config.Logger.Log(logger.Error, pkg+"failed to restart rtmp session", "error", err.Error()) - r.setIsRunning(false) - return + time.Sleep(sendFailedDelay) + continue } - - r.config.Logger.Log(logger.Info, pkg+"restarted rtmp session") } - + r.config.Logger.Log(logger.Info, pkg+"restarted rtmp session, sending again") err = dest.send() if err != nil { r.config.Logger.Log(logger.Error, pkg+"send failed again, with error", "error", err.Error()) From c60ec9fbd8adbeb95c956ab8e559016093716f09 Mon Sep 17 00:00:00 2001 From: Saxon Date: Sun, 3 Mar 2019 16:41:16 +1030 Subject: [PATCH 09/15] revid: moved messaged regarding restart of rtmp session --- revid/revid.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/revid/revid.go b/revid/revid.go index 74f591d3..f36cbca0 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -557,8 +557,8 @@ loop: time.Sleep(sendFailedDelay) continue } + r.config.Logger.Log(logger.Info, pkg+"restarted rtmp session, sending again") } - r.config.Logger.Log(logger.Info, pkg+"restarted rtmp session, sending again") err = dest.send() if err != nil { r.config.Logger.Log(logger.Error, pkg+"send failed again, with error", "error", err.Error()) From 03f83032a5f7fdbf5634f4175a069452b1890de4 Mon Sep 17 00:00:00 2001 From: Saxon Date: Sun, 3 Mar 2019 17:17:25 +1030 Subject: [PATCH 10/15] revid: ignore error from close in rtmpSender.Restart() --- revid/senders.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/revid/senders.go b/revid/senders.go index 9d326471..0b279cbb 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -307,10 +307,8 @@ func (s *rtmpSender) release() { } func (s *rtmpSender) restart() error { - err := s.conn.Close() - if err != nil { - return err - } + s.conn.Close() + var err error for n := 0; n < s.retries; n++ { s.conn, err = rtmp.Dial(s.url, s.timeout, s.log) if err == nil { From c15c57f15f494ff629abbb93b8c5e88dfb905422 Mon Sep 17 00:00:00 2001 From: Alan Noble Date: Sun, 3 Mar 2019 07:04:33 +0000 Subject: [PATCH 11/15] Don't fail if Close() returns an error, since it just means there is no connection, and don't call Close when Dial fails. --- revid/senders.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/revid/senders.go b/revid/senders.go index 9d326471..2ac22f20 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -307,17 +307,13 @@ func (s *rtmpSender) release() { } func (s *rtmpSender) restart() error { - err := s.conn.Close() - if err != nil { - return err - } + s.conn.Close() for n := 0; n < s.retries; n++ { s.conn, err = rtmp.Dial(s.url, s.timeout, s.log) if err == nil { break } s.log(logger.Error, err.Error()) - s.conn.Close() if n < s.retries-1 { s.log(logger.Info, pkg+"retry rtmp connection") } From 32280cb9d6def890b9e2b069b2bc40b85708c955 Mon Sep 17 00:00:00 2001 From: Alan Noble Date: Sun, 3 Mar 2019 07:09:50 +0000 Subject: [PATCH 12/15] Declare error. --- revid/senders.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/revid/senders.go b/revid/senders.go index 2ac22f20..9bed14f8 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -308,7 +308,8 @@ func (s *rtmpSender) release() { func (s *rtmpSender) restart() error { s.conn.Close() - for n := 0; n < s.retries; n++ { + var err error + for n := 0; n < s.retries; n++ { s.conn, err = rtmp.Dial(s.url, s.timeout, s.log) if err == nil { break From b1dcb9d6a73105e0bbdfcde5aacf72838b4ca8a5 Mon Sep 17 00:00:00 2001 From: Alan Noble Date: Sun, 3 Mar 2019 07:11:35 +0000 Subject: [PATCH 13/15] gofmt --- revid/senders.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/revid/senders.go b/revid/senders.go index 9bed14f8..1e97aad1 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -308,8 +308,8 @@ func (s *rtmpSender) release() { func (s *rtmpSender) restart() error { s.conn.Close() - var err error - for n := 0; n < s.retries; n++ { + var err error + for n := 0; n < s.retries; n++ { s.conn, err = rtmp.Dial(s.url, s.timeout, s.log) if err == nil { break From 8606320731e02688109c8c19cde8dafbc4837c8d Mon Sep 17 00:00:00 2001 From: Saxon Date: Sun, 3 Mar 2019 18:24:54 +1030 Subject: [PATCH 14/15] revid: ignoring rtmp.ErrInvalidFlvTag error and checking that rtmp conn is not closed before we try to close it --- revid/senders.go | 10 ++++++++-- rtmp/conn.go | 2 +- rtmp/rtmp.go | 2 +- rtmp/rtmp_test.go | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/revid/senders.go b/revid/senders.go index 1e97aad1..af7657b2 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -298,6 +298,9 @@ func (s *rtmpSender) load(c *ring.Chunk) error { func (s *rtmpSender) send() error { _, err := s.chunk.WriteTo(s.conn) + if err == rtmp.ErrInvalidFlvTag { + return nil + } return err } @@ -307,7 +310,7 @@ func (s *rtmpSender) release() { } func (s *rtmpSender) restart() error { - s.conn.Close() + s.close() var err error for n := 0; n < s.retries; n++ { s.conn, err = rtmp.Dial(s.url, s.timeout, s.log) @@ -323,7 +326,10 @@ func (s *rtmpSender) restart() error { } func (s *rtmpSender) close() error { - return s.conn.Close() + if s.conn != nil { + return s.conn.Close() + } + return nil } // udpSender implements loadSender for a native udp destination. diff --git a/rtmp/conn.go b/rtmp/conn.go index 4249a637..ea8869b9 100644 --- a/rtmp/conn.go +++ b/rtmp/conn.go @@ -155,7 +155,7 @@ func (c *Conn) Write(data []byte) (int, error) { return 0, errNotConnected } if len(data) < flvTagheaderSize { - return 0, errInvalidFlvTag + return 0, ErrInvalidFlvTag } if data[0] == packetTypeInfo || (data[0] == 'F' && data[1] == 'L' && data[2] == 'V') { return 0, errUnimplemented diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index 6f666785..3131380c 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -158,7 +158,7 @@ var ( errNotWritable = errors.New("rtmp: connection not writable") errInvalidHeader = errors.New("rtmp: invalid header") errInvalidBody = errors.New("rtmp: invalid body") - errInvalidFlvTag = errors.New("rtmp: invalid FLV tag") + ErrInvalidFlvTag = errors.New("rtmp: invalid FLV tag") errUnimplemented = errors.New("rtmp: unimplemented feature") ) diff --git a/rtmp/rtmp_test.go b/rtmp/rtmp_test.go index be4908a6..8d94ee7e 100644 --- a/rtmp/rtmp_test.go +++ b/rtmp/rtmp_test.go @@ -216,7 +216,7 @@ type rtmpSender struct { func (rs *rtmpSender) Write(p []byte) (int, error) { n, err := rs.conn.Write(p) - if err != errInvalidFlvTag && err != nil { + if err != ErrInvalidFlvTag && err != nil { return 0, err } return n, nil From e06465e46b49a432768cc2349ef7702663d1589d Mon Sep 17 00:00:00 2001 From: Saxon Date: Mon, 4 Mar 2019 12:47:57 +1030 Subject: [PATCH 15/15] revid: config defaulting messages no longer warning level but rather info level --- revid/config.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/revid/config.go b/revid/config.go index b3d91964..56292a08 100644 --- a/revid/config.go +++ b/revid/config.go @@ -126,7 +126,7 @@ func (c *Config) Validate(r *Revid) error { case No: case NothingDefined: c.LogLevel = defaultVerbosity - c.Logger.Log(logger.Warning, pkg+"no LogLevel mode defined, defaulting", + c.Logger.Log(logger.Info, pkg+"no LogLevel mode defined, defaulting", "LogLevel", defaultVerbosity) default: return errors.New("bad LogLevel defined in config") @@ -135,7 +135,7 @@ func (c *Config) Validate(r *Revid) error { switch c.Input { case Raspivid, V4L, File: case NothingDefined: - c.Logger.Log(logger.Warning, pkg+"no input type defined, defaulting", "input", + c.Logger.Log(logger.Info, pkg+"no input type defined, defaulting", "input", defaultInput) c.Input = defaultInput default: @@ -160,10 +160,10 @@ func (c *Config) Validate(r *Revid) error { } case NothingDefined: - c.Logger.Log(logger.Warning, pkg+"no input codec defined, defaulting", + c.Logger.Log(logger.Info, pkg+"no input codec defined, defaulting", "inputCodec", defaultInputCodec) c.InputCodec = defaultInputCodec - c.Logger.Log(logger.Warning, pkg+"defaulting quantization", "quantization", + c.Logger.Log(logger.Info, pkg+"defaulting quantization", "quantization", defaultQuantization) c.Quantization = defaultQuantization @@ -189,7 +189,7 @@ func (c *Config) Validate(r *Revid) error { c.Packetization = Flv c.SendRetry = true case NothingDefined: - c.Logger.Log(logger.Warning, pkg+"no output defined, defaulting", "output", + c.Logger.Log(logger.Info, pkg+"no output defined, defaulting", "output", defaultOutput) c.Outputs[i] = defaultOutput c.Packetization = defaultPacketization @@ -205,43 +205,43 @@ func (c *Config) Validate(r *Revid) error { } if c.BurstPeriod == 0 { - c.Logger.Log(logger.Warning, pkg+"no burst period defined, defaulting", "burstPeriod", defaultBurstPeriod) + c.Logger.Log(logger.Info, pkg+"no burst period defined, defaulting", "burstPeriod", defaultBurstPeriod) c.BurstPeriod = defaultBurstPeriod } if c.FramesPerClip < 1 { - c.Logger.Log(logger.Warning, pkg+"no FramesPerClip defined, defaulting", + c.Logger.Log(logger.Info, pkg+"no FramesPerClip defined, defaulting", "framesPerClip", defaultFramesPerClip) c.FramesPerClip = defaultFramesPerClip } if c.Width == 0 { - c.Logger.Log(logger.Warning, pkg+"no width defined, defaulting", "width", defaultWidth) + c.Logger.Log(logger.Info, pkg+"no width defined, defaulting", "width", defaultWidth) c.Width = defaultWidth } if c.Height == 0 { - c.Logger.Log(logger.Warning, pkg+"no height defined, defaulting", "height", defaultHeight) + c.Logger.Log(logger.Info, pkg+"no height defined, defaulting", "height", defaultHeight) c.Height = defaultHeight } if c.FrameRate == 0 { - c.Logger.Log(logger.Warning, pkg+"no frame rate defined, defaulting", "fps", defaultFrameRate) + c.Logger.Log(logger.Info, pkg+"no frame rate defined, defaulting", "fps", defaultFrameRate) c.FrameRate = defaultFrameRate } if c.Bitrate == 0 { - c.Logger.Log(logger.Warning, pkg+"no bitrate defined, defaulting", "bitrate", defaultBitrate) + c.Logger.Log(logger.Info, pkg+"no bitrate defined, defaulting", "bitrate", defaultBitrate) c.Bitrate = defaultBitrate } if c.IntraRefreshPeriod == 0 { - c.Logger.Log(logger.Warning, pkg+"no intra refresh defined, defaulting", "intraRefresh", defaultIntraRefreshPeriod) + c.Logger.Log(logger.Info, pkg+"no intra refresh defined, defaulting", "intraRefresh", defaultIntraRefreshPeriod) c.IntraRefreshPeriod = defaultIntraRefreshPeriod } if c.Quantization == 0 { - c.Logger.Log(logger.Warning, pkg+"no quantization defined, defaulting", "quantization", defaultQuantization) + c.Logger.Log(logger.Info, pkg+"no quantization defined, defaulting", "quantization", defaultQuantization) c.Quantization = defaultQuantization } else if c.Quantization > 51 { return errors.New("quantisation is over threshold")