All Projects → NoordGuy → tssi2

NoordGuy / tssi2

Licence: GPL-3.0 License
tssi2 is a header-only library for parsing MPEG-2 and DVB Transport Streams in the domain of multimedia processing applications.

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to tssi2

libdvbtee
dvbtee: a digital television streamer / parser / service information aggregator supporting various interfaces including telnet CLI & http control
Stars: ✭ 65 (+261.11%)
Mutual labels:  mpegts, dvb, mpeg2, dvb-t
node-dvbtee
MPEG2 transport stream parser for Node.js with support for television broadcast PSIP tables and descriptors
Stars: ✭ 24 (+33.33%)
Mutual labels:  mpegts, dvb, dvb-psi, dvbt
dvbinspector
DVB Inspector is an open-source DVB analyzer, written in java
Stars: ✭ 80 (+344.44%)
Mutual labels:  dvb, dvb-psi, dvb-t, mpeg-ts
laav
Asynchronous Audio / Video Library for H264 / MJPEG / OPUS / AAC / MP2 encoding, transcoding, recording and streaming from live sources
Stars: ✭ 50 (+177.78%)
Mutual labels:  video-processing, mpegts, video-streaming
SSffmpegVideoOperation
This is a library of FFmpeg for android... 📸 🎞 🚑
Stars: ✭ 261 (+1350%)
Mutual labels:  mpeg, video-processing, video-streaming
Vidgear
A High-performance cross-platform Video Processing Python framework powerpacked with unique trailblazing features 🔥
Stars: ✭ 2,048 (+11277.78%)
Mutual labels:  video-processing, video-streaming
gilfoyle
Distributed video encoding, hosting and streaming (WIP)
Stars: ✭ 73 (+305.56%)
Mutual labels:  video-processing, video-streaming
mpegts
A simple implementation of mpegts(including muxer and demuxer)
Stars: ✭ 21 (+16.67%)
Mutual labels:  mpeg, mpegts
Platform Install Packages
Official deployment packages to install the Kaltura platform on a server or cluster environments using native OS package managers
Stars: ✭ 436 (+2322.22%)
Mutual labels:  video-processing, video-streaming
restreamer
HbbTV 1.0/1.1 HTTP streaming proxy
Stars: ✭ 33 (+83.33%)
Mutual labels:  mpegts, hbbtv
mux-python
Official Mux API wrapper for python projects, supporting both Mux Data and Mux Video.
Stars: ✭ 34 (+88.89%)
Mutual labels:  video-processing, video-streaming
Awesome Video
A curated list of awesome video frameworks, libraries, specifications and software.
Stars: ✭ 124 (+588.89%)
Mutual labels:  video-processing, video-streaming
Screen Recorder Ffmpeg Cpp
*Multimedia project* A screen recording application to capture your desktop and store in a video format. Click here to watch the demo
Stars: ✭ 98 (+444.44%)
Mutual labels:  video-processing, video-streaming
Mux Elixir
Official Mux API wrapper for Elixir projects, supporting both Mux Data and Mux Video.
Stars: ✭ 41 (+127.78%)
Mutual labels:  video-processing, video-streaming
DumpTS
Extract elementary stream from all kinds of media files, show inside media meta information and reconstruct Transport-Stream, ISOBMFF, Matroska and MMT media files
Stars: ✭ 25 (+38.89%)
Mutual labels:  mpegts, mpeg2
scte35-threefive
threefive is the highest rated SCTE35 parser, ever. maybe.
Stars: ✭ 75 (+316.67%)
Mutual labels:  mpegts, mpeg-ts
Server
The Kaltura Platform Backend. To install Kaltura, visit the install packages repository.
Stars: ✭ 293 (+1527.78%)
Mutual labels:  video-processing, video-streaming
viewts
Display PCR, DTS, PTS, bitrate, jitter of a mpeg TS.
Stars: ✭ 46 (+155.56%)
Mutual labels:  mpeg, mpegts
iptvx
IPTV player and streamer for Linux that allows to play any stream that LibVLC can play, offers an overlay based on WebKit using HTML5, JavaScript and CSS and uses XMLTV data for EPG information. It allows the playback of URLs, files and can grab URLs from shell scripts. XMLTV EPG data can be downloaded from URLs or grabbed from shell scripts.
Stars: ✭ 65 (+261.11%)
Mutual labels:  video-streaming, iptv
mux-go
Official Mux API wrapper for golang projects, supporting both Mux Data and Mux Video.
Stars: ✭ 69 (+283.33%)
Mutual labels:  video-processing, video-streaming

tssi2 (Transport Stream Service Information v2)

tssi2 is a header-only library for parsing MPEG-2 and DVB Transport Streams in the domain of multimedia processing applications.

The entire implementation is provided inline in the headers under the include directory. A reference documentation is stored under docs. A modern C++ compiler (C++ 14 / C++ 17) is necessary.

While the main header include/tsparser.hpp provides access to the whole library, it is also possible to break out required parts. This comes in handy if you already have a PSI or PES assembler and need some additional tables or descriptors - in this case just include include/specifications.hpp.

Dependencies:

  • C++ Guideline Support Library (header-only, included; mostly needed for gsl::span<const T>, a type just waiting for replacement by std::array_view<T> or std::basic_string_view<T>)

License

The GNU General Public License v3 applies to this project.

If you need another (e.g. commercial) license, contact me.

Features

📌 Fast
See Benchmark
📌 Modern and leak-free by default
C++ 14 / C++ 17 / GSL
📌 Under active development
If there has not been an push for a while the next one will happen nevertheless.
📌 Lightweight
The library is a few kb in size and header-only.
📌 Cross-platform
Windows, Linux, Mac,... should be supported
📌 No-throw
Transport Streams are prone to data corruptions. tssi2 is designed to handle data errors and not to throw. This is not a no-throw guarantee! Some functions might throw (see the docs).
📌 Multi-threading support
Reentrant with shared mutual exclusion
📌 (To some extent) class-less
Processing of MPEG and DVB objects by stateless functions. No class overhead.
📌 Modular
Custom data processors can replaced provided processors on any level. Custom allocators are supported as well.

tssi1 offers some nice features like ISO 13818-6 handling and will remain available on GitHub.

Benchmark

tssi2 is compared against the simple memory read operation read.

void read(span<const char> data) {
    for (auto v : data) {}
}

Only the time spent in tssi2 or readis measured. Disc to memory transfers are omitted. Data is processed in 1MB chunks.

tssi benchmark

All tests were conducted on a HP Spectre x360 with Intel Core i7-7500U. The source code is available under examples/benchmark.

Quick start

We want to detect the transmission time of a Transport Stream. Let us suppose you already have included the stream and vector files from C++ and introduced the namespace std (a source file is available, see examples).

First of all, we load a Transport Stream into a buffer variable.

auto f = ifstream{ "examples/data/ard.ts", ifstream::binary };
auto b = vector<char>( 4000000 );
f.read(b.data(), b.size());

Keep in mind to check for errors in real programs. We skip this part to illustrate the API itself.

We now create a TSParser providing 188-byte TS packets for a PSIHeap that will process and store program-specific information for common usage (for this reason a shared pointer is used to share its ownership).

auto ts = tssi::TSParser<>();
auto heap = make_shared<PSIHeap<>>();

The time and date information is stored on packets with PID 0x14. We tell the parser what packets we are interested in and where to send them.

ts.pid_parser({ 0x14 }, heap);

This could also be a lambda

auto pid_parser = make_shared < LambdaNode >([&](auto data) { });
ts.pid_parser({ 0x100, 0x200, 0x300 }, pid_parser);

or a PESAssembler if you are interested in packetized elementary streams.

With the buffer and parser set up, we can process the data.

ts(b);

The PSI table_ids we are looking for are 0x70 and 0x73, but first we retrieve a data reference from the heap.

auto& psi_data = heap->psi_heap();
for (auto& v : psi_data)
    // v.first: section_identifier tuple 
    //   (table_id, table_id_ext, section_number)
    // v.second: PSISection
    if ((get<0>(v.first) == 0x70) || (get<0>(v.first) == 0x73)) {

Direct access to the section's data is available via v.second.psi_data().

        auto data = v.second.psi_data();

The functions to analyze sections and descriptors are organized in namespaces. Utilize the using statement if appropriate.

        using namespace tssi::etsi300468::time_date_section;
        auto time = UTC_time(data);
        cout << ctime(&time) << endl;
        break;
    }	

The program might now result in an output like:

  Fri Oct 28 23:06:06 2005

Documentation

Download or clone the repository to access the HTML documentation located under docs. For a full definition of all values have a look at the mentioned specifications.

Examples

Advertise by utilize:

  • Data: 272MB Transport Stream sample (approx. 1min DVB satellite capture), test file for the following examples.
  • Minimal: The quick start guide's source code.
  • Benchmark: Basic chronometry.
  • PSI Data: Parsing of Program-specific information to HTML.
  • Audio/Video Parser: Extraction of elementary stream (audio and video in this case) to disc.
  • Multi-threading: A demo on reading from PSIHeap while TSParser tries to fill it with new information.
  • Video player: A video player using ffmpeg and SDL2.

Building the docs

Should you want to build the docs for yourself, make robodoc available and use doc.shor doc.bat. Modify the style either in the respective file or in robodoc.rc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].