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,
|
"-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()
|
stdout, err := r.cmd.StdoutPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -469,7 +474,7 @@ func (r *Revid) startRaspivid() error {
|
||||||
r.inputReader = stdout
|
r.inputReader = stdout
|
||||||
go func() {
|
go func() {
|
||||||
r.config.Logger.Log(smartlogger.Info, pkg+"reading camera data")
|
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")
|
r.config.Logger.Log(smartlogger.Info, pkg+"not trying to read from camera anymore")
|
||||||
}()
|
}()
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue