Skip to content

Commit

Permalink
Export PTS and DTS as they are required for downstream muxers
Browse files Browse the repository at this point in the history
  • Loading branch information
FuMin Wang (王富民) authored and FuMin Wang (王富民) committed Sep 28, 2023
1 parent 5e0d7bf commit 9a0ffaa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type Encoder struct {

csp int32
pts int64
dts int64

nnals int32
nals []*x264c.Nal
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9a0ffaa

Please sign in to comment.