OpenCV IP Camera RTSP stream

北城余情 提交于 2019-12-18 09:24:18

问题


I'm trying to access a RTSP video stream from an IP camera using OpenCV and Java. I can access the stream using VLC player with the following format: rtsp://192.168.1.10:554/rtsp_live0 but when I try to use OpenCV the video stream seems to always be closed.

The code I'm using... (simplified)

VideoCapture capture = new VideoCapture();
capture.open("rtsp://192.168.1.10:554/rtsp_live0");
while(!capture.isOpened())
    System.out.print("Not opened :( \r");

I have a Mustcam H806P and found the stream URI from this website: http://www.ispyconnect.com/man.aspx?n=ipcamera

What am I doing wrong?


回答1:


I'm reporting Alexander Smorkalov answer on answers.opencv.org

OpenCV uses ffmpeg library for video I/O. Try to get video stream with console ffmpeg tool. The address must be the same.

See also here OpenCV - how to capture rtsp video stream



来源:https://stackoverflow.com/questions/31222261/opencv-ip-camera-rtsp-stream

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!