GStreamer RTP packet size

时光怂恿深爱的人放手 提交于 2019-12-13 19:31:52

问题


I'm running the following GStreamer command:

gst-launch-1.0 -v filesrc location=audiofile.mp3 ! mad ! audioconvert ! rtpL16pay mtu=1024 ! udpsink port=5005 host=127.0.0.1

This sets up a RTP stream with a maximum packet size of 1024 bytes (Maximum Transmission Unit). When I run this stream, I end up getting a sequence of 4 packets of size 1024 followed by 1 packet of size 572. This sequence is repeated for the duration of the file. Why is this happening, and is there any way to ensure a uniform packet size (at least until the last packet)?


回答1:


The RTP packet size is the minimum of either the MTU, max-ptime (if set) or available data.

So in your case, without more information, I suspect the packet size of 572 bytes is because it's all the available or remaining data in the pipeline at that point.

If you want to ensure 1024 bytes are always available, look into implementing a queue to buffer data for your rtpL16pay element.



来源:https://stackoverflow.com/questions/30982735/gstreamer-rtp-packet-size

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!