Open Dylan-Ying opened 5 months ago
Hello, thank you very much for bringing to attention the existence of net.Buffers
and the fact that multiple UDP or TCP buffers can be sent with a single call. Using net.Buffers.WriteTo()
instead of net.Conn.Write()
can surely improve performance in case all RTP packets of a video frames are available in advance, and this happens with the following cases:
However this approach won't bring any benefit when RTP packets are received singularly and sent out as soon as possible, and this happens with:
Therefore: in the future we can add to gortsplib
a new method, WritePacketsRTP(pkts []*rtp.Packet)
, that allows to send out multiple packets at once.
Describe the feature
Description Each RTP packet sent invokes the io.Write function once, and a frame of video generates many RTP packets. From the pprof, it can be observed that RTP transmission consumes a significant amount of CPU resources.