简体   繁体   English

live555在发送NAL单元之前是否对其进行解析

[英]Does live555 parse NAL units before they are sent out

I am trying to add a bit of basic encryption to my live555 set up. 我试图在我的live555设置中添加一些基本加密。 Below is the basic way I send my h264 NAL units to my client. 以下是将h264 NAL单元发送给客户端的基本方法。

uint8_t* send_buffer = new uint8_t[15000];
copy(nal.p_payload + trancate, nal.p_payload + trancate + fFrameSize, send_buffer);
memmove(fTo,send_buffer,fFrameSize);
FramedSource::afterGetting(this);

Here is the code I use to send data to the client with encryption: 这是我用于通过加密将数据发送到客户端的代码:

uint8_t* send_buffer = new uint8_t[15000];
crypto_stream_chacha20_xor(send_buffer, nal.p_payload + trancate, fFrameSize,
    nonce, key);
memmove(fTo,send_buffer,fFrameSize);
FramedSource::afterGetting(this);

The second bit of code does not propagate any errors on the server end, but the client end simply does not receive anything. 代码的第二位不会在服务器端传播任何错误,但是客户端根本不会收到任何错误。 So my question is does live555 parse NAL units before they are sent out? 所以我的问题是live555是否在发送NAL单元之前解析它们? And if so how do I get it to not parse those packets? 如果是这样,我如何不解析那些数据包呢?

I figured it out! 我想到了! Live555's implementation of rtp requires that all data passed to it be formatted correctly. Live555的rtp实现要求正确传递给它的所有数据格式。 The standards for formatting h264 data can be read here: https://tools.ietf.org/html/rfc3984 . 可以在此处阅读格式化h264数据的标准: https : //tools.ietf.org/html/rfc3984

But the TLDR to that is to simply not encrypt the first byte of the NAL payload data (after the leading 0001 is taken out) and send it over in plain text. 但是TLDR只是不对NAL有效载荷数据的第一个字节进行加密(在取出前导0001之后),并以纯文本形式发送它。 This will make the system send the h264 data encrypted just fine. 这将使系统发送加密的h264数据就好了。

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

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