diff --git a/examples/client-read-format-h264-save-to-disk/main.go b/examples/client-read-format-h264-save-to-disk/main.go index 23f74288..6ed7cf8a 100644 --- a/examples/client-read-format-h264-save-to-disk/main.go +++ b/examples/client-read-format-h264-save-to-disk/main.go @@ -62,7 +62,8 @@ func main() { // called when a RTP packet arrives c.OnPacketRTP(medi, forma, func(pkt *rtp.Packet) { // convert RTP packets into NALUs - nalus, pts, err := rtpDec.Decode(pkt) + // DecodeUntilMarker is necessary for the DTS extractor to work + nalus, pts, err := rtpDec.DecodeUntilMarker(pkt) if err != nil { if err != rtph264.ErrNonStartingPacketAndNoPrevious && err != rtph264.ErrMorePacketsNeeded { log.Printf("ERR: %v", err)