mirror of https://bitbucket.org/ausocean/av.git
vidforward: use consistent revid construction function
This commit is contained in:
parent
a4754e5ead
commit
c82d7a8e55
|
@ -39,10 +39,8 @@ import (
|
|||
"time"
|
||||
|
||||
"bitbucket.org/ausocean/av/cmd/vidforward/global"
|
||||
"bitbucket.org/ausocean/av/codec/codecutil"
|
||||
"bitbucket.org/ausocean/av/container/mts"
|
||||
"bitbucket.org/ausocean/av/revid"
|
||||
"bitbucket.org/ausocean/av/revid/config"
|
||||
"bitbucket.org/ausocean/utils/logging"
|
||||
"gopkg.in/natefinch/lumberjack.v2"
|
||||
)
|
||||
|
@ -281,22 +279,8 @@ func (m *broadcastManager) createOrUpdate(broadcast Broadcast) error {
|
|||
m.mu.Lock()
|
||||
defer m.mu.Unlock()
|
||||
|
||||
var outputs []uint8
|
||||
for _ = range broadcast.urls {
|
||||
outputs = append(outputs, config.OutputRTMP)
|
||||
}
|
||||
|
||||
cfg := config.Config{
|
||||
Logger: m.log,
|
||||
Input: config.InputManual,
|
||||
InputCodec: codecutil.H264_AU,
|
||||
Outputs: outputs,
|
||||
RTMPURL: broadcast.urls,
|
||||
LogLevel: logging.Debug,
|
||||
}
|
||||
|
||||
var err error
|
||||
broadcast.rv, err = revid.New(cfg, nil)
|
||||
broadcast.rv, err = newRevid(m.log, broadcast.urls)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not initialise revid: %w", err)
|
||||
}
|
||||
|
|
|
@ -38,15 +38,20 @@ import (
|
|||
var loggingLevel = logging.Info
|
||||
|
||||
func newRevid(log logging.Logger, urls []string) (*revid.Revid, error) {
|
||||
return revid.New(
|
||||
config.Config{
|
||||
var outputs []uint8
|
||||
for _ = range urls {
|
||||
outputs = append(outputs, config.OutputRTMP)
|
||||
}
|
||||
cfg := config.Config{
|
||||
Logger: log,
|
||||
Input: config.InputManual,
|
||||
InputCodec: codecutil.H264_AU,
|
||||
Outputs: []uint8{config.OutputRTMP},
|
||||
Outputs: outputs,
|
||||
RTMPURL: urls,
|
||||
LogLevel: loggingLevel,
|
||||
}, nil)
|
||||
LogLevel: logging.Debug,
|
||||
}
|
||||
return revid.New(
|
||||
cfg, nil)
|
||||
}
|
||||
|
||||
// writeError logs an error and writes to w in JSON format.
|
||||
|
|
Loading…
Reference in New Issue