How to save the detected face in form of .jpg or .png

Hi
Thanks
the issue is resolved for me
But for future if anybody wants to save .jpg file of detected object i found solution easy by inspiring from “sources\apps\sample_apps\deepstream-image-meta-test\deepstream_image_meta_test.c”:
first:
modify the pgie_src_pad_buffer_probe as above
second modify osd_sink_pad_buffer_probe like the code in deepstream_image_meta_test.c
third:
check the headers and main function for appropriate include or initialization if needed