Export PTS and DTS as they are required for downstream muxers

This commit is contained in:
FuMin Wang (王富民) 2023-09-28 16:20:09 +08:00
parent 5e0d7bfeb1
commit 9a0ffaab5b

View File

@ -57,6 +57,7 @@ type Encoder struct {
csp int32
pts int64
dts int64
nnals int32
nals []*x264c.Nal
@ -229,9 +230,16 @@ func (e *Encoder) Encode(im image.Image) (err error) {
}
}
e.dts = picOut.IDts
return
}
// GetTimestamp returns the current PTS and DTS.
func (e *Encoder) GetTimestamp() (int64, int64) {
return e.pts, e.dts
}
// Flush flushes encoder.
func (e *Encoder) Flush() (err error) {
var picOut x264c.Picture