Errors when try to read Jetson's rtsp stream with opencv

Hi, i’m trying to read Jetson’s stream from another pc using opencv

So here is config file
config_main.txt (1.3 KB)

On another pc:
cv2.VideoCapture("rtsp://address", cv2.CAP_FFMPEG")

After getting first frame from Jetson i got this warning on Jetson:

(deepstream-app:22031): GLib-GObject-WARNING **: 17:52:10.502: g_object_get_is_valid_property: object class 'GstUDPSrc' has no property named 'pt'

Frame that I got on another pc is NoneType and after Jetson is lagging on 30-45 seconds and tries to stream one fore frame

If I reading stream with gstreamer on another pc it hasn’t got any problems

Is the PC in the same LAN as the jetson? And please help provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
• DeepStream Version
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)
• The pipeline being used

• Jetson AGX Xavier
• Deepstream 6.0
• JetPack 4.6
• TensorRT 8.0.1
• NVIDIA GPU Driver 32.6.1

On server(Jetson) I use yolov5 for detection people in masks and if people is not in mask I recognite them with facenet and make post request to client with id of people in database
On client(PC) I getting Id of people and if people doesn’t wear first time a day client trying to get rtsp, take one image and save it into database
deepstream_app_main.c (26.5 KB)

What is the problem?

Is this the source or the output of deepstream?

It is output

So there is nothing wrong with deepstream rtsp output.

Ok, I’ll trying to send this image with post request but I can’t get cv::Mat from NvBufSurface.
I getting Surface in analytics_done_buf_prob() function. But after save it intu jpg file I get image like this:
Mat

I get it with this code:

GstMapInfo in_map_info;

    GstMapInfo inmap = GST_MAP_INFO_INIT;
    if (!gst_buffer_map (buf, &inmap, GST_MAP_READ)) {
        GST_ERROR ("input buffer mapinfo failed");
        gst_buffer_unmap (buf, &in_map_info);
    }
    NvBufSurface *surface = (NvBufSurface *) inmap.data;

    for (NvDsMetaList *l_frame = batch_meta->frame_meta_list; l_frame != NULL; l_frame = l_frame->next) {
        NvDsFrameMeta *frame_meta = (NvDsFrameMeta *)l_frame->data;

        if (surface->surfaceList[frame_meta->batch_id].mappedAddr.addr[0] == NULL){

            if (NvBufSurfaceMap(surface, frame_meta->batch_id, 0, NVBUF_MAP_READ) != 0)
            {
            std::cout << "Faild to map the surface buffer\n";
            }
        }
        NvBufSurfaceSyncForCpu (surface, 0, 0);

        guint height = surface->surfaceList[frame_meta->batch_id].height;
        guint width = surface->surfaceList[frame_meta->batch_id].width;
        Mat nv12_mat = Mat(height, width, CV_8UC1, surface->surfaceList[frame_meta->batch_id].mappedAddr.addr[0],
            surface->surfaceList[frame_meta->batch_id].pitch);

        Mat rgba_mat;
        cvtColor(nv12_mat, rgba_mat, CV_YUV2BGRA_NV12);
        imwrite("Mat.jpg", rgba_mat);
        NvBufSurfaceUnMap (surface, frame_meta->batch_id, 0);
        guint i = 0;
        for (NvDsMetaList *l_obj = frame_meta->obj_meta_list; l_obj != NULL; l_obj = l_obj->next) {
            NvDsObjectMeta *obj = (NvDsObjectMeta *) l_obj->data;
            std::string str = appCtx->predNames[i];
            std::cout<<obj->class_id<<std::endl;
            
            /*Init curl for POST-request*/
            CURL *curl;
            CURLcode res;
            std::string readBuffer;

            curl = curl_easy_init();
            std::cout<<curl<<std::endl;
            if (obj->class_id == 2){
                str = "Unmasked |" + str;
                if(curl) {
                    curl_easy_setopt(curl, CURLOPT_URL, "http://192.168.253.62:8000/");
                    curl_easy_setopt(curl, CURLOPT_POST, 1);
                    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "Id=" + appCtx->predNames[i] + "&cam=1");
                    res = curl_easy_perform(curl);
                    curl_easy_cleanup(curl);
                }
            }
    }

Can you create new topic for new issue?

Ok

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.