From e33f4fded0716c03f1016718867644749c4fddf5 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 31 Jan 2018 16:56:36 +1030 Subject: [PATCH] FIshing some issues with code Something is breaking raspivid, need to work out what it is --- revid/RevidInstance.go | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/revid/RevidInstance.go b/revid/RevidInstance.go index a4fbd54b..06683b6f 100644 --- a/revid/RevidInstance.go +++ b/revid/RevidInstance.go @@ -332,22 +332,35 @@ func (r *revidInst) Start() { switch r.config.InputCodec { case H264: codec = "H264" + r.cmd = exec.Command("raspivid", + "-cd", codec, + "-o", "-", + "-n", + "-t", r.config.Timeout, + "-b", "0", + "-qp", r.config.Quantization, + "-w", r.config.Width, + "-h", r.config.Height, + "-fps", r.config.FrameRate, + "-ih", + "-g", r.config.IntraRefreshPeriod, + ) case Mjpeg: codec = "MJPEG" + r.cmd = exec.Command("raspivid", + "-cd", codec, + "-o", "-", + "-n", + "-t", r.config.Timeout, + /* + "-b", "0", + "-qp", r.config.Quantization, + "-w", r.config.Width, + "-h", r.config.Height, + "-fps", r.config.FrameRate, + */ + ) } - r.cmd = exec.Command("raspivid", - "-cd", codec, - "-o", "-", - "-n", - "-t", r.config.Timeout, - "-b", "0", - "-qp", r.config.Quantization, - "-w", r.config.Width, - "-h", r.config.Height, - "-fps", r.config.FrameRate, - "-ih", - "-g", r.config.IntraRefreshPeriod, - ) stdout, _ := r.cmd.StdoutPipe() err := r.cmd.Start() r.inputReader = bufio.NewReader(stdout)