RTSP H265 to RTMP, first of all, to extend the RTMP protocol, currently there is a corresponding extension standard, domestic developers basically do according to this extension protocol. The protocol layer problem is resolved. The remaining key issues are to implement the RTMP H265 push module, support the RTMP H265 server, RTMP H265 playback module.

RTMP H265 server is supported. The nginx-RTMP and SRS do not support RTMP 265. We need to make some changes. For SRS, after talking to multiple SRS users, some of whom have already done a simple support, the key point is to add h265 type support.

For nginx RTMP, due to the nginx RTMP module code is less, support 265 is very convenient, is also an increase of 265 type, parsing HEVCDecoderConfigurationRecord, to the appropriate module for processing, Danniu Live SDK has extended the RTMP H.265 server, developers who need to test, can join our exchange group discussion.

RTMP h265 playback support, first of all, from the RTMP parsing out 265, need to parse out h265 nal unit and HEVCDecoderConfigurationRecord. 265-264 VPS, the need to parse. Nal type 265 needs to be processed. After the NAL units are resolved. The next key point is decoding. Currently, some Android phones already support H265 hardware solution, or soft solution can also be used.

RTMP h265 push support, if there has been a h265 nal unit, with the VPS, SPS, PPS HEVCDecoderConfigurationRecord is constructed, the wrapped RTMP packets according to the extension agreement.

Forward for RTSP h265, still need to get from the RTSP h265 nal unit, this article introduced, are interested can refer to below, blog.csdn.net/lsheevyfg/a… .

Above is the discussion of the scheme. Next, let’s look at the actual forwarding effect.

1. Download the 265 forwarding tool and RTMP H265 player. You can download the Windows version from Github (there will be other versions later).

 

2. Open the forwarding tool and configure it.

3. To view the forwarding effect, open SmartPlayer.exe and enter the address to play it.

It can be seen from the figure above that the forwarding delay of 1080p is very low, which is close to the RTSP delay of direct playback. In addition, the test tool has its own push address support H265, no need to change the server, the test is very convenient.