Merged in enable-mts-timestamps (pull request #522)

Enable MTS timestamps with audio input

* Enable MTS timestamps with audio input.


Approved-by: Saxon Milton
This commit is contained in:
Alan Noble 2023-10-19 23:11:20 +00:00
parent 3bb8d0bde2
commit a2aaa605fd
1 changed files with 2 additions and 0 deletions

View File

@ -38,6 +38,7 @@ import (
"bitbucket.org/ausocean/av/device" "bitbucket.org/ausocean/av/device"
"bitbucket.org/ausocean/av/filter" "bitbucket.org/ausocean/av/filter"
"bitbucket.org/ausocean/av/container/mts"
"bitbucket.org/ausocean/av/revid/config" "bitbucket.org/ausocean/av/revid/config"
"bitbucket.org/ausocean/iot/pi/netsender" "bitbucket.org/ausocean/iot/pi/netsender"
"bitbucket.org/ausocean/utils/bitrate" "bitbucket.org/ausocean/utils/bitrate"
@ -157,6 +158,7 @@ func (r *Revid) Start() error {
d := time.Duration(0) d := time.Duration(0)
if r.cfg.Input == config.InputAudio { if r.cfg.Input == config.InputAudio {
d = time.Duration(r.cfg.RecPeriod * float64(time.Second)) d = time.Duration(r.cfg.RecPeriod * float64(time.Second))
mts.RealTime.Set(time.Now()) // Enable timestamps in MTS output, if any.
} else if r.cfg.FileFPS != 0 { } else if r.cfg.FileFPS != 0 {
d = time.Duration(1000/r.cfg.FileFPS) * time.Millisecond d = time.Duration(1000/r.cfg.FileFPS) * time.Millisecond
} }