引用
Hi,
I'm trying to develop a basic MPEG-2 Transport Stream decoder in order to extract metadatas about PSI packets. I have a bunch of books and documents (but not the standard itself) describing the stream layout; I also have some consistent TS files for testing and a TS analyser software (Manzanita's MP2TSA) to validate my assertions. The documents I use sometimes disagree, but I was able to filter the correct information up to this point. Now I have the following problem while trying to decode a PAT section: there's an extra byte in the PAT header, undocumented in all documents I've used so far. Below is the beginning of a TS Packet containing a PAT section (the remaining bytes of the packet have a value of FF):
Code:
47 40 00 10 00 00 B0 0D 00 01 C1 00 00 00 02 E1 E0 2F 39 8D 8D .....
|TS Header | PAT Header | ? | Program | CRC32 | Stuffing bytes
According to all the docs I have, the PAT header's length should be equal to 8; but it ended with a mismatch when comparing my results to the ones given by MP2TSA (which is an accurate tool). Adjusting the header's length value to 9 "solves" the problem... but I don't like to use intuitive reasoning! The question is:
Does someone know the exact layout of a PAT header?
Another problem, leading to the same question:
I'm confused about the section_number and last_section_number field values of the PAT header (respectively 0xC1 and 0x00 in the sample above). I found the following description of these fields in the book "Video Demystified, A Handbook for the Digital Engineer", 4th edition (Keith Jack, Newnes, 2005, p.675):
Section_number
[...] The section_number of the first section in the PAT must be 0x00. It is incremented by 1 with each additional section in the PAT.
Last_section_number
This 8-bit binary number specifies the number of the last section (that is, the section with the highest section_number) of the complete PAT.
This is obviously wrong, but I can't figure out why... any ideas?
Thanks for reading
Jerome
引用
The problem is solved...
According to the ITU H.222.0 (05/06) Recommendation (http://www.itu.int/rec/T-REC-H.222.0-200605-I/en), section 2.4.4.2:
[...] When at least one section begins in a given Transport Stream packet, then the payload_unit_start_indicator (refer to 2.4.3.2) shall be set to '1' and the first byte of the payload of that Transport Stream packet shall contain the pointer. When no section begins in a given Transport Stream packet, then the payload_unit_start_indicator shall be set to '0' and no pointer shall be sent in the payload of that packet.
The content of the PAT packet is correctly interpreted this way:
Code:
47 40 00 10 00 00 B0 0D 00 01 C1 00 00 00 02 E1 E0 2F 39 8D 8D .....
|TS Header | * | PAT Header | Program | CRC32 | Stuffing bytes
* = pointer_field
The payload_unit_start is effectively set to 1, so the first byte of the payload data refers to a pointer_field which indicates the number of bytes until the first byte of the section. This makes perfect sense now.
Thanks to myself
:-)
http://forum.videohelp.com/threads/286326-MPEG-2-TS-PAT-header-decoding-problem
分享到:
相关推荐
pca特征提取的matlab代码-EEG-Hand-Movement-Decoding使用深度学习和信号处理算法从脑电信号解码手部运动的研究EEGHandMovementDecodingmaster
Matlab achieve Huffman decoding
VITERBI DECODING HARD AND SOFT DECODING ALGORIHTM
C&C解码:用于统计机器翻译解码的多层句子压缩-组合框架,巢文涵,,在本文中,我们提出了一种新颖的框架以提高统计机器翻译的解码性能,该方法在机器翻译过程中添加了两个额外的步骤。首先,将源文
2进3出递归卷积编译码系统仿真程序,每帧80比特,10万帧。
曼彻斯特编码在optisystem中的程序
增强的极化码逐次抵消列表译码算法,韩冰,王云江,SCL译码是一种有效的极化码译码算法,其中最耗时的部分是排序模块。本文通过一种新的非排序直接选择的方法极大提高了SCL译码方案的��
载入一段语音信号进行分析 进行 PCM 编码和译码,并回放该信号
León van de Pavert REED-SOLOMON ENCODING AND DECODING A Visual Representation
Sources of the Mpeg 1,2 layer 1,2,3 audio encoder and decoder distributed by the ISO group in charge of the MPEG.
万能视频解码器K-Lite Codec Pack 共有三个版本:Basic@Standard和 Full.为您提供绝大多数影音格式的编解码器~这个版是FULL版本,... DivX MPEG-4 Low and Fast motion - XviD Decoding - XviD Encoding - 3ivX D4 ...
完全版则包括对更多不常用文件格式的支持并附带了一个媒体播放器常用视频播放插件合集,包括当前最新的: - BSplayer - DivX Pro Decoding - DivX Pro Encoding - DivX MPEG-4 Low and Fast motion - XviD Decoding ...
SimplifiedMulti-bit Successive Cancellation List Decoding for Polar Codes
Reliability-based Iterative Proportionality logic Decoding of LDPC Codes with Adaptive Decision
decoding of high-capacity color QR codes for mobile applications } , author = { Yang, Zhibo and Xu, Huanle and Deng, Jianyuan and Loy, Chen Change and Lau, Wing Cheong } , journal = { IEEE ...
会议上展示的海报,重现分析运行所需的所有代码,题为,比较1,2和3 的词典和功能解码结果。 安装 无需安装,Python 代码是在 2.7.13 中编写的,因为我很固执,不想更新到 Python 3。需要numpy 、 pandas 、 scipy 、...
Matlab集成的c代码使用自闭症患者的EEG数据进行深度学习情感解码 该存储库包含python和matlab代码,用于在自定义的卷积神经网络(CNN)上处理EEG 2D图像,以对患有和没有患有自闭症谱系障碍(ASD)的个体进行情感...
K-Lite Codec Pack Full是常用视频播放插件合集,包括当前最新的: - BSplayer - DivX Pro Decoding - DivX Pro Encoding - DivX MPEG-4 Low and Fast motion - XviD Decoding - XviD Encoding - 3ivX D4 ...
该资源是描述多符号差分酉空时球形译码算法的一片文章,文章中比较详细的介绍了差分酉空时的传输模型,和多符号球形译码检测。