This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Support directly convert SRT with WebRTC, vice versa. #2968
Labels
Milestone
You can continue the conversation there. Go to discussion →
We may need to make a very important change in our structure. Previously, SRT and GB were converted to RTMP and then to RTC, but they should have the ability to convert directly.
Since SRT, GB, and RTC are essentially RTP packets, direct conversion is more efficient. RTMP, FLV, and HLS are frame-based protocols, and they are similar, so converting to RTMP and then to HLS is not a problem.
That is, packet-based protocols should be able to convert directly, and frame-based protocols can be converted directly. When converting from packet to frame, RTMP is needed. GB and RTC can be converted directly. SRT and RTC can be converted directly. For GB/SRT to HLS, it should be GB/SRT to RTMP to HLS. This way, SRT can be directly converted to RTC, with lower latency and higher efficiency.
In practice, it has been found that low-latency live streaming may be more suitable for SRT, but the player can only choose the SRT protocol, which limits the scope of application. For end-to-end low-latency live streaming, FLV cannot be used for low-latency players, as there will be cumulative latency. The only choice is the RTC player, but currently, SRT to RTMP and then to RTC has a large latency and a long link.
SRT
Each SRT UDP packet contains multiple TS packets. There may be issues with packet loss, out-of-order packets, and retransmissions.
Since TS packets can be directly converted to H.264 annexb packets, SRT UDP packets can be directly converted to RTC RTP packets. Packet loss, out-of-order packets, and retransmissions can be directly mapped.
However, FEC could be a problem.
GB
GB can be H.264 encapsulation or PS encapsulation, with most being PS encapsulation.
If it is H.264 encapsulation, it can directly correspond to RTC RTP packets. If it is PS encapsulation, it cannot be directly converted and requires receiving a complete Frame before converting to RTP.
RTC
RTC RTP packets contain H.264 raw data, which can also be in annexb format. Both types can be parsed.
Sometimes, many small P-frames can be actively packaged into one RTP packet, as referenced:
The text was updated successfully, but these errors were encountered: