Q: Now my younger brother's first attempt to H264 encoding through RTP mode transmission, the specific experimental environment is as follows:
Environment:
Server-side, H264 frame data (possibly more than 64k), divided into N 1460-byte packets, then add RTP hair to send.
The client, VLC Player, establishes the connection via the RTSP protocol and then receives the data decoding playback.
Results:
VLC can not decode the received data, decoding error, VLC information display can not decode frame data.
I have read the rfc3984 document, on the inside of how to package and use RTP transmission is not very understanding, I hope you can help my brother shrimp, tell the younger brother these and H264 frame how to send, how to sub-package, how to add header information and so on.
(where the way to see Fus seems to be suitable for sub-packet transmission, because the younger brother's data frame may exceed 64k, so forget the prawns can be explained to the younger brother in this case of RTP transmission)
A: I think all the questions have been made very clear in the RFC3984. I do not know what you do not understand, please make specific.
Q: Good, my side is to use VLC and server-side communication, they are using the RTSP protocol established at the beginning of the connection, the server returned discribers request the SDP and the same as described below, I use the packetization-mode=1, that is fu-as way packaging , because the data frame on my side might exceed 64k data. Can you trouble the owner to see if my side of the SDP is written correctly.
Sdp:
V=0
o=-1 1 in IP4 127.0.0.1
S=vstream Live
A=type:broadcast
T=0 0
C=in IP4 0.0.0.0
M=video 49170 RTP/AVP 99
a=rtpmap:99 h264/90000
A=fmtp:99 profile-level-id=42a01e; packetization-mode=1; Sprop-parameter-ets=z0iacpztbymi, amljia==
A=control:trackid=0
There is also when RTP is sent, I have a good package of data in the way shown below:
Frame data up to: Nalu header +ebsp Data
Because the frame data is larger than 1460 bytes, I divide the data into n packets of not more than 1460 bytes, each preceded by a RTP hair.
Where the Nalu head of the value I frame is 0x65, the parameter set is 0x67 and 0x68, this value is not a bit wrong, I see RFC3984 above said like I am now a little different, RFC3984 said Fu-as way Package Type value is 28, I do not know whether this decimal, What if the Nalu head should be according to RFC3984? Or use the Fu-as way of FU indicator instead of the original Nalu head.
And this fu-as way head seems to have two values, one is FU indicator, the other is the FU header, what should I fill in these two values?
According to what I now fill in, VLC will appear to solve the situation of the code, I hope the owner can help me to answer a detailed point. Thank you, sir.
A: I think RFC3984 said it very clearly.
First you split a Nalu EBSP into multiple packages, such as 3, according to the requirements:
The FU indicator of the first fu-a package should be: F = F;nri in Nalu head = Nalu in Nri;type head = 28. The FU header should be: S = 1;e = 0;r = 0;type = The Type in the Nalu header.
The FU indicator of the second fu-a package should be: F = F;nri in Nalu head = Nalu in Nri;type head = 28. The FU header should be: S = 0;e = 0;r = 0;type = The Type in the Nalu header.
The FU indicator of the third FU-A package should be: F = F;nri in Nalu head = Nalu in Nri;type head = 28. The FU header should be: S = 0;e = 1;r = 0;type = The Type in the Nalu header.
Q: Moderator, I follow your way to divide the package sent, found that VLC will not be able to solve the situation of the frame, but, still do not come out of the image. I think it may be because the method of sending sequence parameter set and image parameter set is not correct, both of them are small in length, as long as a package is available, I will now send them according to Singal Nalu, which is to add a RTP head directly to the NALU package and send it out.
is not that I have a problem with the parameter set, anyway, my side of VLC is not able to solve this parameter set, because the parameter set can not be solved, so the following frame must not be able to solve the image.
Trouble moderator again explain how to set the parameter.
A: I just received the training on streaming media today. Know how to see your SDP.
For your question, do not know whether the SPS, PPS packaging problems. According to RFC3984, and the way you play a single package is also wrong. I hope you can learn the way to make this problem clear, because RFC3984 inside said very clearly, please yourself learn to learn RFC3984 it. Since you are doing this work, you should study RFC3984 carefully.
In addition, the Sprop-parameter-ets=z0iacpztbymi in the SDP is actually the BASE64 transcoding of SPS and PPS, and you do not have to transfer the Sps/pps in the bitstream directly from the SDP.
The Sps&pps is already included in the A2:1.SDP and is completely free of transmission in the bitstream Sps&pps
2. profile-level-id=42a01e, this is the beginning of the SPS several bytes, the remainder in Sprop-parameter-ets=z0iacpztbymi, amljia==, BASE64 encoded, put "Z0iacpztbymi, amljia== "anti-BASE64 conversion back, should happen to be sps&pps content
3. Packaging note, requires that H. T stream is not a byte stream format, that is, no 0x000001 delimited, no insert 0x03, how to generate, check your encoder options.
4. Packetization-mode=1 mode, requires only one NAL unit per RTP, or a FU, non-segmented nal without any modification, directly as the RTP load; nal Note that the NAL header does not transmit, the payload starts after the NAL head, The first two bytes of the FU are generated according to the information of the NAL header (equivalent to the NAL head split into two parts), and the specific generation method moderator has made it very clear.
5. RTP payload type to be consistent with the SDP, otherwise the solution is strange
Turn: About H264 packaging by RTP transmission