当前位置:网站首页>Why is the UDP stream set to 1316 bytes
Why is the UDP stream set to 1316 bytes
2022-06-11 17:38:00 【,,,, Nanshan light rain】
When we use udp When pushing streams, you often see pkt_size=1316, as follows :
ffmpeg -re -i westLife.mp4 -f mpegts udp://127.0.0.1:5000?pkt_size=1316
In the above order pkt_size=1316 What does that mean? , It means udp When sending audio and video streams , Every udp The size of the payload contained in the package .
Set the following in the code :
AVDictionary*dic = NULL;
av_dict_set(&dic, “pkt_size”, “1316”, 0); //Maximum UDP packet size
So why is the size 1316 Well , Ethernet MTU(Maximum Transmission Unit) Usually 1500 bytes, therefore , It is better to control the length of the sent message to 1500 bytes following , With TS over UDP Take the scene , Usually every TS The size of the bag is 188 bytes, therefore , Every UDP The package can contain up to TS The number of packages is floor((1500 – 8 -20 )/ 188) = 7, That is, the valid data is 188 * 7 = 1316bytes,8 and 20 Respectively UDP Baotou and IP The length of Baotou .
Add :
MTU(Maximum Transmission Unit) The maximum packet size transmitted on the network .
MTU In bytes byte, The mainstream network is Ethernet (Ethernet)MTU yes 1500, Ethernet related network equipment MTU yes 1500.
MTU Are actually OSI Refer to model no 2 layer ( Data link layer ), The purpose is to limit 【MAC The data part of the frame (payload) Size 】 Value , Will affect 【 The first 3 Entire of layer IP Packet size 】, This size includes IP The header of the packet ; And in the end IP Packets are to be put into MAC frame .
28 The size of bytes , yes 【IP Baotou 20 byte 】+ 【ICMP The baotou 8 byte 】.
1500 bytes (Ethernet mtu) – 20 byte (IP header) – 8 byte (ICMP header) = 1472 byte
ping -s 1472 -M do 192.168.100.79
as follows :
PING 192.168.100.79 (192.168.100.79) 1472(1500) bytes of data.
1480 bytes from 192.168.100.79: icmp_seq=1 ttl=64 time=0.196 ms
1480 bytes from 192.168.100.79: icmp_seq=2 ttl=64 time=0.208 ms
^C
--- 192.168.100.79 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1032ms
rtt min/avg/max/mdev = 0.196/0.202/0.208/0.006 ms
ping -s 1473 -M do 192.168.100.79
PING 192.168.100.79 (192.168.100.79) 1473(1501) bytes of data.
ping: local error: Message too long, mtu=1500
ping: local error: Message too long, mtu=1500
ping: local error: Message too long, mtu=1500
ping: local error: Message too long, mtu=1500
ping: local error: Message too long, mtu=1500
^C
--- 192.168.100.79 ping statistics ---
5 packets transmitted, 0 received, +5 errors, 100% packet loss, time 4099ms

边栏推荐
- Custom or subscription? What is the future development trend of China's SaaS industry?
- Use of forcescan in SQL server and precautions
- CentOS7服务器配置(四)---安装redis
- Authing biweekly news: online application market (5.10-5.22)
- 送给大模型的「高考」卷:442人联名论文给大模型提出204个任务,谷歌领衔
- Merge two ordered linked lists ---2022/02/24
- Mathematical basis of information security Chapter 1 - Division
- Tidb unsafe recover (tikv downtime is greater than or equal to half the number of replicas)
- Vscode configures eslint to automatically format with an error "the setting is deprecated. use editor.codeactionsonsave instead with a source“
- 04_特征工程—特征选择
猜你喜欢

Bentley 使用 Authing 快速实现应用系统与身份的集成

MFSR:一种新的推荐系统多级模糊相似度量

Sohu tout le personnel a été escroqué, quels problèmes ont été exposés?
![[foundation of deep learning] learning of neural network (3)](/img/a5/1b80ba85faf8fa636b784c76d4df2f.png)
[foundation of deep learning] learning of neural network (3)

【深度学习基础】神经网络的学习(3)

How to become an optimist organization?

你还不懂线程池的设计及原理吗?掰开揉碎了教你设计线程池

使用exe4j 将.jar文件打包为.exe文件

Hands on deep learning - multiple input and output channels in the convolution layer

sql server中关于FORCESCAN的使用以及注意项
随机推荐
Leetcode力扣刷题
R language to find missing value location of data set
Windows technology - how to view the instruction set, model, attribute and other details supported by the CPU, and how to use the CPU-Z tool to view the processor, memory, graphics card, motherboard,
Read and understand the development plan for software and information technology service industry during the "14th five year plan"
合并K个升序链表---2022/02/26
Merge K ascending linked lists ---2022/02/26
Bentley 使用 Authing 快速实现应用系统与身份的集成
6-2 多个整数的逆序输出-递归
How to simplify a lot of if... Elif... Else code?
为什么udp流设置1316字节
Port planning and APJ
How to become an optimist organization?
tidb-cdc同步mysql没有的特性到mysql时的处理
[foundation of deep learning] learning of neural network (3)
Dynamic: capturing network dynamics using dynamic graph representation learning
Authing biweekly news: authing forum launched (4.25-5.8)
Qlineedit set input mask
Service学习笔记02-实战 startService 与bindService
What problems are exposed when all Sohu employees are cheated?
spawn ./gradlew EACCES at Process.ChildProcess._handle.onexit