If you have a look at the deepstream-test5 sample application you’ll see how smart record is used.
In your own app you can have a probe somewhere after your nvinfer element. I typically add the probe to the tracker src pad.
In this probe you have access to all the metadata and can check if detections have been made and for what classes etc. in here you can call NvDsSRStart().
@jasonpgf2a hi, i have a same question on this. I’m trying to trigger a smart record on bbox_generated_probe_after_analytics probe, have you ever try on this? Would you mind to provide some way to access the bin within the probe?
@Mike I have been able to trigger the smart record within the bbox_generated_probe_after_analytics probe. However, It seems like need to find out a way to trigger the start and hold the until record duration is end before trigger the NvDsSRStop.
Maybe we can find a way together…
within the deepstream_source_bin.c it use the g_timeout_add to trigger the smart record_event_generator from every period of record duration from the settings. Need to find out how the g_timeout_add can be use based on detection of particular object.
I think one easiest way is to store the event source id to the appCTX which return by g_timeout_add , and stop the record after the particular object is not detected and frame out.
Hi,@cheesiangleow5284,have you solve this problem? I want to know if you just put the smart record here it worked or should i do some encode work? I am a beginner so i really confused about the smart record example.
thanks for you reply @cheesiangleow5284.
I just use your sample and change like below and want it record object 0,but it doesn’t work,what can i change?
Update: Solved it. turns out g_timeout_add (10000, smartRecord, src_bin) isn’t working, it’s calling smartRecord function everytime, which inadvertently stops the recording as ctx->recordOn fluctatues b/w 0 and 1 and no video is thus saved. For now, I’ve commented out NvDsSRStop(ctx, 0).