Reputation: 21
I detect new PES packet in PES demultiplexer searching packet_start_code_prefix (0x000001). When it occurs then I can read PES_packet_length and so I can extract the current PES packet from byte stream. But if it is a H.264 video stream then PES packet's PTS is zero for alternate PES packets? In such case can I assume those two packets are actually one but split accross the PES packets and use the previous PES packet's PTS as the PTS of the packet with zero timestamp?
Upvotes: 1
Views: 649
Reputation: 8254
PTS is optional - so it is not a violation of the specification. If you don't have PTS/DTS than you can derive it from information in the elementary stream. Let's ignore frame re-ordering for the moment than you can assume that the next frame's DTS(1) is DTS(0) + frame length. You can assume one access unit per PES packet.
Upvotes: 2