Merged in raspivid-quality-fix (pull request #64)

raspivid stream quality fix

Approved-by: kortschak <dan@kortschak.io>
This commit is contained in:
Saxon Milton 2018-09-24 06:55:08 +00:00
commit 4bf78b7e97
1 changed files with 6 additions and 1 deletions

View File

@ -458,6 +458,11 @@ func (r *Revid) startRaspivid() error {
"-fps", r.config.FrameRate,
)
}
d, err := strconv.Atoi(r.config.FrameRate)
if err != nil {
return err
}
delay := time.Second / time.Duration(d)
stdout, err := r.cmd.StdoutPipe()
if err != nil {
return err
@ -469,7 +474,7 @@ func (r *Revid) startRaspivid() error {
r.inputReader = stdout
go func() {
r.config.Logger.Log(smartlogger.Info, pkg+"reading camera data")
r.lexTo(r.encoder, r.inputReader, 0)
r.lexTo(r.encoder, r.inputReader, delay)
r.config.Logger.Log(smartlogger.Info, pkg+"not trying to read from camera anymore")
}()
return nil