mirror of
https://github.com/gen2brain/x264-go.git
synced 2024-09-10 09:31:13 +08:00
Export PTS and DTS as they are required for downstream muxers
This commit is contained in:
parent
5e0d7bfeb1
commit
9a0ffaab5b
@ -57,6 +57,7 @@ type Encoder struct {
|
|||||||
|
|
||||||
csp int32
|
csp int32
|
||||||
pts int64
|
pts int64
|
||||||
|
dts int64
|
||||||
|
|
||||||
nnals int32
|
nnals int32
|
||||||
nals []*x264c.Nal
|
nals []*x264c.Nal
|
||||||
@ -229,9 +230,16 @@ func (e *Encoder) Encode(im image.Image) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e.dts = picOut.IDts
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetTimestamp returns the current PTS and DTS.
|
||||||
|
func (e *Encoder) GetTimestamp() (int64, int64) {
|
||||||
|
return e.pts, e.dts
|
||||||
|
}
|
||||||
|
|
||||||
// Flush flushes encoder.
|
// Flush flushes encoder.
|
||||||
func (e *Encoder) Flush() (err error) {
|
func (e *Encoder) Flush() (err error) {
|
||||||
var picOut x264c.Picture
|
var picOut x264c.Picture
|
||||||
|
Loading…
Reference in New Issue
Block a user