MCPcopy Index your code
hub / github.com/Comcast/gots

github.com/Comcast/gots @v3.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.0.0 ↗ · + Follow
873 symbols 3,149 edges 57 files 569 documented · 65%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Go Reference Build Status Go Report Card Coverage Status

goTS (Go Transport Streams)

gots (Go Transport Streams) is a library for working with MPEG transport streams. It provides abstractions for reading packet information and program specific information (psi)

Bug / Feature Reporting

Add requests to Github issues. To submit a PR see CONTRIBUTING

Tests

go test -race ./...

Travis-CI will run these tests:

go test -v ./...

License

This software is licensed under the MIT license. For full text see LICENSE

Code of Conduct

We take our code of conduct very seriously. Please abide by it.

Examples

This is a simple example that extracts all PIDs from a ts file and prints them. CLI example parser can be found here

func main() {
    pidSet := make(map[uint16]bool, 5)
    filename := "./scenario1.ts"
    file, err := os.Open(filename)
    if err == nil {
        pkt := make([]byte, packet.PacketSize)
        for read, err := file.Read(pkt); read > 0 && err == nil; read, err = file.Read(pkt) {
                        if err != nil {
                                println(err)
                                return
                        }
            pid, err := packet.Pid(pkt)
            if err != nil {
                println(err)
                continue
            }
            pidSet[pid] = true
        }

            for v := range pidSet {
                fmt.Printf("Found pid %d\n", v)
            }
    } else {
        fmt.Printf("Unable to open file [%s] due to [%s]\n", filename, err.Error())
}

Extension points exported contracts — how you extend this code

SpliceCommand (Interface)
SpliceCommand represent operations available on all SpliceCommands. [3 implementers]
scte35/doc.go
PmtStreamType (Interface)
PmtStreamType is used to represent elementary steam type inside a PMT [2 implementers]
psi/pmtstreamtype.go
PmtElementaryStream (Interface)
PmtElementaryStream represents an elementary stream inside a PMT [2 implementers]
psi/pmtelementarystream.go
PmtDescriptor (Interface)
PmtDescriptor represents operations currently necessary on descriptors found in the PMT [1 implementers]
psi/pmtdescriptor.go
PMT (Interface)
PMT is a Program Map Table. [1 implementers]
psi/pmt.go
PESHeader (Interface)
PESHeader represents operations available on a packetized elementary stream header. [1 implementers]
pes/pesheader.go
PacketWriter (Interface)
PacketWriter is subject to all rules governing implementations of io.Writer Additionally PacketWriter implementations m [1 …
packet/packetwriter.go
Accumulator (Interface)
Accumulator is used to gather multiple packets and return their concatenated payloads. Accumulator is not thread safe. [1 …
packet/accumulator.go

Core symbols most depended-on inside this repo

Open
called by 160
scte35/doc.go
Descriptors
called by 117
scte35/doc.go
NewSCTE35
called by 105
scte35/scte35.go
ProcessDescriptor
called by 77
scte35/doc.go
Equal
called by 39
packet/packet.go
TypeID
called by 30
scte35/doc.go
Write
called by 30
packet/packetwriter.go
PTS
called by 29
scte35/doc.go

Shape

Method 506
Function 308
Struct 24
Interface 23
TypeAlias 11
FuncType 1

Languages

Go100%

Modules by API surface

scte35/doc.go125 symbols
packet/adaptationfield.go54 symbols
scte35/segmentationdescriptor.go41 symbols
psi/pmt_test.go39 symbols
psi/pmtdescriptor.go37 symbols
packet/modify.go34 symbols
scte35/splicecommand.go33 symbols
psi/pmt.go30 symbols
packet/modify_test.go30 symbols
scte35/splicecommandmodify.go27 symbols
ebp/ebp.go27 symbols
scte35/descriptormodify.go26 symbols

For agents

$ claude mcp add gots \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact