TX1在opencv中调用gstreamer解码海康IP摄像头
2017-11-02 13:33
1741 查看
opencv安装方法:
sudo apt-get update
sudo apt-get install build-essential cmake git pkg-config
sudo apt-get install libjpeg8-dev libtiff4-dev libjasper-dev libpng12-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libatlas-base-dev gfortran
//在opencv里面安装gstreamer插件
sudo apt-get install gstreamer1.0-tools gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev
//———————————–这个不要
cd ~
git clone https://github.com/Itseez/opencv.git
cd opencv
git checkout 3.0.0
———————//
cd ~/opencv
nkdir build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CUDA_GENERATION=Kepler ..
make -j4
sudo make install
编译好之后的使用方法:
cvCaptureFromFile(”rtspsrc location=\”rtsp://192.168.1.64:554/user=admin&password=admin&channel=3&stream=0.sdp?real_stream–rtp-caching=10\” latency=10 ! rtph264depay ! h264parse ! omxh264dec ! videoconvert ! appsink“);
把ip改成你们的网络摄像头的IP即可。(海康大华的摄像头略有不同,根据下面修改对应的参数即可)
附:
海康:
rtsp://[username]:[password]@[ip]:[port]/[codec]/[channel]/[subtype]/av_stream
说明:
username: 用户名。例如admin。
password: 密码。例如12345。
ip: 为设备IP。例如 192.0.0.64。
port: 端口号默认为554,若为默认可不填写。
codec:有h264、MPEG-4、mpeg4这几种。
channel: 通道号,起始为1。例如通道1,则为ch1。
subtype: 码流类型,主码流为main,辅码流为sub。
例如,请求海康摄像机通道1的主码流,Url如下
主码流:
rtsp://admin:12345@192.0.0.64:554/h264/ch1/main/av_stream
rtsp://admin:12345@192.0.0.64:554/MPEG-4/ch1/main/av_stream
子码流:
rtsp://admin:12345@192.0.0.64/mpeg4/ch1/sub/av_stream
rtsp://admin:12345@192.0.0.64/h264/ch1/sub/av_stream
大华:
rtsp://username:password@ip:port/cam/realmonitor?channel=1&subtype=0
说明:
username: 用户名。例如admin。
password: 密码。例如admin。
ip: 为设备IP。例如 10.7.8.122。
port: 端口号默认为554,若为默认可不填写。
channel: 通道号,起始为1。例如通道2,则为channel=2。
subtype: 码流类型,主码流为0(即subtype=0),辅码流为1(即subtype=1)。
例如,请求某设备的通道2的辅码流,Url如下
rtsp://admin:admin@10.12.4.84:554/cam/realmonitor?channel=2&subtype=1
解码测试:
gst-launch-1.0 rtspsrc location=\”rtsp://admin:admin666@192.168.1.64:554/h264/ch1/main/av_stream\” latency=0 ! rtph264depay ! h264parse ! omxh264dec ! nvvidconv ! xvimagesink sync=false
海康大华摄像头格式参考:http://blog.csdn.net/xiejiashu/article/details/38523437
sudo apt-get update
sudo apt-get install build-essential cmake git pkg-config
sudo apt-get install libjpeg8-dev libtiff4-dev libjasper-dev libpng12-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libatlas-base-dev gfortran
//在opencv里面安装gstreamer插件
sudo apt-get install gstreamer1.0-tools gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev
//———————————–这个不要
cd ~
git clone https://github.com/Itseez/opencv.git
cd opencv
git checkout 3.0.0
———————//
cd ~/opencv
nkdir build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CUDA_GENERATION=Kepler ..
make -j4
sudo make install
编译好之后的使用方法:
cvCaptureFromFile(”rtspsrc location=\”rtsp://192.168.1.64:554/user=admin&password=admin&channel=3&stream=0.sdp?real_stream–rtp-caching=10\” latency=10 ! rtph264depay ! h264parse ! omxh264dec ! videoconvert ! appsink“);
把ip改成你们的网络摄像头的IP即可。(海康大华的摄像头略有不同,根据下面修改对应的参数即可)
附:
海康:
rtsp://[username]:[password]@[ip]:[port]/[codec]/[channel]/[subtype]/av_stream
说明:
username: 用户名。例如admin。
password: 密码。例如12345。
ip: 为设备IP。例如 192.0.0.64。
port: 端口号默认为554,若为默认可不填写。
codec:有h264、MPEG-4、mpeg4这几种。
channel: 通道号,起始为1。例如通道1,则为ch1。
subtype: 码流类型,主码流为main,辅码流为sub。
例如,请求海康摄像机通道1的主码流,Url如下
主码流:
rtsp://admin:12345@192.0.0.64:554/h264/ch1/main/av_stream
rtsp://admin:12345@192.0.0.64:554/MPEG-4/ch1/main/av_stream
子码流:
rtsp://admin:12345@192.0.0.64/mpeg4/ch1/sub/av_stream
rtsp://admin:12345@192.0.0.64/h264/ch1/sub/av_stream
大华:
rtsp://username:password@ip:port/cam/realmonitor?channel=1&subtype=0
说明:
username: 用户名。例如admin。
password: 密码。例如admin。
ip: 为设备IP。例如 10.7.8.122。
port: 端口号默认为554,若为默认可不填写。
channel: 通道号,起始为1。例如通道2,则为channel=2。
subtype: 码流类型,主码流为0(即subtype=0),辅码流为1(即subtype=1)。
例如,请求某设备的通道2的辅码流,Url如下
rtsp://admin:admin@10.12.4.84:554/cam/realmonitor?channel=2&subtype=1
解码测试:
gst-launch-1.0 rtspsrc location=\”rtsp://admin:admin666@192.168.1.64:554/h264/ch1/main/av_stream\” latency=0 ! rtph264depay ! h264parse ! omxh264dec ! nvvidconv ! xvimagesink sync=false
海康大华摄像头格式参考:http://blog.csdn.net/xiejiashu/article/details/38523437
相关文章推荐
- 【GStreamer】TX1在opencv中调用gstreamer解码海康IP摄像头
- 基于Jetson TX1的opencv3.2版本的安装和摄像头调用例程
- 海康网络摄像机调用SDK解码Java版
- TX1平台中,OpenCV无法正常调用板载相机的可能原因
- 海康威视IP摄像头,调用的webcompenents
- Windows平台安装最新OpenCV-2.4.9,利用Eclipse、MinGW构建C++调用OpenCV开发环境
- TK1 Darknet上用RTSP网络摄像头 Gstreamer解码解决视屏马赛克解码速度不够的问题
- opencv VideoCapture调用摄像头无响应问题
- 利用python-opencv调用mjpg-stream视频流
- 基于MFC单文档下调用opencv库并将图片效果显示在单文档窗口
- C/C++调用python,opencv+python
- C#调用C++ dll 总结 内含(opencv)
- (gif 演示)成功尝试 doxygen 调用图 for hdr opencv
- 【转】[C#]二维码生成、解码(QRCode)【支持winform、web调用】
- c++ opencv 下的动态链接库的创建和调用
- Linux下利用SWIG完成Python对使用OpenCV的C++文件的调用
- Jetson TX1开发笔记(六):V4L2+OpenCV3.1以MJPG格式读取USB摄像头图像并实时显示
- Ubuntu下编译安装OpenCV 2.4.13以及Python调用OpenCV方法
- 利用ffmpeg和opencv进行视频的解码播放
- 海康威视IP摄像头基于OPENCV的二次开发