Error "Null SR context handle." in smart recording

• Hardware Platform (Jetson Nano / GPU)
• DeepStream Version 5.1
• JetPack Version (valid for Jetson only)
• TensorRT Version 7.1

Hi. I setup all configs(consumer options + source options) for smart record.

# Configure this group to enable cloud message consumer.
[message-consumer0]
enable=1
proto-lib=/opt/nvidia/deepstream/deepstream-5.1/lib/libnvds_kafka_proto.so
conn-str=192.168.1.100;9092
config-file=./configs/cfg_kafka.txt
subscribe-topic-list=capcommand
# Use this option if message has sensor name as id instead of index (0,1,2 etc.).
sensor-list-file=configs/dstest5_msgconv_sample_config.txt
[source0]
enable=1
type=4
uri=rtsp://admin:bb123456@192.168.1.65/Streaming/Channels/102/
num-sources=1
smart-record=1
smart-rec-default-duration=20
smart-rec-duration=20
smart-rec-video-cache=20
smart-rec-container=0
smart-rec-start-time=5
smart-rec-file-prefix=source1
gpu-id=0
cudadec-memtype=0

But when the consumer receives message from broker to “start-recording” it will print this Error:
Null SR context handle.

what is wrong ? thanks in advanced!

Sorry for the late response, we will investigate to do the update soon. Thanks

I try to repro your issue using test5 app, but can not.
It would be better you provide details how to repro your issue.

At first thanks for your try.
I solved the problem with using the source number [source-id] instead of sensor id by commenting sensor-list-file=... in the [message-consumer0] section.

in the deepstream_c2d_msg.c inside subscribe_cb function there is an if statement that checks hashmap is available or not:

        if (ctx->hashMap) {
          gpointer keyVal = g_hash_table_lookup (ctx->hashMap, msgSR->sensorStr);
          if (keyVal) {
            sensorId = *(int *) keyVal;
          } else {
            NVGSTDS_WARN_MSG_V ("%s: Sensor id not found", msgSR->sensorStr);
            goto error;
          }
        } else {
          sensorId = atoi (msgSR->sensorStr);
        }

I printed the sensorId after this. When it uses the hashmap for retrieve sensorId the result is wrong and it assigns 127 !! while by commenting the sensor-list-file in configs and achieve id with sensorId = atoi (msgSR->sensorStr); instead of hashmap, it works correctly !

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