GStreamer RTP数据包大小 [英] GStreamer RTP packet size

查看:333
本文介绍了GStreamer RTP数据包大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行以下GStreamer命令:

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

这将设置最大包大小为1024字节(最大传输单元)的RTP流.当我运行此流时,最终得到的序列是4个大小为1024的数据包,然后是1个大小为572的数据包.在文件持续时间内重复此序列.为什么会这样,并且有什么方法可以确保统一的数据包大小(至少到最后一个数据包为止)?

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)?

推荐答案

RTP数据包大小是MTU,最大ptime(如果设置)或可用数据的最小值.

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

因此,在您的情况下,如果没有更多信息,我怀疑572字节的数据包大小是因为这是该点管道中所有可用或剩余的数据.

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.

如果要确保始终有1024个字节可用,请考虑实施

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

这篇关于GStreamer RTP数据包大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆