How to Properly Obtain the SessionID in nvurisrcbin

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
GPU
• DeepStream Version
7.0
• JetPack Version (valid for Jetson only)
• TensorRT Version
8.6
• NVIDIA GPU Driver Version (valid for GPU only)
560.31.01
• Issue Type( questions, new requirements, bugs)
question

I’m following the steps outlined in the FAQ under [DSx_All_App] for using the nvurisrcbin plugin to perform smart recording in Python. I’ve successfully managed to start the recording process, but I’m having difficulty understanding how to properly stop the recording.

The start-sr signal accepts the sessionId as a gpointer, but the stop-sr signal expects the sessionId as a guint integer. This setup is a bit confusing to me.

I understand that the sessionId should be returned by start-sr and then used later in stop-sr, but the example doesn’t demonstrate this clearly.

The FAQ states:
31.3 Send signal to start record
The “start-sr” signal has four parameters: gpointer sessionId, guint startTime, guint duration, and gpointer userData. Python can use a capsule object to pass a C gpointer. For example, alloc_buffer1 can return a capsule object:

a = pyds.alloc_buffer1(4)
ele.emit('start-sr', a, 2, 7, None)

31.4 Send signal to stop record
The “stop-sr” signal has one parameter: guint sessionId.

ele.emit('stop-sr', 0)

However, it’s not clear how to correctly obtain the sessionId from start-sr and pass it to stop-sr. Can someone clarify how this process should be handled?

I am checking.

Thanks for the sharing! currently the seesionid got from start-sr is a 0. when calling stop-sr, the second parameter is sessionid. Here you can pass 0 for simplification.

1 Like

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