diff --git a/internal/recorder/format_fmp4.go b/internal/recorder/format_fmp4.go index 90885d7bbf7..b58e2ddaba9 100644 --- a/internal/recorder/format_fmp4.go +++ b/internal/recorder/format_fmp4.go @@ -611,7 +611,7 @@ func (f *formatFMP4) initialize() bool { Payload: packet, }, dts: pts, - ntp: tunit.NTP.Add(timestampToDuration(pts, clockRate)), + ntp: tunit.NTP.Add(timestampToDuration(pts-tunit.PTS, clockRate)), }) if err != nil { return err @@ -649,7 +649,7 @@ func (f *formatFMP4) initialize() bool { Payload: au, }, dts: pts, - ntp: tunit.NTP.Add(timestampToDuration(pts, clockRate)), + ntp: tunit.NTP.Add(timestampToDuration(pts-tunit.PTS, clockRate)), }) if err != nil { return err @@ -771,7 +771,7 @@ func (f *formatFMP4) initialize() bool { Payload: frame, }, dts: pts, - ntp: tunit.NTP.Add(timestampToDuration(pts, clockRate)), + ntp: tunit.NTP.Add(timestampToDuration(pts-tunit.PTS, clockRate)), }) if err != nil { return err