当前位置:网站首页>Packet mode and three streaming modes in SDP protocol
Packet mode and three streaming modes in SDP protocol
2022-07-01 10:56:00 【qianbo_ insist】
1、rtsp Medium sdp agreement
sdp The name is Session Description Protocol , Include sip This is also used in the agreement
rtsp The protocol can transmit ps flow ,ts flow , Bare flow is also called es flow ,es The flow is more conventional , be familiar with h264 Of rtp The way the packet is packaged , perhaps h265 The way the packet is packaged ,h265 Packet RTP You can refer to ffmpeg Source code
rtsp Agreement If the transmission is h264 h265
“m=” The media name in the line is “video”
“a=rtpmap” The code name in the line is H264 h265
“a=rtpmap” The clock frequency in the row is generally 90000, It can be other numbers , however 90000 This number is suitable for many frame rates , So use it .
Other parameters are included in “a=fmtp” .
2、pm The way
packetization-mode:
Indicates the supported packet mode .
1 、packetization-mode The value is 0 Or when it doesn't exist , A single... Must be used NALU Unit mode .
2、 packetization-mode The value is 1 Use non interlaced (non-interleaved) Packet mode .
3、 packetization-mode The value is 2 Use interleaving (interleaved) Packet mode .
profile-level-id:
This parameter is used to indicate H.264 The flow of profile Type and level . from Base16( Hexadecimal ) It means 3 Bytes . The first byte indicates H.264 Of Profile type , The third byte represents H.264 Of Profile Level
We usually use packetization-mode = 1, Non staggered mode
3、ps 、ts、es transmission mode
The following code is used to recover rtsp The scenario transmits three different streams
int handle_cmd(string& cmd, string& CSeq, uint32_t sessionid, char* cmdres,int ps_n_ts)
{
#define BUFSIZE 8*1024
int h26xtype = 96;
if (cmd.compare("DESCRIBE") == 0)
{
const char * psnts;
if (ps_n_ts == 1)
{
psnts = "a=rtpmap:32 MP2P/90000";
h26xtype = 32;
}
else if (ps_n_ts == 2)
{
psnts = "a=rtpmap:96 H264/90000";
h26xtype = 96;
}
else if (ps_n_ts == 3)
{
psnts = "a=rtpmap:33 MP2T/90000";
h26xtype = 33;
}
char sdp[4096];
sprintf(sdp, "v=0\r\n"
"o=shyjx 22345 22345 IN IP4 %s\r\n"
"s=H.264 Video, streamed by qb\r\n"
"t=0 0\r\n"
//"m=video 0 RTP/AVP 96\r\n"
"%s\r\n"
"c=IN IP4 0.0.0.0\r\n"
"a=rtpmap:96 H264/90000\r\n"
"a=fmtp:96 packetization-mode=1;\r\n"
"a=control:stream", m_strlocalip.c_str(), psnts, h26xtype);
return buildDescribeRes(cmdres, BUFSIZE, sdp, CSeq.c_str());
}
else if (cmd.compare("OPTIONS") == 0)
{
return buildOptionRes(cmdres, BUFSIZE, CSeq.c_str());
}
else if (cmd.compare("SETUP") == 0)
{
return buildSetupTcpRes(cmdres, BUFSIZE, 0, 1, sessionid, CSeq.c_str());
}
else if (cmd.compare("PLAY") == 0)
{
return buildPlayRes(cmdres, BUFSIZE, NULL, sessionid, CSeq.c_str());
}
else if (cmd.compare("TEARDOWN") == 0)
{
return buildTeardownRes(cmdres, BUFSIZE, sessionid, CSeq.c_str());
}
return -1;
}
边栏推荐
- “目标检测”+“视觉理解”实现对输入图像的理解及翻译(附源代码)
- Website source code whole site download website template source code download
- MIT's latest paper, "the need for interpretable features: motivation and classification": building interpretability in the constituent elements of machine learning models
- Matplotlib数据可视化基础
- 基于Matlab的开环Buck降压斩波电路Simulink仿真电路模型搭建
- [.NET6]使用ML.NET+ONNX预训练模型整活B站经典《华强买瓜》
- YoDA统一数据应用——融合计算在蚂蚁风险场景下的探索与实践
- Rising Stars in Plant Sciences (RSPS2022) Finalist科学演讲会(6.30晚9点)
- CCNP Part XII BGP (IV)
- Error: missing revert data in call exception
猜你喜欢

数字藏品新一轮热度开启

Oracle和JSON的結合

MIT最新论文《对可解释特征的需求:动机和分类》:在机器学习模型的组成元素中建立可解释性

使用强大的DBPack处理分布式事务(PHP使用教程)

CCNP Part XII BGP (IV)

Yoda unified data application -- Exploration and practice of fusion computing in ant risk scenarios
![[.net6] use ml.net+onnx pre training model to liven the classic](/img/b3/b117481fba7257453011e4cdb1eaaa.png)
[.net6] use ml.net+onnx pre training model to liven the classic "Huaqiang buys melons" in station B

建议收藏 | 在openGauss上遇到慢SQL该怎么办?

12款大家都在用的產品管理平臺

数据库实验报告(一)
随机推荐
Graduation season · advanced technology er
Sqlachemy common operations
12 plateformes de gestion de produits utilisées par tout le monde
PHP有哪些优势和劣势
爬虫(2) - Requests(1) | Requests模块的深度解析
Submission lottery - light application server essay solicitation activity (may) award announcement
数据库实验报告(二)
获取键代码
Mall applet source code open source version - two open
[matytype] insert MathType inter line and intra line formulas in CSDN blog
《百年巨匠》数字藏品中奖名单公布
基于Matlab的开环Buck降压斩波电路Simulink仿真电路模型搭建
投稿开奖丨轻量应用服务器征文活动(5月)奖励公布
JS基础--数据类型
CRC 校验
Personal mall two open Xiaoyao B2C mall system source code - Commercial Version / group shopping discount seckill source code
【邂逅Django】——(二)数据库配置
Prism journal navigation button usability exploration record
How does MySQL copy table data from one database to another (two databases are not linked to the same database)
LeetCode. One question of the day: offer II 091 Paint the house (DP problem)