donut icon indicating copy to clipboard operation
donut copied to clipboard

support scte-35 parsing

Open flavioribeiro opened this issue 3 years ago • 7 comments
trafficstars

suggested by @tretelny.

Need to check with @futzu if we could use his lib.

flavioribeiro avatar Nov 14 '22 18:11 flavioribeiro

https://github.com/Comcast/scte35-go

flavioribeiro avatar Nov 14 '22 19:11 flavioribeiro

https://github.com/futzu/cuei

flavioribeiro avatar Nov 14 '22 19:11 flavioribeiro

Flavio, of course. If I can do anything to help, just let me know.

futzu avatar Nov 14 '22 21:11 futzu

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.

futzu avatar Nov 14 '22 23:11 futzu

I put some examples up.

futzu avatar Nov 15 '22 23:11 futzu

thanks, @futzu !

flavioribeiro avatar Nov 28 '22 22:11 flavioribeiro

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

futzu avatar Dec 03 '22 01:12 futzu