Hello, i am absolute new in this theme. I installed opencv and vscode on my jetson nano. Now i want to test if i am able to show my ip camera stream via the opencv code. The dummy/example worked grate but now i tried to use my camera stream and no window appeared, only this few lines of code showed up in the command line :
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 279
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 279
Here my code:
#include <iostream>
#include <opencv2/opencv.hpp>
#include <iostream>
int main() {
std::string pipeline =
"rtspsrc location=rtsp://admin:projektarbeit2025\\[email protected]:554/h264Preview_01_main latency=0 ! "
"decodebin ! videoconvert ! appsink";
// VideoCapture mit GStreamer öffnen
cv::VideoCapture cap(pipeline, cv::CAP_GSTREAMER);
if (!cap.isOpened()) {
std::cerr << "Fehler: Kann den RTSP-Stream nicht öffnen." << std::endl;
return -1;
}
cv::Mat frame;
while (true) {
if (!cap.read(frame)) {
std::cerr << "Stream beendet oder Frame nicht lesbar." << std::endl;
break;
}
cv::imshow("RTSP-Stream", frame);
if (cv::waitKey(1) == 'q') break;
}
cap.release();
cv::destroyAllWindows();
return 0;
}
Hi, thanks for your help, but the “format=(string)BGRx” isnt working, the “(“ seems to be a problem. The code i posted above is working. I dont know why this is throwing an exception. I will try another time on monday :)