revid: using config to define default packetsPerClipValue

This commit is contained in:
saxon 2018-12-08 01:54:20 +10:30
parent cfff3316b4
commit f5a571547d
2 changed files with 2 additions and 3 deletions

View File

@ -108,7 +108,7 @@ const (
defaultFramesPerClip = 1
defaultVerticalFlip = No
defaultHorizontalFlip = No
httpFramesPerClip = 7
httpFramesPerClip = 560
defaultInputCodec = H264
defaultVerbosity = No
defaultRtpAddr = "localhost:6970"

View File

@ -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
}