Skip to content

RTP depacketizer: no STAP-A/AP, no CSRC/extension, no loss handling for video #10

Closed

Description

@compot-dev

NalAssembler only handles single NAL units and fragmentation units (FU-A 28 for H.264, FU 49 for H.265). Missing:

  • Aggregation packets (STAP-A 24 for H.264, AP 48 for H.265) are passed to the decoder as one malformed NAL. Some servers send SPS/PPS this way.
  • Video packets with CSRC or a header extension are dropped entirely ((data[0] & 0x0F) != 0 || (data[0] & 0x10) != 0). The audio path already accounts for both since fix(audio): AAC/G.711 playback; docs: README in EN/RU/ZH, device report form #6, via RtspClient.rtpHeaderLength().
  • No sequence number tracking. A lost FU fragment produces a corrupted NAL, which is still handed to the decoder. A continuation fragment that arrives without a start fragment is appended to an empty buffer with no start code.
  • NAL units larger than the buffer (1 MiB for single view, 512 KiB in quad) are silently truncated.

Proposal: parse the real header length, support STAP-A/AP, track RTP sequence numbers and drop the incomplete access unit on loss.

Activity

  1. added
    bugSomething isn't working
    limitationKnown limitation, listed in README
    in progressBeing worked on right now (open PR)
    on Oct 12, 2026
  2. added 3 commits that reference this issue on Oct 12, 2026
    87c31ec
    13bc771
    f32452b
  3. added 3 commits that reference this issue on Oct 15, 2026
    cf1e14b
    99a936c
    f9896be
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglimitationKnown limitation, listed in README

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions