rtp/rtcp
rtp/rtcp stack
custom rtp
ORTP
UCL Common RTP library
Bell Labs RTP Library
jrtplib
1、custom rtp send/recv
send.c
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h> #define TS_PACKET_SIZE 188
#define MTU 1500 /*rtp struct*/
struct rtp_header{
uint16_t cc:4;
uint16_t x:1;
uint16_t p:1;
uint16_t v:2;
uint16_t pt:7;
uint16_t m:1;
uint16_t sequence_number;
uint32_t timestamp;
uint32_t ssrc;
}; void init_rtp_header(struct rtp_header *h){
h->v = 2;
h->p = 0;
h->x = 0;
h->cc = 0;
h->m = 0;
h->pt = 8;
h->sequence_number =0;
h->timestamp = 0;
h->ssrc =0;
} void sequence_number_increase(struct rtp_header *header, uint32_t timestamp){
uint16_t sequence = ntohs(header->sequence_number);
sequence++;
header->sequence_number = htons(sequence);
uint32_t user_ts = ntohl(header->timestamp);
user_ts += timestamp;
header->timestamp = htonl(user_ts);
} int main(int argc,char *argv[]){
char buf[MTU];
unsigned int count = 0;
if(argc < 2){
printf(" need wav path \n");
return -1;
} init_rtp_header((struct rtp_header*)buf);
count = sizeof(struct rtp_header); int sock = socket(AF_INET, SOCK_DGRAM, 0);
struct sockaddr_in dest_addr; dest_addr.sin_family=AF_INET;
dest_addr.sin_port = htons(10001);
dest_addr.sin_addr.s_addr =inet_addr("127.0.0.1"); bzero(&(dest_addr.sin_zero),8); // Open TS file
FILE *ts_file = fopen(argv[1], "r+");
int n=0;
while(!feof(ts_file)){
int read_len = fread(buf+count, 1, TS_PACKET_SIZE, ts_file);
count += read_len;
if (count + TS_PACKET_SIZE > MTU){
printf("haha_count = %d\n",count);
sequence_number_increase((struct rtp_header*)buf, 160);
sendto(sock, buf, count, 0, (const struct sockaddr*)&dest_addr, sizeof(dest_addr));
count = sizeof(struct rtp_header);
usleep(10000);
n++;
}
}
printf("numofcount:%d\n",n*1316); fclose(ts_file);
}
recv.c
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <dirent.h>
#include <sys/file.h>
#include <errno.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <string.h>
#include <stdarg.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <signal.h>
#include <sys/wait.h>
#include <regex.h> /*rtp struct*/
struct rtp_header{
uint16_t cc:4;
uint16_t x:1;
uint16_t p:1;
uint16_t v:2;
uint16_t pt:7;
uint16_t m:1;
uint16_t sequence_number;
uint32_t timestamp;
uint32_t ssrc;
}; void main(int argc, char **argv)
{
int socka;
int nPortA = 10001;
fd_set rfd;
struct timeval timeout;
struct sockaddr_in addr;
char recv_buf[1500]; int nRecLen; struct sockaddr_in cli;
int nRet; socka = socket(AF_INET, SOCK_DGRAM, 0);
if (socka == -1)
{
printf("socket()/n");
return;
} memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET;
addr.sin_port = htons(nPortA);
addr.sin_addr.s_addr = htonl(INADDR_ANY);
if (bind(socka, (struct sockaddr*)&addr, sizeof(addr)) == -1)
{
printf("bind()/n");
return;
} //timeout = 6s
timeout.tv_sec = 6;
timeout.tv_usec = 0; memset(recv_buf, 0, sizeof(recv_buf)); FILE *fp_write = fopen("out.ps", "wb+"); while (1)
{
FD_ZERO(&rfd); FD_SET(socka, &rfd); nRet = select(socka+1, &rfd, NULL, NULL, &timeout);
if (nRet == -1)
{
printf("select()\n");
return;
}
else if (nRet == 0)
{
//printf("timeout\n");
continue;
}
else
{
if (FD_ISSET(socka, &rfd))
{
nRecLen = sizeof(cli);
int nRecEcho = recvfrom(socka, recv_buf, sizeof(recv_buf), 0, (struct sockaddr*)&cli, &nRecLen);
if (nRecEcho == -1)
{
printf("recvfrom()\n");
break;
} struct rtp_header *p = (struct rtp_header *)recv_buf;
printf("v = %d\n",p->v);
printf("p = %d\n",p->p);
printf("x = %d\n",p->x);
printf("cc = %d\n",p->cc);
printf("m = %d\n",p->m);
printf("pt = %d\n",p->pt);
printf("sequence_number = %d\n",ntohs(p->sequence_number));
printf("timestamp = %d\n",ntohl(p->timestamp));
printf("ssrc = %d\n",ntohl(p->ssrc)); if (!feof(fp_write)) {
fwrite(recv_buf, 1, nRecEcho, fp_write);
}
} }
}
}
gcc -o send send.c -lm
gcc -o recv recv.c -lm
./recv
./send fileSequence0.ts
test file
https://www.cnblogs.com/dong1/p/10451577.html
2、jrtplib
1) 安装库文件
_install.sh
cmake -DCMAKE_INSTALL_PREFIX=./_install
make
make install
2)编译example
_build.sh
export LD_LIBRARY_PATH=$(pwd)/_install/lib:$LD_LIBRARY_PATH rm ./test g++ example1.cpp -I./_install/include/jrtplib3 -L./_install/lib -g -o test -ljrtp
3)测试example
dong@ubuntu:~/sip/jrtplib/example$ ls
_build.sh example1.cpp _install test
dong@ubuntu:~/sip/jrtplib/example$ ./test
Using version 3.11.1
Enter local portbase:
4000
Enter the destination IP address
127.0.0.1
Enter the destination port
4000
Number of packets you wish to be sent:
10
Sending packet 1/10
Sending packet 2/10
Got packet !
Sending packet 3/10
Got packet !
Sending packet 4/10
Got packet !
Sending packet 5/10
Got packet !
Sending packet 6/10
Got packet !
Sending packet 7/10
Got packet !
Sending packet 8/10
Got packet !
Sending packet 9/10
Got packet !
Sending packet 10/10
Got packet !
dong@ubuntu:~/sip/jrtplib/example$
4)jrtplib的rtp大小端问题
1)README.md里有一句话
- `RTP_BIG_ENDIAN`: If set, assume big-endian byte ordering.
2)CMakeLists.txt里有一段代码
if (CMAKE_CROSSCOMPILING)
option (JRTPLIB_USE_BIGENDIAN "Target platform is big endian" ON)
if (JRTPLIB_USE_BIGENDIAN)
set(RTP_ENDIAN "#define RTP_BIG_ENDIAN")
else (JRTPLIB_USE_BIGENDIAN)
set(RTP_ENDIAN "// Little endian system")
endif (JRTPLIB_USE_BIGENDIAN)
else (CMAKE_CROSSCOMPILING)
test_big_endian(JRTPLIB_BIGENDIAN)
if (JRTPLIB_BIGENDIAN)
set(RTP_ENDIAN "#define RTP_BIG_ENDIAN")
else (JRTPLIB_BIGENDIAN)
set(RTP_ENDIAN "// Little endian system")
endif (JRTPLIB_BIGENDIAN)
endif (CMAKE_CROSSCOMPILING)
3)从以上信息可以确认默认是大端模式
注释掉jrtplib-3.11.1/src/rtpconfig.h.in的56行就是小端模式
//${RTP_ENDIAN}
4) ERR_RTP_SESSION_CANTGETLOGINNAME
因为login不能创建会话,注释掉
// if (!gotlogin)
// {
// char *logname = getenv("LOGNAME");
// if (logname == 0)
// return ERR_RTP_SESSION_CANTGETLOGINNAME;
// strncpy((char *)buffer,logname,*bufferlength);
// }
if (!gotlogin) { char *logname = getenv( "LOGNAME" ); if( == logname ) { printf( "Can't getenv LOGNAME, we will use \"root\" instead\n" ); strncpy( ( char * )buffer, "root", *bufferlength ); } else { strncpy( ( char * )buffer, logname, *bufferlength ); } }
5)实际应用
将jrtplib-3.11.1/examples/example1.cpp拆分成发送和接收
send.cpp
/*
Here's a small IPv4 example: it asks for a portbase and a destination and
starts sending packets to that destination.
*/ #include "rtpsession.h"
#include "rtpudpv4transmitter.h"
#include "rtpipv4address.h"
#include "rtpsessionparams.h"
#include "rtperrors.h"
#include "rtplibraryversion.h"
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string> using namespace jrtplib; void checkerror(int rtperr)
{
if (rtperr < 0)
{
std::cout << "ERROR: " << RTPGetErrorString(rtperr) << std::endl;
exit(-1);
}
} int main(void)
{ RTPSession sess;
uint16_t portbase = 3000;
uint16_t destport = 4000;
uint32_t destip; int status,i;
int num = 10; destip = inet_addr("127.0.0.1");
if (destip == INADDR_NONE)
{
std::cerr << "Bad IP address specified" << std::endl;
return -1;
} destip = ntohl(destip); RTPUDPv4TransmissionParams transparams;
RTPSessionParams sessparams; sessparams.SetOwnTimestampUnit(1.0/10.0);
sessparams.SetAcceptOwnPackets(true); transparams.SetPortbase(portbase); status = sess.Create(sessparams,&transparams);
checkerror(status); RTPIPv4Address addr(destip,destport);
status = sess.AddDestination(addr);
checkerror(status); for (i = 1 ; i <= num ; i++)
{
printf("\nSending packet %d/%d\n",i,num); // send the packet
status = sess.SendPacket((void *)"1234567890",10,0,false,10);
checkerror(status); RTPTime::Wait(RTPTime(1,0));
} sess.BYEDestroy(RTPTime(10,0),0,0); return 0;
}
recv.cpp
/*
Here's a small IPv4 example: it asks for a portbase and a destination and
starts sending packets to that destination.
*/ #include "rtpsession.h"
#include "rtpudpv4transmitter.h"
#include "rtpipv4address.h"
#include "rtpsessionparams.h"
#include "rtperrors.h"
#include "rtplibraryversion.h"
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string> using namespace jrtplib; void checkerror(int rtperr)
{
if (rtperr < 0)
{
std::cout << "ERROR: " << RTPGetErrorString(rtperr) << std::endl;
exit(-1);
}
} int main(void)
{
RTPSession sess;
uint16_t portbase = 4000; int status; RTPUDPv4TransmissionParams transparams;
RTPSessionParams sessparams; sessparams.SetOwnTimestampUnit(1.0/10.0);
sessparams.SetAcceptOwnPackets(true); transparams.SetPortbase(portbase); status = sess.Create(sessparams,&transparams);
checkerror(status); while(1)
{ sess.BeginDataAccess(); // check incoming packets
if (sess.GotoFirstSourceWithData())
{
do
{
RTPPacket *pack; while ((pack = sess.GetNextPacket()) != NULL)
{
// You can examine the data here
printf("Got packet !\n"); // we don't longer need the packet, so
// we'll delete it
sess.DeletePacket(pack);
}
} while (sess.GotoNextSourceWithData());
} sess.EndDataAccess(); #ifndef RTP_SUPPORT_THREAD
status = sess.Poll();
checkerror(status);
#endif // RTP_SUPPORT_THREAD } sess.BYEDestroy(RTPTime(10,0),0,0); return 0;
}
_build.sh
export LD_LIBRARY_PATH=$(pwd)/_install/lib:$LD_LIBRARY_PATH rm ./send ./recv g++ send.cpp -I./_install/include/jrtplib3 -L./_install/lib -g -o send -ljrtp
g++ recv.cpp -I./_install/include/jrtplib3 -L./_install/lib -g -o recv -ljrtp
3、ortp是个坑
1) 安装库文件
_install.sh
#https://blog.csdn.net/yanchenyu365/article/details/78724790
#再经过阅读26.0版本日志发现,只是27.0有了那么多依赖,增加的功能对Linux又没啥意义,
#26.0 及其以前版本,直接就可以安装!直接就可以安装!直接就可以安装 rm -rf /home/dong/_install
./autogen.sh
./configure --prefix=/home/dong/_install --enable-static --enable-shared
make && make install
2)Example
ortp-0.26.0/src/tests/rtpsend.c
ortp-0.26.0/src/tests/rtprecv.c
_build.sh
export LD_LIBRARY_PATH=$(pwd)/_install/lib:$LD_LIBRARY_PATH rm ./send ./recv gcc -g -o send rtpsend.c -I./_install/include -L./_install/lib -lortp
gcc -g -o recv rtprecv.c -I./_install/include -L./_install/lib -lortp
3)Debug
rtpsend.c
ortp_init();
//ortp_scheduler_init();
ortp_set_log_level_mask(ORTP_LOG_DOMAIN, ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR);
session=rtp_session_new(RTP_SESSION_SENDONLY); //rtp_session_set_scheduling_mode(session,1);
//rtp_session_set_blocking_mode(session,1);
//rtp_session_set_connected_mode(session,TRUE);
rtp_session_set_remote_addr(session,argv[2],atoi(argv[3]));
rtp_session_set_payload_type(session,8);
rtprecv.c
ortp_init();
//ortp_scheduler_init();
ortp_set_log_level_mask(ORTP_LOG_DOMAIN, ORTP_DEBUG|ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR);
signal(SIGINT,stop_handler);
session=rtp_session_new(RTP_SESSION_RECVONLY);
//rtp_session_set_scheduling_mode(session,1);
//rtp_session_set_blocking_mode(session,1);
rtp_session_set_local_addr(session,"0.0.0.0",atoi(argv[2]),-1);
//rtp_session_set_connected_mode(session,TRUE);
//rtp_session_set_symmetric_rtp(session,TRUE);
//rtp_session_enable_adaptive_jitter_compensation(session,adapt);
//rtp_session_set_jitter_compensation(session,jittcomp);
rtp_session_set_payload_type(session,8);
//rtp_session_signal_connect(session,"ssrc_changed",(RtpCallback)ssrc_cb,0);
//rtp_session_signal_connect(session,"ssrc_changed",(RtpCallback)rtp_session_reset,0);
./send file.g711a 127.0.0.1 4000
./recv test 4000
遗留bug
rtpsend能正常发送,rtprecv接收有问题,如果你解决了,记得告诉我,感谢!
dong@ubuntu:~/sip/ortp/example$ gdb recv
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from recv...done.
(gdb) set args test 4000
(gdb) r
Starting program: /home/dong/sip/ortp/example/recv test 4000
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
2019-12-05 18:20:15:555 ortp-message-RtpSession bound to [0.0.0.0] ports [4000] [38524]
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bccbf3 in concatb (mp=mp@entry=0x6043c0, newm=newm@entry=0x0)
at str_utils.c:317
317 while(newm->b_cont!=NULL) newm=newm->b_cont;
(gdb)
闲散下来再来修复...
靠,ortp官网处处都是陷阱
http://www.linphone.org/index.php/eng/code_review/ortp/
https://gitlab.linphone.org/BC/public/ortp
ortp的分支有些特性不同,下载源码需要注意
a) 数据收发demo在src/tests/目录
src/tests/rtpsend.c
src/tests/rtprecv.c
b) rtp数据流的处理以及质量反馈
rtcp feedback模块
rtcp_fb.c
rtcp扩展模块
rtcp_xf.c
4、Bell Labs
RTP Library
- The software can be licensed from Bell Labs.
- API definition
- rtplib-1.0a1source
http://www.cs.columbia.edu/irt/software/rtplib/
5、UCL Common Code Library
伦敦大学学院的通用代码库里的rtp/rtcp部分
University College London
rtpdemo.c
/*
* rtpdemo: A simple rtp application that sends and receives data.
*
* (C) 2000-2001 University College London.
*/ #include <sys/time.h> #include <ctype.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h> #include "uclconf.h"
#include "config_unix.h"
#include "config_win32.h"
#include "debug.h"
#include "memory.h"
#include "rtp.h" static void
usage()
{
printf("Usage: rtpdemo [switches] address port\n");
printf("Valid switches are:\n");
printf(" -f\t\tFilter local packets out of receive stream.\n");
printf(" -l\t\tListen and do not transmit data.\n");
exit(-1);
} /* ------------------------------------------------------------------------- */
/* RTP callback related */ static void
sdes_print(struct rtp *session, uint32_t ssrc, rtcp_sdes_type stype) {
const char *sdes_type_names[] = {
"end", "cname", "name", "email", "telephone",
"location", "tool", "note", "priv"
};
const uint8_t n = sizeof(sdes_type_names) / sizeof(sdes_type_names[0]); if (stype > n) {
/* Theoretically impossible */
printf("boo! invalud sdes field %d\n", stype);
return;
} printf("SSRC 0x%08x reported SDES type %s - ", ssrc,
sdes_type_names[stype]); if (stype == RTCP_SDES_PRIV) {
/* Requires extra-handling, not important for example */
printf("don't know how to display.\n");
} else {
printf("%s\n", rtp_get_sdes(session, ssrc, stype));
}
} static void
packet_print(struct rtp *session, rtp_packet *p)
{
printf("Received data (payload %d timestamp %06d size %d) ", p->pt, p->ts, p->data_len); if (p->ssrc == rtp_my_ssrc(session)) {
/* Unless filtering is enabled we are likely to see
out packets if sending to a multicast group. */
printf("that I just sent.\n");
} else {
printf("from SSRC 0x%08x\n", p->ssrc);
}
} static void
rtp_event_handler(struct rtp *session, rtp_event *e)
{
rtp_packet *p;
rtcp_sdes_item *r; switch(e->type) {
case RX_RTP:
p = (rtp_packet*)e->data;
packet_print(session, p);
xfree(p); /* xfree() is mandatory to release RTP packet data */
break;
case RX_SDES:
r = (rtcp_sdes_item*)e->data;
sdes_print(session, e->ssrc, r->type);
break;
case RX_BYE:
break;
case SOURCE_CREATED:
printf("New source created, SSRC = 0x%08x\n", e->ssrc);
break;
case SOURCE_DELETED:
printf("Source deleted, SSRC = 0x%08x\n", e->ssrc);
break;
case RX_SR:
case RX_RR:
case RX_RR_EMPTY:
case RX_RTCP_START:
case RX_RTCP_FINISH:
case RR_TIMEOUT:
case RX_APP:
break;
}
fflush(stdout);
} /* ------------------------------------------------------------------------- */
/* Send and receive loop. Sender use 20ms audio mulaw packets */ #define MULAW_BYTES 4 * 160
#define MULAW_PAYLOAD 0
#define MULAW_MS 4 * 20 #define MAX_ROUNDS 100 static void
rxtx_loop(struct rtp* session, int send_enable)
{
struct timeval timeout;
uint32_t rtp_ts, round;
uint8_t mulaw_buffer[MULAW_BYTES]; if (send_enable) {
printf("Sending and listening to ");
} else {
printf("Listening to ");
}
printf("%s port %d (local SSRC = 0x%08x)\n",
rtp_get_addr(session),
rtp_get_rx_port(session),
rtp_my_ssrc(session)); round = 0; for(round = 0; round < MAX_ROUNDS; round++) {
rtp_ts = round * MULAW_MS; /* Send control packets */
rtp_send_ctrl(session, rtp_ts, NULL); /* Send data packets */
if (send_enable) {
rtp_send_data(session, rtp_ts, MULAW_PAYLOAD,
0, 0, 0,
(char*)mulaw_buffer, MULAW_BYTES,
0, 0, 0);
} /* Receive control and data packets */
timeout.tv_sec = 0;
timeout.tv_usec = 0;
rtp_recv(session, &timeout, rtp_ts); /* State maintenance */
rtp_update(session); usleep(MULAW_MS * 1000);
xmemchk();
}
} /* ------------------------------------------------------------------------- */
/* Main loop: parses command line and initializes RTP session */ int
main(int argc, const char *argv[])
{
const char *address = NULL;
struct rtp *session = NULL;
uint16_t port = 0;
int32_t ac, filter_me = 0, send_enable = 1; ac = 1;
while (ac < argc && argv[ac][0] == '-') {
switch(tolower(argv[ac][1])) {
case 'f':
filter_me = 1;
break;
case 'l':
send_enable = 0;
break;
}
ac++;
} if (argc - ac != 2) {
usage();
} address = argv[ac];
port = atoi(argv[ac + 1]); session = rtp_init(address, /* Host/Group IP address */
port, /* receive port */
port, /* transmit port */
16, /* time-to-live */
64000, /* B/W estimate */
rtp_event_handler, /* RTP event callback */
NULL); /* App. specific data */ if (session) {
const char *username = "Malcovich Malcovitch";
const char *telephone = "1-800-RTP-DEMO";
const char *toolname = "RTPdemo"; uint32_t my_ssrc = rtp_my_ssrc(session); /* Set local participant info */
rtp_set_sdes(session, my_ssrc, RTCP_SDES_NAME,
username, strlen(username));
rtp_set_sdes(session, my_ssrc, RTCP_SDES_PHONE,
telephone, strlen(telephone));
rtp_set_sdes(session, my_ssrc, RTCP_SDES_TOOL,
toolname, strlen(toolname)); /* Filter out local packets if requested */
rtp_set_option(session, RTP_OPT_FILTER_MY_PACKETS, filter_me); /* Run main loop */
rxtx_loop(session, send_enable); /* Say bye-bye */
rtp_send_bye(session);
rtp_done(session);
} else {
printf("Could not initialize session for %s port %d\n",
address,
port);
} return 0;
}
https://files.cnblogs.com/files/dong1/common-1.2.14.tar.gz
rtp/rtcp的更多相关文章
- TCP、UDP、RTP(RTCP)异同与区别
OSI七层模型OSI 中的层 功能 TCP/IP协议族 应 用层 ...
- Android IOS WebRTC 音视频开发总结(八十六)-- WebRTC中RTP/RTCP协议实现分析
本文主要介绍WebRTC中的RTP/RTCP协议,作者:weizhenwei ,文章最早发表在编风网,微信ID:befoio 支持原创,转载必须注明出处,欢迎关注我的微信公众号blacker(微信ID ...
- 流媒体协议介绍(rtp/rtcp/rtsp/rtmp/mms/hls)
RTP 参考文档 RFC3550/RFC3551 Real-time Transport Protocol)是用于Internet上针对多媒体数据流的一种传输层协议.RTP协议详细 ...
- RTP RTCP在音视频传输与同步方面的使用
转自:http://blog.csdn.net/kof98765/article/details/17733701 1 音视频实时传输 1.1 Jrtplib库介绍 本系统采用开源库Jrtplib进行 ...
- RTP/RTCP/RTSP/SIP/SDP 关系(直接看总结)
RTP/RTCP/RTSP/SIP/SDP 关系 RTP(实时传输协议,传输层) Real-time Transport Protocol)是用于Internet上针对多媒体数据流的一种传输层协议 ...
- [转]流媒体协议介绍(rtp/rtcp/rtsp/rtmp/mms/hls)
[转]流媒体协议介绍(rtp/rtcp/rtsp/rtmp/mms/hls) http://blog.csdn.net/tttyd/article/details/12032357 RTP ...
- 了解实时媒体的播放(RTP/RTCP 和 RTSP)
http://blog.csdn.net/span76/article/details/12913307 RTP/RTCP RTP是基于 UDP协议的, UDP不用建立连接,效率更高:但允许丢包, 这 ...
- SIP SDP RTSP RTP RTCP webrtc
rfc1889 rfc2326 rfc3261 rfc3550 rfc3856 rfc6120. SIP SDP RTSP RTP RTCP,就像他们出现的顺序一样,他们在实际应用中的启用 ...
- RTP, RTCP, RTSP 协议介绍
流媒体是边下载边播放的方式, 是视频会议.IP电话等应用场合的技术基础. 为什么TCP/IP协议就不能满足多媒体通信的要求呢?因为TCP有以下4个特点:1.TCP重传机制2.TCP ...
- 【转】TCP、UDP、RTP(RTCP)区别
转自:https://www.cnblogs.com/imystr/p/4026639.html OSI七层模型OSI 中的层 功能 ...
随机推荐
- 理解Promise (2)
一进来 我们开始执行 executor函数 传递两个参数 再调用 then 方法 ,then 方法里面有 OnResolve方法,OnReject 方法 在then 方法中,我们一开始的状态是pen ...
- thinkphp获取目录的方法
1.获取根目录 http://localhost/ 下面两种方法效果一样 $_SERVER['REQUEST_SCHEME']."://".$_SERVER['HTTP_HOST' ...
- Ubuntu 18.04 安装 Octave 5.1
最新版目前只能通过编译安装.折腾了半天终于搞定: 需要使用apt-get install先把各种 dependencies 安装好. 编译JIT需要安装sudo apt-get install llv ...
- python中sort与sorted区别
1.sort()函数 (只对list有用) sort(...) L.sort(key = None,reverse=False) key = 函数 这个函数会从每个元素中提取一个用于比较的关键字.默认 ...
- Xcode之增加环境变量(多种环境区分)
序言: Xcode默认有DEBUG何RELEASE模式,如果我们在项目中想增加预发布环境或者再增加多个环境呢?如果在项目中用if else 弄个全局变量来控制,每次打包之前去手动修改,这样不仅繁琐,而 ...
- C# windows窗口应用程序切换主界面的显示内容
不知道说清楚没有?就是我的窗口分为两部分,左边,控制部分,由一些按钮组成右边,显示部分,由些控件(如下拉,文本等等组成) 左边的每个按钮对应显示部分的页面,也就是说,左边换一个按钮点,那么右边就显示其 ...
- win server2008关闭危险端口445,135,137,138,139的方法
在Windows server 2008系统上,有两种途经可以禁用本地端口: 1.通过Windows防火墙(比较简单,设置方便) 2.通过IP安全策略(比较复杂,功能强大,不依赖防火墙) 一.通过Wi ...
- [CSP-S模拟测试]:巨神兵(状压DP)
题目描述 欧贝利斯克的巨神兵很喜欢有向图,有一天他找到了一张$n$个点$m$条边的有向图.欧贝利斯克认为一个没有环的有向图是优美的,请问这张图有多少个子图(即选定一个边集)是优美的?答案对$1,000 ...
- [CSP-S模拟测试]:飞(fly)(数状数组+简单几何)
题目描述 $liu\_runda$决定提高一下知识水平,于是他去请教郭神.郭神随手就给了$liu\_runda$一道神题,$liu\_runda$并不会做,于是把这个题扔到联考里给高二的做.郭神有$n ...
- flask-script实现自动刷新页面调试
本文flask==1.0.2 1.导入extension包 from flask_script import Manager 2.使用manager管理工具 app = Flask(__name__) ...