mirror of https://bitbucket.org/ausocean/av.git
revid: panic if invalid input, or invalid input codec for corresponding input
This commit is contained in:
parent
9087f727db
commit
8489d615d8
|
@ -177,6 +177,8 @@ func (r *Revid) reset(config Config) error {
|
|||
case codecutil.MJPEG:
|
||||
st = mts.EncodeMJPEG
|
||||
encOptions = append(encOptions, mts.PacketBasedPSI(int(r.config.MinFrames)))
|
||||
default:
|
||||
panic("unknown input codec for raspivid input")
|
||||
}
|
||||
case File, V4L:
|
||||
st = mts.EncodeH264
|
||||
|
@ -189,9 +191,13 @@ func (r *Revid) reset(config Config) error {
|
|||
case codecutil.MJPEG:
|
||||
st = mts.EncodeMJPEG
|
||||
encOptions = append(encOptions, mts.PacketBasedPSI(int(r.config.MinFrames)))
|
||||
default:
|
||||
panic("unknown input codec for RTSP input")
|
||||
}
|
||||
case Audio:
|
||||
st = mts.EncodeAudio
|
||||
default:
|
||||
panic("unknown input type")
|
||||
}
|
||||
|
||||
return mts.NewEncoder(dst, float64(fps), st, encOptions...)
|
||||
|
|
Loading…
Reference in New Issue