diff --git a/container/mts/encoder.go b/container/mts/encoder.go index 3249ce56..693b0be3 100644 --- a/container/mts/encoder.go +++ b/container/mts/encoder.go @@ -150,10 +150,12 @@ type Encoder struct { func NewEncoder(dst io.WriteCloser, rate float64, mediaType int) *Encoder { var mPid int var sid byte + nbp := true switch mediaType { case EncodeAudio: mPid = AudioPid sid = audioStreamID + nbp = false case EncodeH265: mPid = VideoPid sid = H265ID @@ -180,7 +182,7 @@ func NewEncoder(dst io.WriteCloser, rate float64, mediaType int) *Encoder { writePeriod: time.Duration(float64(time.Second) / rate), ptsOffset: ptsOffset, - nalBasedPSI: true, + nalBasedPSI: nbp, pktCount: 8,