资源简介
最简RTSP客户端程序 详细见博客:http://blog.csdn.net/li_wen01/article/details/70260895
代码片段和文件信息
/*=============================================================================
# FileName: rtspRequest.c
# Desc: client connect to RTSP server
# Author: licaibiao
# LastChange: 2017-04-19
=============================================================================*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define MAXBUF 1024
void Handel_OPTION(char *inbuffer);
void Handel_DESCRIBE(char *inbuffer int sockfd);
void Handel_SETUP(char *inbuffer int sockfd);
void Handel_PLAY(char *inbuffer int sockfdchar *sessionId);
void Handle_PAUSE(char *inbufferint sockfd char *sessionId);
void Handel_Teardown(char *inbuffer int sockfdchar *sessionId);
int intsearch(char * buf char * searchStr int len);
int strsearch(char * buf char * searchStr int lenchar *dest);
int init_udpsocket(int port struct sockaddr_in *servaddr char *mcast_addr);
void release_udpsocket(int socket_fd char *mcast_addr);
void proc_udpsocket(int socket_fd struct sockaddr_in servaddrint flag);
char sendOPTRequstStr[] = “OPTIONS rtsp://192.168.0.6:8554/testStream RTSP/1.0\r\n“;
char userAgentStr[] = “virtual client player\r\n“;
char successfullyReplyStr[] = “RTSP/1.0 200 OK\r\n“;
char sendDESRequstStr[] = “DESCRIBE rtsp://192.168.0.6:8554/testStream RTSP/1.0\r\n“;
char sendSETUPRequstStr[] = “SETUP rtsp://192.168.0.6:8554/testStream/track1 RTSP/1.0\r\n“;
char sendPLAYRequstStr[] = “PLAY rtsp://192.168.0.6:8554/testStream/ RTSP/1.0\r\n“;
char sendTeardownRequestStr[]=“TEARDOWN rtsp://192.168.0.6:8554/testStream/ RTSP/1.0\r\n“;
char sendPauseRequestStr[]=“PAUSE rtsp://192.168.0.6:8554/testStream/ RTSP/1.0\r\n“;
char CseqHeadStr[] = “Cseq: “;
char UserHeadStr[] = “User-Agent: “;
char ApplicationHeadStr[] = “Accept: “;
char TransportHeadStr[] = “Transport: “;
char SessionHeadStr[] = “Session: “;
char RangeHeadStr[] = “Range: “;
int cseqCount=0;
int main(int argc char **argv)
{
int sockfdrtpsockfdrtcpsockfd len;
struct sockaddr_in dest;
struct sockaddr_in RTPAddr;
struct sockaddr_in RTCPAddr;
char serverIP[]=“192.168.0.6“;
char mcast_addr[] = “232.231.110.2“;
char buffer[MAXBUF + 1] = {0};
int serverPort=8554;
int udpPort=0;
cseqCount=0;
/* creat socket for rtsp */
if ((sockfd = socket(AF_INET SOCK_STREAM 0)) < 0) {
perror(“Socket“);
exit(errno);
}
printf(“socket created\n“);
/* init server add and port */
bzero(&dest sizeof(dest));
dest.sin_family = AF_INET;
dest.sin_port = htons(serverPort);
if (inet_pton(AF_INET serverIP &dest.sin_addr) < 0 ) {
perror(serverIP);
exit(errno);
}
printf(“address created\n“);
/* connect to server */
- 上一篇:最简 jrtplib 收发数据
- 下一篇:ZigBee智能路灯控制系统
相关资源
- MT6771T_LTE-A_Smartphone_Application_Processor
- onvif协议视频转码推流网页播放
- 在QT中使用RTP进行视频的采集和传输
- 流媒体相关协议标准RTP/RTSP/RTCP PDF文档
- 海思rtp封包发送
- H264实时编码RTSP直播
- 将rtsp转码为flv格式用于h5播放前端使
- rtsp-h264.zip
- websocket-rtsp-proxy-test.zip
- smartprinter3.6免注册
- MP4v2录制rtsp流存为MP4文件
- rtsp摄像头推流上云使用浏览器播放
-
ijkpla
yer 最新rtsp .ts so库 - rtsp大全
- rtsp视频组帧(tcp和udp)
- 数控五轴机床调试步骤
-
能够播放rtsp的ijkpla
yer动态库 - PowerTCP Telnet for .NET v1.0.3.rar内含注册机
- qt5.8实现rtsp流播放
- RtspRtcpRtpLoad_h264.tar.gz
- live555通过VS2013编译,自己整理的,附
- 简单的RTSP RTP RTCP推送H264码流服务器实
- 支持高版本谷歌播放rtsp的插件vxg me
- rtsp 服务器代码,VC可编译使用,RTS
- RTSP流媒体客户端播放器demo
- FLV测试文件,亲身验证,用过VLC可以
- RTSP_RFC2326(中文版).pdf
- zw_csharp_ffmpeg_rtsp_demo.zip
- DDS-RTPS 实时发布订阅协议 DDS互操作协
- h264码流rtp传输demo
评论
共有 条评论