简体   繁体   English

gstreamer rtsp h264 depayloader中字节stream和分包stream有什么区别

[英]What is the difference between byte stream and packetized stream in gstreamer rtsp h264 depayloader

In the gstreamer rtp h264 depayloader, there is a check to see if the incoming stream is a byte stream or packetized stream.在gstreamer rtp h264 depayloader中,有一个检查看传入的stream是一个字节stream还是打包的ZF7B44CFAFD5C52223D5498196C8A2EBZ。

Can anybody tell me what is the difference between these two formats?谁能告诉我这两种格式有什么区别?

Also, for the bytestream, the codec_data does not get written to the caps.此外,对于字节流,codec_data 不会写入上限。 Any idea why this would be?知道为什么会这样吗?

H264 (NAL) Byte Stream H264 (NAL) 字节 Stream

Is used mainly to be sent directly to the decoder on a single PC, and not to be transmitted over network.主要用于直接发送到单台PC上的解码器,不通过网络传输。 It has simple format rules:它有简单的格式规则:

  • Each frame starts with same 3 byte start code 0x000001每帧以相同的 3 字节起始码0x000001开始
  • Byte stream must start with Sequence Parameter Sets frame, followed by Picture Parameter Sets frame, then other frames (I, P, B) can follow字节 stream 必须以 Sequence Parameter Sets 帧开始,然后是 Picture Parameter Sets 帧,然后可以跟随其他帧(I、P、B)
  • All frames in it are whole frames - if IDR frame is 10MB in size, it will be 10MB in size from its 0x000001 start code, to the next frame's 0x000001 start code其中的所有帧都是整帧 - 如果 IDR 帧大小为 10MB,则从其0x000001起始码到下一帧的0x000001起始码的大小为 10MB

H264 Packetized Stream H264 打包 Stream

It is used only to be transmited over TCP on a limited MTU network.它仅用于在有限的 MTU 网络上通过 TCP 传输。 Each network has MTU (Maximum Transmission Unit) that can be sent at a time through TCP.每个网络都有 MTU(最大传输单元),可以通过 TCP 一次发送。 Usually it is around 1500 bytes.通常它是 1500 字节左右。 So, if you want to send 10 MB IDR frame over TCP, you will have to break it apart so the parts fit the MTU.因此,如果您想通过 TCP 发送 10 MB IDR 帧,则必须将其拆开,以便零件适合 MTU。 H264 Stream that is adopted in this way is called Packetized Stream.这样采用的H264 Stream称为Packetized Stream。

In order to decode this stream, you must reconstruct whole frames on the receiving side, and you usually then want to make H264 NAL Byte Stream out of it, so you can send it to a decoder...为了解码这个 stream,你必须在接收端重建整个帧,然后你通常想要从中提取 H264 NAL Byte Stream,这样你就可以将它发送到解码器......

Rules of packetization can be found here: http://www.rfc-editor.org/rfc/rfc3984.txt打包规则可以在这里找到: http://www.rfc-editor.org/rfc/rfc3984.txt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM