Open flavioribeiro opened 1 year ago
Flavio, of course. If I can do anything to help, just let me know.
I see you already have asitis parsing the stream, all you really would have to do is make a cuei.Cue instance and pass it the payload from a SCTE-35 packet like this
import
"github.com/futzu/cuei"
var cue cuei.Cue
cue.Decode(payload)
Then you can access whatever you need with dot notation like cue.Command.PTS
cue.Show() will print the Cue in JSON
cue.Show()
type Cue struct {
InfoSection
Command SpliceCommand
Descriptors []SpliceDescriptor `json:",omitempty"`
Packet *PacketData `json:",omitempty"`
}
All the SCTE35 Splice Commands (Splice Insert, Time Signal etc) are consolidated into the SpliceCommand struct and all the Descriptors are consolidated into SpliceDescriptor. No interfaces needed. it makes it much easier to get to vars in the struct.
I put some examples up.
thanks, @futzu !
I was looking at how you were doing things with the close captions, and I added something similar.
https://github.com/futzu/cuei#use-cuei-with-another-mpegts-stream-parser--demuxer
suggested by @tretelny.
Need to check with @futzu if we could use his lib.