This has got to work

This commit is contained in:
Unknown 2018-03-13 21:27:34 +10:30
parent 2dccba6969
commit f7b3acb4d6
1 changed files with 5 additions and 6 deletions

View File

@ -311,18 +311,17 @@ func (r *revidInst) outputClips() {
now := time.Now()
prevTime := now
bytes := 0
//delay := 15
delay := 40
for r.isRunning {
// Here we slow things down as much as we can to decrease cpu usage
/*
switch {
case r.ringBuffer.GetNoOfElements() < 100:
case r.ringBuffer.GetNoOfElements() < 5000:
delay++
time.Sleep(time.Duration(delay) * time.Millisecond)
case delay > 0:
delay--
}
*/
// If the ringbuffer has something we can read and send off
if clip, err := r.ringBuffer.Read(); err == nil {
//r.Log(Debug, fmt.Sprintf("Delay is: %v\n", delay))
@ -452,8 +451,8 @@ func (r *revidInst) setupOutputForFile() (err error) {
// setupInputForRaspivid sets up things for input from raspivid i.e. starts
// a raspivid process and pipes it's data output.
func (r *revidInst) setupInputForRaspivid() error {
fps,_ := strconv.Atoi(r.config.FrameRate)
r.parser.SetDelay( uint( float64(1000) / float64(fps) ) )
//fps,_ := strconv.Atoi(r.config.FrameRate)
//r.parser.SetDelay( uint( float64(1000) / float64(fps) ) )
r.Log(Info, "Starting raspivid!")
switch r.config.InputCodec {
case H264: