正如 RFC 6184 https://www.rfc-editor.org/rfc/rfc6184#section-5.6 第 5.6 节所述,单个 NAL 单元数据包只能包含一个 NAL 单元。
我的问题是接收端的解码器如何识别该单个 NAL 单元的大小或知道单个 NAL 单元数据包中 NAL 单元的结尾。
然而,在其他打包模式(例如 STAP 等)中,NAL 单元的大小作为 RTP 有效负载的一部分出现。
最佳答案
My question is how does an decoder now at the receiving end identifies the size of this Single NAL unit or knows end of NAL unit in the Single NAL unit packet.
操作系统/套接字 API 会告诉您接收到的 UDP (RTP) 数据包的大小。在 TCP 流式传输的情况下,RTP 数据包的大小通常会添加到 RTP 数据包之前(均位于 RTSP 和 RFC4571 中)。 处理完 RTP header 后,有效负载就是 single nal unit mode 中的 NAL 单元。
虽然典型的 RTP header 为 12 个字节,但您应该根据 RFC3550 解析它,因为大小取决于 CSRC 和 RTP header 扩展。
对于 STAP,您需要知道大小,因为单个 RTP 数据包中有多个 NALU。因此,您必须通过读取大小来解析每一个。
关于video-streaming - H264解码中解码器如何确定Single NAL Unit的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34129731/