From f5a571547d80e1ee96d5bee47316a2363c24de7b Mon Sep 17 00:00:00 2001 From: saxon Date: Sat, 8 Dec 2018 01:54:20 +1030 Subject: [PATCH] revid: using config to define default packetsPerClipValue --- revid/config.go | 2 +- revid/revid.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/revid/config.go b/revid/config.go index aeb35f4e..72165f60 100644 --- a/revid/config.go +++ b/revid/config.go @@ -108,7 +108,7 @@ const ( defaultFramesPerClip = 1 defaultVerticalFlip = No defaultHorizontalFlip = No - httpFramesPerClip = 7 + httpFramesPerClip = 560 defaultInputCodec = H264 defaultVerbosity = No defaultRtpAddr = "localhost:6970" diff --git a/revid/revid.go b/revid/revid.go index e0a96f0b..5baf69ed 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -58,7 +58,6 @@ const ( writeTimeout = 10 * time.Millisecond readTimeout = 10 * time.Millisecond httpTimeout = 5 * time.Second - packetsPerClip = 560 bitrateTime = 1 * time.Minute mjpegParserInChanLen = 100000 ffmpegPath = "/usr/local/bin/ffmpeg" @@ -154,7 +153,7 @@ func (p *packer) Write(frame []byte) (int, error) { return n, err } p.packetCount++ - if p.packetCount >= packetsPerClip { + if p.packetCount >= p.owner.config.FramesPerClip { p.owner.buffer.Flush() p.packetCount = 0 }