fix video no ctts bug
This commit is contained in:
parent
2364b70034
commit
c7890dcc2e
@ -229,6 +229,7 @@ func (self *Stream) incSampleIndex() (duration int64) {
|
||||
fmt.Printf("incSampleIndex sampleIndex=%d sampleOffsetInChunk=%d sampleIndexInChunk=%d chunkGroupIndex=%d chunkIndex=%d\n",
|
||||
self.sampleIndex, self.sampleOffsetInChunk, self.sampleIndexInChunk, self.chunkGroupIndex, self.chunkIndex)
|
||||
}
|
||||
|
||||
self.sampleIndexInChunk++
|
||||
if self.sampleIndexInChunk == self.sample.SampleToChunk.Entries[self.chunkGroupIndex].SamplesPerChunk {
|
||||
self.chunkIndex++
|
||||
|
6
muxer.go
6
muxer.go
@ -91,7 +91,6 @@ func (self *Stream) fillTrackAtom() (err error) {
|
||||
SubType: "vide",
|
||||
Name: "Video Media Handler",
|
||||
}
|
||||
self.sample.CompositionOffset = &atom.CompositionOffset{}
|
||||
self.trackAtom.Media.Info.Video = &atom.VideoMediaInfo{
|
||||
Flags: 0x000001,
|
||||
}
|
||||
@ -131,6 +130,11 @@ func (self *Muxer) WriteHeader() (err error) {
|
||||
if self.mdatWriter, err = atom.WriteAtomHeader(self.W, "mdat"); err != nil {
|
||||
return
|
||||
}
|
||||
for _, stream := range self.streams {
|
||||
if stream.Type().IsVideo() {
|
||||
stream.sample.CompositionOffset = &atom.CompositionOffset{}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user