2

Usually for videos the marker bit of RTP Packet indicates the last packet of the RTP. So, with this it is guaranteed that I will receive 1 frame per packet or can receive more than one?

In the case beyond the depacketization I would have to make a parser to separate the H.264 frames?

If I can get more than one frame per RTP ​​packetit is possible to get a piece of the next frame? Or all frames within the RTP packet even if more than one are completes?

Best regards,

pcbb
  • 67
  • 2
  • 4

1 Answers1

3

RFC 6184 "RTP Payload Format for H.264 Video" has answers for the raised questions. It can be both ways: 2+ NAL units per packet, and 1 NAL unit fragmented over 2+ packets.

See quotes below:

5.7.1. Single-Time Aggregation Packet (STAP)

A single-time aggregation packet (STAP) SHOULD be used whenever NAL units are aggregated that all share the same NALU-time.

and

5.8. Fragmentation Units (FUs)

This payload type allows fragmenting a NAL unit into several RTP packets. Doing so on the application layer instead of relying on lower-layer fragmentation (e.g., by IP) has the following advantages:

Community
  • 1
  • 1
Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • I understand, thanks! Now I've other question, but about audio frames. http://stackoverflow.com/questions/15472788/rtp-aac-packet-depacketizer – pcbb Mar 18 '13 at 08:55
  • One thing was not clear. I receive RTP packets. I'll wait the last RTP packet based on Marker Bit. The marker bit in H264 will indicate what? The last RTP packet that? Frames? A frame? More than one frame? – pcbb Mar 18 '13 at 15:15
  • It makes no sense to have a piece of a frame in a h264 rtp packet earlier. Because some packets are dropped on UDP connection. Can you be more clean? Best regards, Paulo. – pcbb Mar 18 '13 at 15:16
  • UDP packets can arrive out of order and they can get lost as well. So it's your turn to attempt to reconstruct the NAL units whenever possible, then feed them into decoder etc. – Roman R. Mar 18 '13 at 16:44