Wowza Community

HLS *.ts analysis tool

Greetings,

Our team has been researching some HLS statistics use cases recently. As one of results, we got a Ruby script which analyses *.ts file and outputs its containing streams.

It’s open sourced at github: https://github.com/WMSPanel/mpeg2ts so feel free to use, clone and modify it as this is released under GPLv3 license.

Here’s sample output:

“Elementary Stream Description {”

" PID=256"

" TYPE=27"

" TYPE_DESC=AVC video stream as defined in ITU-T Rec. H.264 | ISO/IEC 14496-10 Video"

“}”

“Elementary Stream Description {”

" PID=257"

" TYPE=15"

" TYPE_DESC=ISO/IEC 13818-7 Audio with ADTS transport syntax"

“}”

“Total stats”

“Program Association Map {”

" PID=0x00"

" packets count = 1"

“}”

“Program Map {”

" PID=4095"

" packets count = 1"

“}”

“Elementary Stream packages {”

" PID=256"

" DESC: AVC video stream as defined in ITU-T Rec. H.264 | ISO/IEC 14496-10 Video"

" packets count = 2846"

“}”

“Elementary Stream packages {”

" PID=257"

" DESC: ISO/IEC 13818-7 Audio with ADTS transport syntax"

" packets count = 1150"

“}”

Verbose mode provides each package major flags, like:

“PUSI=1 PID=256 AFE=3 CC=1”

“PUSI=0 PID=256 AFE=3 CC=2”

“PUSI=1 PID=256 AFE=3 CC=3”

“PUSI=1 PID=257 AFE=1 CC=1”

“PUSI=0 PID=257 AFE=1 CC=2”

“PUSI=0 PID=257 AFE=1 CC=3”

“PUSI=0 PID=257 AFE=1 CC=4”

“PUSI=0 PID=257 AFE=1 CC=5”

“PUSI=0 PID=257 AFE=3 CC=6”

“PUSI=1 PID=256 AFE=3 CC=4”

“PUSI=1 PID=257 AFE=1 CC=7”

“PUSI=0 PID=257 AFE=1 CC=8”

“PUSI=0 PID=257 AFE=1 CC=9”

“PUSI=0 PID=257 AFE=1 CC=10”

“PUSI=0 PID=257 AFE=1 CC=11”

“PUSI=0 PID=257 AFE=3 CC=12”

“PUSI=1 PID=256 AFE=3 CC=5”

“PUSI=0 PID=256 AFE=3 CC=6”

“PUSI=1 PID=256 AFE=3 CC=7”

“PUSI=1 PID=257 AFE=1 CC=13”

“PUSI=0 PID=257 AFE=1 CC=14”

“PUSI=0 PID=257 AFE=1 CC=15”

“PUSI=0 PID=257 AFE=1 CC=0”

“PUSI=0 PID=257 AFE=1 CC=1”

“PUSI=0 PID=257 AFE=3 CC=2”

“PUSI=1 PID=256 AFE=3 CC=8”

“PUSI=0 PID=256 AFE=3 CC=9”

“PUSI=1 PID=257 AFE=1 CC=3”

“PUSI=0 PID=257 AFE=1 CC=4”

“PUSI=0 PID=257 AFE=1 CC=5”

“PUSI=0 PID=257 AFE=1 CC=6”

“PUSI=0 PID=257 AFE=1 CC=7”

I’m sure it might be useful for some of streaming people here.

Let me know of any questions.

We’ve made an update for the tool. It is also now able to get and save PES packets info. This info includes all PES packets for all streams of current transport stream.

Check out github page for overview and download.

BTW, during the analysis we found that when ffmpeg tool makes MP4 to HLS transmuxing, it adds too many PAT and PMT tables into *.ts chunks. This doesn’t comply with Apple recommendations and makes about 8% additional traffic overhead.

To compare, Wowza follows Apple’s comments and makes perfect *.ts chunks.