From f8fc5156f10b8a3cc90dfeb6e235690d91fa4597 Mon Sep 17 00:00:00 2001 From: Scott Date: Wed, 4 Dec 2019 16:17:51 +1030 Subject: [PATCH] revid/revid.go Revid crash on file input fixed Now the file input has the lexer set to config's codec --- revid/revid.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/revid/revid.go b/revid/revid.go index d0bc73f3..957cd8d2 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -346,6 +346,12 @@ func (r *Revid) setupPipeline(mtsEnc func(dst io.WriteCloser, rate float64) (io. case config.InputFile: r.input = file.New() + switch r.cfg.InputCodec { + case codecutil.H264: + r.lexTo = h264.Lex + case codecutil.MJPEG: + r.lexTo = mjpeg.Lex + } case config.InputRTSP: r.input = geovision.New(r.cfg.Logger)