GithubHelp home page GithubHelp logo

mp2ts-tools's Introduction

Test golangci-lint GoDoc Go Report Card license

mp2ts-tools - A collection of tools for MPEG-2 TS

MPEG-2 Transport Stream is a very wide spread format for transporting media.

This repo provides some tools to facilitate analysis and extraction of data from MPEG-2 TS streams.

mp2ts-info

mp2ts-info is a tool that parses a TS file, or a stream on stdin, and prints information about the video streams in JSON format.

mp2ts-pslister

mp2ts-pslister is a tool that shows information about SPS, PPS (and VPS for HEVC) in a TS file.

mp2ts-nallister

mp2ts-nallister is a tool that shows information about PTS/DTS, PicTiming SEI, and NAL units.

How to run

You can download and install any tool directly using

> go install github.com/Eyevinn/mp2ts-tools/cmd/mp2ts-info@latest

If you have the source code you should be able to run a tool like

> cd cmd/mp2ts-info
> go mod tidy
> go run . h

Alternatively, you can use the Makefile to build the tools or make a coverage check. The Makefile will set the version depending on the Git commit used.

Commits and ChangeLog

This project aims to follow Semantic Versioning and Conventional Commits. There is a manual ChangeLog.

License

MIT, see LICENSE.

Support

Join our community on Slack where you can post any questions regarding any of our open source projects. Eyevinn's consulting business can also offer you:

  • Further development of this component
  • Customization and integration of this component into your platform
  • Support and maintenance agreement

Contact [email protected] if you are interested.

About Eyevinn Technology

Eyevinn Technology is an independent consultant firm specialized in video and streaming. Independent in a way that we are not commercially tied to any platform or technology vendor. As our way to innovate and push the industry forward we develop proof-of-concepts and tools. The things we learn and the code we write we share with the industry in blogs and by open sourcing the code we have written.

Want to know more about Eyevinn and how it is to work here. Contact us at [email protected]!

mp2ts-tools's People

Contributors

tobbee avatar wkkkkk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mp2ts-tools's Issues

Output SPS when it changes in mp2ts-pslister

mp2ts-pslister currently lists the parameter sets every time they appear.

That is not very interesting. We should instead only report new entries (like a new PPS coming later),
or a change of parameter sets (compared to what we saw earlier).

For changes it would be good to get some indication on where the change happened, e.g. by outputting the last packet number of PCR value (then we need to read the PCR PID from PMT and extract PCR from an Adaptation Field).

We should also change the ppsnalu structure to a map, so that we can store any value needed there.

Make three tools instead of one

Split ts-info into three tools with name starting with "mp2ts-" similar to what is done in "mp4ff".

  • mp2ts-info should show general information about the whole file like pids, bitrates, service, etc
  • mp2ts-nallister should generate a list of nalus with information about timestamps, rai, SEI etc.
  • mp2ts-pslister should list and explode parameter sets.

These are all analogous to tools in the mp4ff repo.

Add printout of picture type for AVC

The picture type is not given by the NAL unit type, but by the picture type as encoded in the Slice Header.
This is extracted and displayed as I, B, or P in mp4ff-nallister, and the same should be done here (but in JSON format).

Add HEVC support

Add support to show information about HEVC including parameter sets and NALUs.

The codec should be auto-detected and there should be tests for the output using new files.

Make new PID filter tool

Make a new tool "ts-pidfilter" where one can configure PIDS to drop or keep.
The PMT should be updated to be consistent with what is kept.

This tool should work on the Packet level by processing packet by packet.

Add detection and print out of SCTE-35 markers

Beyond seeing elementary streams from "mp2ts-info" it would be good to see if there is a SCTE-35 PID and how many markers are in the stream. A parameter could specify that they should be printed as well.

More video statistics and optional nalu printout

The tool should present the frame rate, video bitrate, and video GoP duration (with variation) in JSON format at the end
of processing. It should also happen when pressing Ctrl-C (useful for live case when piping data to stdin).

Frame-rate is most easily obtained from video timestamps. If DTS is present, use that, otherwise use PTS to get a continuously growing timeline. There is also wrap-around since PTS/DTS is 33bits.

GoP-duration can be obtained from RAI-marker distance, but also from checking the NAL type (IDR distance). Collect and present both.

It may now happen that the timing information is more interesting than the nalu and SEI information,
so make the latter optional by introducing two command line options:

-nalu
-sei

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.