revid/revid.go MPEG lexer enabled and encoder options set for v4l

This commit is contained in:
Scott 2019-12-04 11:40:12 +10:30
parent 565ba3079c
commit 70802022bb
1 changed files with 15 additions and 2 deletions

View File

@ -191,7 +191,15 @@ func (r *Revid) reset(c config.Config) error {
panic("unknown input codec for raspivid input")
}
case config.InputFile, config.InputV4L:
switch r.cfg.InputCodec {
case codecutil.H264:
st = mts.EncodeH264
case codecutil.MJPEG:
st = mts.EncodeMJPEG
encOptions = append(encOptions, mts.PacketBasedPSI(int(r.cfg.MinFrames)))
default:
panic("unknown input codec for v4l or input file input")
}
case config.InputRTSP:
switch r.cfg.InputCodec {
case codecutil.H265:
@ -329,7 +337,12 @@ func (r *Revid) setupPipeline(mtsEnc func(dst io.WriteCloser, rate float64) (io.
case config.InputV4L:
r.input = webcam.New(r.cfg.Logger)
switch r.cfg.InputCodec {
case codecutil.H264:
r.lexTo = h264.Lex
case codecutil.MJPEG:
r.lexTo = mjpeg.Lex
}
case config.InputFile:
r.input = file.New()