Accessing NTP timestamps within sink bin

I have a DeepStream pipeline taking in camera data and saving it at the output into an mp4 file. I want to add the NTP timestamp of the first frame from each saved video to the filename of the video, but I am having trouble getting this to work. Here’s what I am doing now:

Inside of create_encode_file_bin, I have g_signal_connect(bin->sink, "format-location-full", G_CALLBACK(callback_ringbuf_format_location), config);, where callback_ringbuf_format_location attempts to get NTP timestamp of next frame in following way:

static gchar *callback_ringbuf_format_location(GstElement *splitmux,
                                               guint fragment_id,
                                               GstSample *first_sample,
                                               NvDsSinkEncoderConfig *config) {
GstBuffer *buf = gst_sample_get_buffer(first_sample);
NvDsBatchMeta *batch_meta = gst_buffer_get_nvds_batch_meta(buf);
if (batch_meta == NULL || batch_meta->num_frames_in_batch == 0) {
    NVGSTDS_ERR_MSG_V("Ringbuffer Sink: failed to get batch metadata "
                    "associated with incoming buffer");
NvDsMetaList *l_frame = batch_meta->frame_meta_list;
NvDsFrameMeta *frame_meta = l_frame->data;
if (frame_meta == NULL) {
    NVGSTDS_ERR_MSG_V("Ringbuffer Sink: failed to get frame metadata "
                    "associated with incoming buffer");
guint64 ntp_timestamp = frame_meta->ntp_timestamp;

For some reason, batch_meta is always NULL. My impression is that the parameter first_sample contains a reference to the first GstBuffer that goes in the next file, but then it seems like I should also be able to access the batch meta for that buffer.

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.

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)

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