include <stdio.h>
include <opencv2 opencv.hpp="">
using namespace cv; using namespace std;
int main(int argc, char** argv) { VideoCapture cap("rtspsrc location=rtsp://192.168.0.?:8554/test latency=30 ! decodebin ! nvvidconv ! appsink");
if (!cap.isOpened()) { cout << "Failed to open camera." << endl; return -1; }
for(;;) { Mat frame; cap >> frame; Mat bgr; cvtColor(frame, bgr, COLOR_YUV2BGR_NV12); imshow("original", bgr); waitKey(1); }
cap.release();
} enter code here