1

What is the proper logic when creating PES packets from video ES frame that is larger than 65527 bytes ? Because PES_packet_length is 16bits in length not entire ES frame can be represented.

Should one split one ES frame in multiple PES packets ? If yes and video frame is keyframe does only first PES packet's TS packet have random_access_indicator==1 ? If yes should all PES packets have PTS/DTS set to same value or just first PES packet have PTS/DTS ?

Alex
  • 2,837
  • 5
  • 25
  • 27

1 Answers1

2

For video frames, it is legal to use a size of 0 for the PES length.

szatmary
  • 29,969
  • 8
  • 44
  • 57
  • Is it also legal to split one video ES frame in multiple PES packets? – Alex Dec 08 '14 at 18:54
  • I would need to check the specification, and it may vary between codecs. For AVC, a frame can 'continue' and finish in the next PES packet. But This PES packet is also the start of the next frame. So there is still 1 PES packet for every frame. – szatmary Dec 08 '14 at 18:59
  • i have problem understanding your last comment, if frame can continue in next packet than "1 PES packet for every frame" is contradictory? – Alex Dec 08 '14 at 19:57
  • There are the same number of PES packets and frames. 1:1 But the boundaries do not need to be the same. This is sometimes done to avoid extra padding (carrying the remainder of previous frame into the next frame) – szatmary Dec 08 '14 at 20:03
  • http://stackoverflow.com/questions/25843384/how-are-access-units-aligned-within-pes-packets-in-apples-hls – szatmary Dec 08 '14 at 20:13
  • so if AVC keyframe is larger than 64KB then I must set PES_packet_length = 0 (unbounded)? – Alex Dec 08 '14 at 20:27
  • Personally, I would set it to 0 on all AVC frames even if it is less than 64k. That's what I do, and never had a problem. – szatmary Dec 08 '14 at 20:31