From 26430f1ff843a62409f4c7f83c687ddb6bf2c452 Mon Sep 17 00:00:00 2001
From: Jack Richardson <richardson.jack@outlook.com>
Date: Wed, 31 Jan 2018 17:12:29 +1030
Subject: [PATCH] Seems like MJPEG doesn't like quantisation - we'll have to
 work out a nice bitrate

---
 revid/RevidInstance.go | 8 ++------
 revid/revid_test.go    | 2 +-
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/revid/RevidInstance.go b/revid/RevidInstance.go
index 06683b6f..4add5941 100644
--- a/revid/RevidInstance.go
+++ b/revid/RevidInstance.go
@@ -59,10 +59,10 @@ const (
 	mp2tPacketSize       = 188                 // MPEG-TS packet size
 	mp2tMaxPackets       = 2016 * clipDuration // # first multiple of 7 and 8 greater than 2000
 	ringBufferSize           = 100 / clipDuration
-	ringBufferElementSize = 500000
+	ringBufferElementSize = 1000000
 	httpTimeOut          = 5 // s
 	packetsPerFrame      = 7
-	h264BufferSize       = 500000
+	h264BufferSize       = 1000000
 	bitrateTime          = 60
 	mjpegParserInChanLen = 100000
 )
@@ -352,13 +352,9 @@ func (r *revidInst) Start() {
 				"-o", "-",
 				"-n",
 				"-t", r.config.Timeout,
-				/*
-				"-b", "0",
-				"-qp", r.config.Quantization,
 				"-w", r.config.Width,
 				"-h", r.config.Height,
 				"-fps", r.config.FrameRate,
-				*/
 			)
 		}
 		stdout, _ := r.cmd.StdoutPipe()
diff --git a/revid/revid_test.go b/revid/revid_test.go
index 8de083f4..46832d09 100644
--- a/revid/revid_test.go
+++ b/revid/revid_test.go
@@ -91,6 +91,6 @@ func TestRaspividMJPEGInput(t *testing.T){
     return
   }
   revidInst.Start()
-  time.Sleep(10*time.Second)
+  time.Sleep(5*time.Second)
   revidInst.Stop()
 }