Merge pull request #28 from fumin/master

Export PTS and DTS as they are required for downstream muxers
This commit is contained in:
Milan Nikolic 2023-09-28 10:40:46 +02:00 committed by GitHub
commit 7604621870
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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