mirror of https://bitbucket.org/ausocean/av.git
revid: trying to fix jumpy rtp
This commit is contained in:
parent
d8587bdbe2
commit
618fadd90b
|
@ -188,7 +188,6 @@ func (c *Config) Validate(r *Revid) error {
|
|||
|
||||
switch c.Output1 {
|
||||
case File:
|
||||
case Rtp:
|
||||
case Udp:
|
||||
case Rtmp, FfmpegRtmp:
|
||||
if c.RtmpUrl == "" {
|
||||
|
@ -204,7 +203,7 @@ func (c *Config) Validate(r *Revid) error {
|
|||
defaultOutput)
|
||||
c.Output1 = defaultOutput
|
||||
fallthrough
|
||||
case Http:
|
||||
case Http, Rtp:
|
||||
c.Logger.Log(smartlogger.Info, pkg+"defaulting frames per clip for http out",
|
||||
"framesPerClip", httpFramesPerClip)
|
||||
c.FramesPerClip = httpFramesPerClip
|
||||
|
|
|
@ -38,7 +38,7 @@ import (
|
|||
|
||||
const (
|
||||
psiPacketSize = 184
|
||||
psiSendCount = 21
|
||||
psiSendCount = 7
|
||||
)
|
||||
|
||||
type MetaData struct {
|
||||
|
|
|
@ -63,7 +63,7 @@ func NewEncoder(dst io.Writer, fps int) *Encoder {
|
|||
ssrc: rand.Uint32(),
|
||||
frameInterval: time.Duration(float64(time.Second) / float64(fps)),
|
||||
fps: fps,
|
||||
buffer: make([]byte, 0, sendLength),
|
||||
buffer: make([]byte, 0),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,8 +72,8 @@ func NewEncoder(dst io.Writer, fps int) *Encoder {
|
|||
func (e *Encoder) Write(data []byte) (int, error) {
|
||||
e.buffer = append(e.buffer, data...)
|
||||
for len(e.buffer) >= sendLength {
|
||||
e.Encode(e.buffer)
|
||||
e.buffer = e.buffer[:0]
|
||||
e.Encode(e.buffer[:sendLength])
|
||||
e.buffer = e.buffer[sendLength:]
|
||||
}
|
||||
return len(data), nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue