How to save object to jpg file in Deepstream-test5-app

please suggest to me how to work with pgie_src_pad_buffer_probe() in nvinfer plugin