Support 192 byte TS packets (Bluray)
I was trying to run your project as a way to sanity test my own similar project, and ran into an issue parsing 192 byte packets from Blu-ray M2TS files.
Prior to the Sync byte there would be a 4-byte "ExtraHeader"
Something like this snippet:
type TSPacketExtraHeader struct {
CopyPermissionIndicator uint8 // 2-bits
ArrivalTimeStamp uint32 // 30-bits, 27 MHz unit ticks
}
The fields are trivial to decode, here is a snippet:
// Blu-ray extra header
func (h *TSPacketExtraHeader) Read(p *PacketBuf192Byte) {
h.CopyPermissionIndicator = (p[0] & 0xC0) >> 6
h.ArrivalTimeStamp = binary.BigEndian.Uint32(p[0:4]) & 0x3FFFFFFF
}
I haven't delved into the ASTITS code very deeply, so my apologies if you actually support 192 sized packets. If you're interested in the feature then I'd be happy to collaborate by sending patches.
Can you share the logs/errors you're experiencing?
Are you sure the 4 additional bytes are before the sync byte and not right after? 🤔 That sounds really weird having a packet not starting with a sync byte 🤔
If your packets do start with sync bytes, you can use the DemuxerOptPacketSize() option when using NewDemuxer() to specify your packet size. However even if that solution works properly, I'm interested in logs/errors you're experiencing since that would mean packet size auto detection is not working properly.