Add tuneable parameter to improve motion detect picture quality

This commit is contained in:
richardsonjack 2017-12-07 15:58:53 +10:30
parent 5e2f968938
commit faafee482d
1 changed files with 4 additions and 2 deletions

View File

@ -74,6 +74,7 @@ const (
bitrateOutputDelay = 60 // s
httpTimeOut = 5 // s
motionThreshold = "0.0025"
qscale = "3"
)
// flag values
@ -226,6 +227,7 @@ func input(input string, output string) {
case *flags&filterMotionDetect != 0:
args = []string{
"-i", input,
"-q:v", qscale,
"-vf", "select=gt(scene\\," + motionThreshold + "),setpts=N/(FRAME_RATE*TB)",
"-f", "mpegts", "-",
}
@ -283,8 +285,8 @@ func input(input string, output string) {
for {
upperBound := clipSize + mp2tPacketSize
for _, err := io.ReadFull(br, clip[clipSize:upperBound]); err != nil; {
inputErrChan <- err
if err.Error() != "EFO" {
if err.Error() != "EOF" {
inputErrChan <- err
return
}
_, err = io.ReadFull(br, clip[clipSize:upperBound])