AnsweredAssumed Answered

VideoObjectDetection save current frame & call JPEG Encoder...

Question asked by UnNaM3D on Jun 9, 2011
Latest reply on Jul 5, 2011 by rsingh
Hi,
I'm working with VideoObjectDetection project, and I want to compress the captured frames to JPEG using JPEG Encoder, and I need the pointer to the frame stream, and the lenght of the frame.
I used the default VideoObjectDetection project, and I've set is the console program to output the input frames to a file.
The function SaveOutputFrames(ADICodecHandle pObjdetHndl, int i) from VideoObjectDetection.c does this trick. The problem is that the _diff.yuv and _curr.yuv (I'm interested in the current frame -> the frame capture from the input) files created are empty (0 bytes lenght).
I know that the pGetConfig function return the address of any/all of the output frame buffers, such as difference frame, background frame, current frame when eConfigID parameter is ADI_CODEC_CONFIG_OBJDET_OUTPUT_BUFFERS as you mentioned in Video Analytics Toolbox Reference Guide 1.1.0. I've checked the return value of pGetConfig function and it is ADI_CODEC_STATUS_OK, which is OK. Now when I test the gtOutputPointer.pcDiff and gtOutputPointer.pcCurr, both are 0, which is not good.
In the InitSettings() function from VideoObjectDetection_config.c I have the following settings which are related to my problem:
ptObjDetConfig->output_diff        = 1;
ptObjDetConfig->output_bg          = 1;
ptObjDetConfig->output_curr        = 1;
ptObjDetConfig->output_compressed  = 1;
Do you have any idea what the problem is? I cannot see the pGetConfig function, because it's part of the library but I think the problem comes from there. Or I should set some other settings?
I really need to know a pointer to the current frame, and the lenght of the frame to be able to construct a padded input frame:
sFileVIGetFrame(&lImageEncParam, FrameBuffer, &InputFile);
and then call the  JPEG_EncodeImage function.
Thank you very much,
Mihai

Outcomes