mirror of https://bitbucket.org/ausocean/av.git
revid: passing delay corresponding to fps into lexTo - fixing quality issue when streaming from raspivid (not sending stuff too fast)
This commit is contained in:
parent
9bf4ee4bf0
commit
0cf6014887
|
@ -458,6 +458,11 @@ func (r *Revid) startRaspivid() error {
|
|||
"-fps", r.config.FrameRate,
|
||||
)
|
||||
}
|
||||
d, err := strconv.Atoi(r.config.FrameRate)
|
||||
if err != nil {
|
||||
panic("arrgh")
|
||||
}
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue