Skip to content

Commit

Permalink
Merge pull request #28 from fumin/master
Browse files Browse the repository at this point in the history
Export PTS and DTS as they are required for downstream muxers
  • Loading branch information
gen2brain authored Sep 28, 2023
2 parents 5e0d7bf + 9a0ffaa commit 7604621
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 7604621

Please sign in to comment.