Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account for PTS adjustment in SCTE35 Event Streams #50

Open
guygrigsby opened this issue Jun 26, 2017 · 4 comments
Open

Account for PTS adjustment in SCTE35 Event Streams #50

guygrigsby opened this issue Jun 26, 2017 · 4 comments

Comments

@guygrigsby
Copy link
Collaborator

In the CLI we do not account for the pts_adjust field when dumping SCTE35 info. I don't know if this is greater than just the CLI, but we need to figure out the extent of the issue and fix it.

@BlakeOrth
Copy link
Collaborator

It's accounted for in the actual code:

gots/scte35/scte35.go

Lines 85 to 103 in ad6cb5d

ptsAdjustment := uint40(buf.Next(5)) & 0x01ffffffff
// skip cw_index, tier and spliceCommandLength
// since it can be 0xfff(unknown) so it's pretty much useless
buf.Next(4)
s.commandType = SpliceCommandType(readByte())
switch s.commandType {
case TimeSignal, SpliceInsert:
var cmd SpliceCommand
if s.commandType == TimeSignal {
cmd, err = parseTimeSignal(buf)
} else {
cmd, err = parseSpliceInsert(buf)
}
if err != nil {
return err
}
// add the pts adjustment to get the real value
s.pts = cmd.PTS().Add(ptsAdjustment)
s.hasPTS = cmd.HasPTS()

If the CLI is using this directly and it's not computing the correct PTS values we have even more to be concerned about

@guygrigsby
Copy link
Collaborator Author

That's even stranger. Got these results on a pass over with the cli. Putting them here so I don't forget.

➜  Brooklyn99_223_HD_C3_AUTH_movie_scenario1_IP_720p24_TS cli -f Brooklyn99_223_HD_C3_AUTH_movie_LVLH01.ts -scte35
Pat
	PMT PIDs map[1:480]
	Number of Programs 1
Program #1 PMT
	PIDs [481 494 500]
	Elementary Streams
		Pid 481 : StreamType 27
			SCTE Adaptation (151)
			AVC Video (40)
			EBP (233)
			Maximum Bit-Rate (877)
		Pid 494 : StreamType 15
			SCTE Adaptation (151)
			ISO 639 Language (code=eng, audioType=0)
			EBP (233)
			Maximum Bit-Rate (260)
		Pid 500 : StreamType 134
SCTE35 Message on PID 500
	Command Type TimeSignal
	PTS 0
	---> OUT Segmentation Descriptor
		Event ID 1
		Type SegDescProviderPOStart
	<--- IN Segmentation Descriptor
		Event ID 1
		Type SegDescProviderPOEnd

The Time Signal above is at PTS 0. I do not think that is correct. Coral VOD packager puts it at 185760.

@mikereedell
Copy link
Collaborator

@guygrigsby do you have a SCTE-35 signal that shows this?

@guygrigsby
Copy link
Collaborator Author

I have an asset. I'll send it to you. Can't post it here because copyright.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants