I am trying to save the I420 data stored in a program buffer using MMAPI NvJPEGEncoder.
I follow the example in ~/tegra_multimedi_api/samples/05_jpeg_encode.
I wrote a class to be used with my detectnet and I want to save the cropped images based on the detections.
The problem with saving using this code is very much like the one described in https://devtalk.nvidia.com/default/topic/1028968/jetson-tx2/how-to-save-image-to-file-/post/5235026/#5235026
BUT, only when I try to save the cropped image (I see some green images or some images with information from some previous frame, it is random), i.e., the cropInfo in line 47 has values obtained from detections. If I try to save the entire frame, then it works perfectly!
What could be going wrong when I set cropRect to some non zero values?
Can anybody help?
EDIT: Removed the class as the link in #2 does have the exact same issue and a generic sample code.