0
点赞
收藏
分享

微信扫一扫

[deepstream][原创]更改deepstream_test1_app在弹出视频上显示时间


要求:在弹出视频上左上角显示ubutnu本地时间

关键代码:

std::time_t timestamp = frame_meta->ntp_timestamp / 1000000000;
        std::tm * current_time = std::localtime(×tamp);
        char strtime[100];
        std::strftime(strtime,  sizeof(strtime), "%Y-%m-%d %H:%M:%S", current_time);  
        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 = (char*)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, strtime);

举报

相关推荐

0 条评论