GithubHelp home page GithubHelp logo

gots's Introduction

GoDoc 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

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())
}

gots's People

Contributors

guygrigsby avatar davemt avatar blakeorth avatar paulboschert avatar stilldavid avatar mikereedell avatar ianeckart avatar tmm1 avatar cveazey avatar jessejlt avatar ieckart avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.