Number of display unit macro definitions of deepstream

When I try to modify the number of display units of deepstream, the line drawing and display text will not take effect, and a memory error will occur when it exceeds 32. The source code macro is defined as follows


#define MAX_ ELEMENTS_ IN_ DISPLAY_ Meta 32 / / program error

#define MAX_ ELEMENTS_ IN_ DISPLAY_ Meta 20 / / text and line drawing cannot be displayed

Please 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)

Can you try to add more display_meta into frame_meta if you need add display meta more than 16?

    display_meta = nvds_acquire_display_meta_from_pool(batch_meta);
    NvOSD_TextParams *txt_params  = &display_meta->text_params[0];
    display_meta->num_labels = 1;
    txt_params->display_text = g_malloc0 (MAX_DISPLAY_LEN);
    offset = snprintf(txt_params->display_text, MAX_DISPLAY_LEN, "Person = %d ", person_count);
    offset = snprintf(txt_params->display_text + offset , MAX_DISPLAY_LEN, "Vehicle = %d ", vehicle_count);

    /* Now set the offsets where the string should appear */
    txt_params->x_offset = 10;
    txt_params->y_offset = 12;

    /* Font , font-color and font-size */
    txt_params->font_params.font_name = "Serif";
    txt_params->font_params.font_size = 10;
    txt_params-> = 1.0;
    txt_params-> = 1.0;
    txt_params-> = 1.0;
    txt_params->font_params.font_color.alpha = 1.0;

    /* Text background color */
    txt_params->set_bg_clr = 1;
    txt_params-> = 0.0;
    txt_params-> = 0.0;
    txt_params-> = 0.0;
    txt_params->text_bg_clr.alpha = 1.0;

    nvds_add_display_meta_to_frame(frame_meta, display_meta);

Thank you for your reply. I’ll try it. If I have any questions, I’ll ask you again

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