citytech摄像头 opencv+rtsp获得图像
2016-05-03 14:41
260 查看
#include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <iostream> int main(int argc, char **argv) { using namespace std; IplImage *pFrame = NULL, *srcImage = NULL; CvCapture *pCapture = NULL; pCapture = cvCreateFileCapture("rtsp://192.168.1.10:554/user=admin&password=admin&channel=1&stream=1.sdp?real_stream"); if (!pCapture) { printf("Can not get the video stream from the camera!\n"); return NULL; } while (1) { if (srcImage == NULL) { pFrame = cvQueryFrame(pCapture); srcImage = cvCloneImage(pFrame); cvCircle(srcImage,cvPoint(pFrame->width/2, pFrame->height/2),5, CV_RGB(255, 0, 0),1,8,0); // 在视频中心处画圆 cvShowImage("123234", srcImage); cout<<pFrame->width<<","<<pFrame->height<<endl; cvWaitKey(10); cvReleaseImage(&srcImage); srcImage = NULL; } } cvReleaseCapture(&pCapture); cvReleaseImage(&pFrame); return 0; }
citytech摄像头的rtsp地址格式
rtsp://$(IP):$(PORT)/user=$(USER)&password=$(PWD)&channel=$(Channel)&stream=$(Stream).sdp?real_stream
例如账号admin 密码admin stream是主视频流(主0 辅1)
类似rtsp://10.6.10.25:554/user=admin&password=admin&channel=1&stream=0.sdp?real_stream 如果是通过公网需要将RTSP端口开放(
默认是554),这个端口在网络服务->RTSP中可以设置。
相关文章推荐
- 免安装版本tomcat的变量配置
- Adobe Photoshop CC2015 下载-安装-注册机破解
- Hadoop新手学习指导之hadoop核心知识学习
- 深入理解Linux内核day06--进程调度
- linux下c编程之UDP
- nginx 配置文件详解
- Linux suid功能
- linux下的切割文件命令split
- linux搭建java web环境
- 推荐一查看源码的网站
- LoadRunner监控windows资源分析
- PHP环境安装-phpstudy for linux版
- Linux下 ntp 时间同步服务ntpd 出现 the NTP socket is in use, exiting 解决
- Linux远程秘钥登录方式
- 2、Nginx配置文件nginx.conf的配置详解
- Linux之-atime、ctime、mtime
- Linux上下文切换监控
- centos7.1 安装 svnmanager1.10
- centos下安装python mysqldb
- centos查看磁盘扇区大小等信息