stop normalizing H264 PTS

This commit is contained in:
aler9
2022-06-02 22:25:13 +02:00
parent 46253a74b0
commit 787c516d79

View File

@@ -25,7 +25,6 @@ type mpegtsEncoder struct {
mux *astits.Muxer mux *astits.Muxer
dtsExtractor *h264.DTSExtractor dtsExtractor *h264.DTSExtractor
firstIDRReceived bool firstIDRReceived bool
startPTS time.Duration
} }
// newMPEGTSEncoder allocates a mpegtsEncoder. // newMPEGTSEncoder allocates a mpegtsEncoder.
@@ -100,12 +99,9 @@ func (e *mpegtsEncoder) encode(nalus [][]byte, pts time.Duration) error {
} }
e.firstIDRReceived = true e.firstIDRReceived = true
e.startPTS = pts
e.dtsExtractor = h264.NewDTSExtractor() e.dtsExtractor = h264.NewDTSExtractor()
} }
pts -= e.startPTS
dts, err := e.dtsExtractor.Extract(filteredNALUs, pts) dts, err := e.dtsExtractor.Extract(filteredNALUs, pts)
if err != nil { if err != nil {
return err return err