Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to open ip camera #566

Closed
learncodingforweb opened this issue Apr 24, 2024 · 4 comments
Closed

unable to open ip camera #566

learncodingforweb opened this issue Apr 24, 2024 · 4 comments

Comments

@learncodingforweb
Copy link

I am using usb camera, it is working fine. using

let cam = videoio::VideoCapture::new(0, videoio::CAP_ANY)?; 

But how can i open ip camera with url rtsp://admin:admin@192.168.1.10:554?

opencv = "0.91"

rustc --version
rustc 1.77.2 (25ef9e3d8 2024-04-09)

@twistedfall
Copy link
Owner

Does it work with Python or C++ code?

@learncodingforweb
Copy link
Author

yes, it works with python as

cam = cv2.VideoCapture("rtsp://admin:admin@192.168.1.10:554")

@twistedfall
Copy link
Owner

I see, then using VideoCapture::from_file should do the trick.

@learncodingforweb
Copy link
Author

Yes, it is working fine for

let cam = videoio::VideoCapture::from_file("rtsp://admin:admin@192.168.1.10:554", videoio::CAP_ANY)?;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants