Reading information from PAT section (MPEG-TS)

南笙酒味 提交于 2019-12-01 21:03:17

Each program_number is 16 bits and is followed by 16 bits consisting of 3 x '1' bits and a 13 bit program_map_pid (or network_pid ifprogram_number`=0)

Start at offset 13 in your dump and read pairs of 16-bit words, masking out the top 3 bits of the second word.

e.g.

offset   bytes          words        program_number pid
======   ===========    =========    ============== ======================
000D:    00 00 E0 10 => 0000 E010 => 0000           0010 (network_pid)
0011:    00 01 E0 24 => 0001 E024 => 0001           0024 (program_map_pid)
0015:    00 02 E0 25 => 0002 E025 => 0002           0025 (program_map_pid)
0019:    etc..
001D:    etc..
0021:    etc..
0025:    00 1C E0 6F => 001C E06F => 001C           006F (program_map_pid)
0029:    43 9D E3 F1 => 439D E3F1 => 439D           03F1 (program_map_pid)
002D:    etc..
etc..

In theory it is more complicated than this as there can be multiple program association sections in a PAT and the above will only help with the 1st section.

For more details see section 2.4.4.3 of ISO/IEC 13818-1, specifically table 2-25.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!