Skip to content

An advanced version of sedec which can support to decoding and encoding of MPEG-Section like MPEG-H, DVB

License

Notifications You must be signed in to change notification settings

tehokang/sedec-2.0-java

Repository files navigation

Build Status

Table of Contents

Introduction

SEDEC is to easily make decoder(and even encoder) of tables of DVB, ARIB as MPEG sections and whatever inherited from ISO-13818. SEDEC stand for SEction DECoder. Here whatever mean whoever could put new sections into SEDEC with easy steps.

You could get started to make a kind of sections to decode like following easy step,

  • Create table based on base/Table in case of DVB, arib/Table in case of ARIB
  • Add parse routine in their constructor, basically the constructor get binary data starting table_id as known as beginning of the section.
  • Add getter function if you want to provide interfaces.
  • Add print function if you want to show the value of fields to be decoded.
  • Finally you can add the table into factory of tables

Currently SEDEC-2.0-java is including sections like below, it can be decoded all of them.

DVB

Tables as known as section

  • Program Association Table AKA PAT
  • Program Map Table (PMT)
  • Conditional Access Table (CAT)
  • Application Information Table (AIT)
  • Bouquet Association Table (BAT)
  • Discontinuity Information Table (DIT)
  • Event Information Table (EIT)
  • Network Information Table (NIT)
  • Running Status Table (RST)
  • Selection Information Table (SIT)
  • Service Description Table (SDT)
  • Stuffing Table (ST)
  • Time Date Table (TDT)
  • Time Offset Table (TOT)

Descriptors :

  • Application Descriptor
  • Application Name Descriptor
  • Application Recording Descriptor
  • Application Usage Descriptor
  • Connection Requirement Descriptor
  • Parental Rating Descriptor
  • Simple Application Boundary Descriptor
  • Simple Application Location Descriptor
  • Transport Protocol Descriptor

ARIB

TLV Container

  • IPv4 Packet
  • IPv6 Packet
  • Signalling Packet
  • Compressed IP Packet
  • Null Packet

Network Time Protocol Data in IPv4, IPv6 Packet

  • Network Time Protocol Data

TLV-SI in Signalling Packet

Tables :

  • Address Map Table (AMT)
  • TLV_Network Information Table (TLV-NIT)

Descriptors:

  • Channel Bonding Cable Delivery System Descriptor
  • Network Name Descriptor
  • Remote Control Key Descriptor
  • Sarelite Delivery System Descriptor
  • Service List Descriptor
  • System Management Descriptor

MMTP as known as MPEG Media Transport Protocol in Compressed IP Packet

  • MMTP Packet Header
  • MMTP Packet Payload
    • MPU-MFU
      • Video
      • Audio
      • TTML
      • Application and Index Item
      • General Purpose Data
    • Signalling Message
      • PA Message
      • CA Message
      • Data Transmission Message
      • M2 Section Message
      • M2 Short Section Message

These messages are deliverying table like following :

Tables of based on B10 :

  • Bouquet Association Table (BAT)
  • Broadcaster Information Table (BIT)
  • Conditional Access Table (CAT)
  • Discontinuity Information Table (DIT)
  • Download Control Message (DCM)
  • Entitlement Control Message (ECM)
  • Entitlement Management Message (EMM)
  • Event Information Table (EIT)
  • Event Relation Table (ERT)
  • Index Transmission Table (ITT)
  • Linked Description Table (LDT)
  • Local Event Information Table (LEIT)
  • Network Board Information Table (NBIT)
  • Network Information Table (NIT)
  • Partial Content Announcement Table (PCAT)
  • Program Association Table (PAT)
  • Program Map Table (PMT)
  • Running Status Table (RST)
  • Selection Information Table (SIT)
  • Service Description Table (SDT)
  • Software Download Trigger Table (SDTT)
  • Stuffing Table (ST)
  • Time Date Table (TDT)
  • Time Offset Table (TOT)

Tables of based on B60

  • Conditional Access Table (CAT)
  • Data Directory Management Table (DDMT)
  • Data Asset Management Table (DSMT)
  • Data Content Configuration Table (DCCT)
  • Download Control Message (DCM)
  • Download Management Message (DMM)
  • Entitlement Control Message (ECM)
  • Entitle Management Message (EMM)
  • Event Message Table (EMT)
  • Layout Configuration Table (LCT)
  • MH-Application Information Table (MH-AIT)
  • MH-Broadcaster Information Table (MH-BIT)
  • MH-Common Data Table (MH-CDT)
  • MH-Event Information Table (MH-EIT)
  • MH-Service Description Table (MH-SDT)
  • MH-Sofrware Download Trigger Table (MH-SDTT)
  • MH-Time Offset Table (MH-TOT)
  • MMH-Package Table (MMT-PT)
  • Package List Table (PLT)

Above all tables can include descriptors like following :

Descriptors :

  • Access Control Descriptor
  • Application Service Descriptor
  • Asset Group Descriptor
  • Audio Specific Config
  • Background Color Descriptor
  • Content Copy Control Descriptor
  • Content Usage Control Descriptor
  • Dependency Descriptor
  • Emergency Information Descriptor
  • Emergency News Descriptor
  • Event Package Descriptor
  • IP Data Flow Descriptor
  • Lined PU Descriptor
  • Locked Cache Descriptor
  • Message Authentication Method Descriptor
  • MH-Application Boundary and Permission Descriptor
  • MH-Application Descriptor
  • MH-Application Expiration Descriptor
  • MH-Audio Component Descriptor
  • MH-Autostart Priority Descriptor
  • MH-Broadcaster Name Descriptor
  • MH-Cache Control Info Descriptor
  • MH-CA Contract Info Descriptor
  • MH-CA Service Descriptor
  • MH-CA Startup Descriptor
  • MH-Component Group Descriptor
  • MH-Compression Type Descriptor
  • MH-Content Descriptor
  • MH-Data Component Descriptor
  • MH-Download Protection Descriptor
  • MH-Event Group Descriptor
  • MH-Expire Descriptor
  • MH-Extended Event Descriptor
  • MH-External Application Control Descriptor
  • MH-HEVC Descriptor
  • MH-Hierachy Descriptor
  • MH-Info Descriptor
  • MH-Linkage Descriptor
  • MH-Local Time Offset Descriptor
  • MH-Logo Transmission Descriptor
  • MH-MPEG4 Audio Descriptor
  • MH-MPEG4 Audio Extension Descriptor
  • MH-Network Download Content Descriptor
  • MH-Parental Rating Descriptor
  • MH-Playback Application Descriptor
  • MH-Randomized Latency Descriptor
  • MH-Series Descriptor
  • MH-Service Descriptor
  • MH-Service List Descriptor
  • MH-Short Event Descriptor
  • MH-Simple Application Location Descriptor
  • MH-Simple Playback Application Location Descriptor
  • MH-SI Parameter Descriptor
  • MH-Stream Identifier Descriptor
  • MH-Target Region Descriptor
  • MH-Transport Protocol Descriptor
  • MH-Type Descriptor
  • MPU-Download Content Descriptor
  • MPU-Extended Timestamp Descriptor
  • MPU-Node Descriptor
  • MPU-Presentation Region Descriptor
  • MPU-Timestamp Descriptor
  • Multimedia Service Information Descriptor
  • PU Structure Descriptor
  • Related Broadcaster Descriptor
  • Scrambler Descriptor
  • Unlocked Cache Descriptor
  • UTC NPT Reference Descriptor
  • Video Component Descriptor

Architecture

Every Tables and Descriptors are based on base/Table or arib/Table and so on what can be base of all of tables, and the bases are including BitReadWriter which can read/write bit values.

Case Of DVB

  • SectionFactory : User can use this factory to get table if user doesn't know a kind of table.
  • BitReadWriter : utility which can read/write bitstream from/into section buffer.
  • Table : base class of all of table.
  • Descriptor : base class of all of descriptor

Case Of ARIB

Package Tree

.
├── sedec2 : main package name
│   ├── arib : tables, descriptors for ARIB
│   ├── base : tables, descriptor of base class
│   ├── dvb : tables, descriptors for DVB
│   └── util : utility like logger
└── zexamples
    └── decoder : examples of both arib, dvb

How To Build

Case of eclipse with ant

We could build with Apache Ant as build tool, please install ant in your system. Following is explaining with prerequisite you already installed. Obviously ant build tool has almost same mechanism with make tool like make has target, dependencies and command.

Basically targets of ant has followings :

  • build (default)
  • build-project : To build with versioning up
  • clean : To delete bin and dist directory
  • deploy : To deploy remote server
  • doc : To generate javadoc
  • init : To initialize build environment
  • release-arib-example-decoder : To make arib example which can decode arib section as jar
  • release-dvb-example-decoder : To make dvb example which can decode dvb section as jar
  • release-sdk : To release sedec as library
  • release-sdk-obfuscate : To relese sedec as obfuscate like being minified

You can type commands to build one of targets

$cd sedec-2.0-java
$ant release-arib-example-decoder

To use this in android, you could just import this library in your gradle of project.

Case of android studio

If you would like to use this library in android studio then just done with following dependency.

dependencies {
    implementation 'com.teho.sedec:sedec-java:2.0.5'
}

How To Run

After building a target, release-sdk via Eclipse(or ANT), you can run with parameters as section path dumped, ts and even tlv file. Please notice I run followings in bin folder after building

When you type default command to run SimpleApplication then you can see the helps like below,

PROMPT> java -classpath .:../libs/commons-cli-1.4.jar  zexamples.arib.SimpleApplication
usage: SimpleApplication in sedec2
 -e,--extract                      Enable to extract elementary stream
 -s,--input_section_file      Target input section
 -sp,--show_progress               Enable to show progress bar
 -st,--show_tables                 Enable to print tables
 -tlv,--input_tlv_file        Target input file as tlv
 -ts,--input_ts_file          Target input file as ts
 -tstlv,--input_tstlv_file    Target input file as ts including tlv

When you'd like to run with section file then you can type command like this,

PROMPT> java -classpath .:../libs/commons-cli-1.4.jar  zexamples.arib.SimpleApplication -s /Users/tehokang/Downloads/ts/dumped_section.ait

When you'd like to run with TS file then you can type command like this,

PROMPT> java -classpath .:../libs/commons-cli-1.4.jar  zexamples.arib.SimpleApplication -ts /Users/tehokang/Downloads/ts/DasErste_dvbt.ts -sp

When you'd like to run with TLV file then you can type command like this,

PROMPT> java -classpath .:../libs/commons-cli-1.4.jar  zexamples.arib.SimpleApplication -tlv /Users/tehokang/Downloads/ts/another.tlv -sp

If you have any questions and if the app is misbehaving or missing critical features write me at tehokang@gmail.com.

To Do

  • I'm not sure what encoding of CRC32 is working correctly, the shift model can be wrong.
  • More tables what you could know

About

An advanced version of sedec which can support to decoding and encoding of MPEG-Section like MPEG-H, DVB

Topics

Resources

License

Stars

Watchers

Forks

Languages