Writing frames ofklt tracker in Deepstream

Hi

I have installed jetpack 4.4 with deepstream 5.0 and the 8source nano app works great.

I have made my own config for 1 stream only applied the primary detector to it and added a klt tracker, and its working great, now i need to write the unique tracker number detection frame but couldn’t find anything,
was able to write frames using dsexample plugin by adding cv.imwrite but it is writing continous frames i just need unqiue tracker frame rather than all detected frames.

[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5
#gie-kitti-output-dir=streamscl

[tiled-display]
enable=0
rows=4
columns=2
width=1280
height=720
gpu-id=0
#(0): nvbuf-mem-default - Default memory allocated, specific to particular platform
#(1): nvbuf-mem-cuda-pinned - Allocate Pinned/Host cuda memory, applicable for Tesla
#(2): nvbuf-mem-cuda-device - Allocate Device cuda memory, applicable for Tesla
#(3): nvbuf-mem-cuda-unified - Allocate Unified cuda memory, applicable for Tesla
#(4): nvbuf-mem-surface-array - Allocate Surface Array memory, applicable for Jetson
nvbuf-memory-type=0

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=3
uri=file://../../streams/sample_1080p_h264.mp4
num-sources=1
gpu-id=0
cudadec-memtype=0
#latency=200
#drop-frame-interval=5


[sink0]
enable=1
#Type - 1=FakeSink 2=EglSink 3=File 4=Encode + RTSP streaming, 5=Overlay (Jetson only)
type=5
sync=1
source-id=0
gpu-id=0
qos=0
# valid for type 3 and 4
#bitrate=4000000
nvbuf-memory-type=0
overlay-id=1

[osd]
enable=1
gpu-id=0
border-width=1
text-size=15
text-color=1;1;1;1;
text-bg-color=0.3;0.3;0.3;1
font=Serif
show-clock=0
clock-x-offset=800
clock-y-offset=820
clock-text-size=12
clock-color=1;0;0;0
nvbuf-memory-type=0

[streammux]
gpu-id=0
live-source=1
batch-size=4
batched-push-timeout=40000
width=1920
height=1080
enable-padding=0
nvbuf-memory-type=0

[primary-gie]
enable=1
gpu-id=0
batch-size=2
#Required by the app for OSD, not a plugin property
bbox-border-color0=1;0;0;1
bbox-border-color1=0;1;1;1
bbox-border-color2=0;0;1;1
bbox-border-color3=0;1;0;1
#model-engine-file=../../models/Primary_Detector_Nano/resnet10.caffemodel_b8_gpu0_fp16.engine
interval=2
#operate-on-gie-id=1
#config-file=/opt/nvidia/deepstream/deepstream-5.0/sources/apps/sample_apps/deepstream-nvdsanalytics-test/nvdsanalytics_pgie_config.txt
gie-unique-id=2
nvbuf-memory-type=0
config-file=config_infer_primary_nano.txt


[tracker]
enable=1
# For the case of NvDCF tracker, tracker-width and tracker-height must be a multiple of 32, respectively
tracker-width=960
tracker-height=540
#ll-lib-file=/opt/nvidia/deepstream/deepstream-5.0/lib/libnvds_mot_iou.so
#ll-lib-file=/opt/nvidia/deepstream/deepstream-5.0/lib/libnvds_nvdcf.so
ll-lib-file=/opt/nvidia/deepstream/deepstream-5.0/lib/libnvds_mot_klt.so
#ll-config-file required for IOU only
#ll-config-file=iou_config.txt
gpu-id=0
#enable-batch-process=1

#[tests]
#file-loop=0

Hi
Have you managed to solve it?
You may change the link order in deepstream-app for dsexample, currently dsexample link after pgie, you could change dsexample link after tracker, then
in dsexample plugin, you may add one logic to judge when object id filled with value which is for tracking id, if condition met, do the conversion and save image.