Hi all,
I am using a V120:SLIM camera in image mode, not IR.
I am in fact interested in capturing grey images at a high FPS.
In the main loop, I call "rasterize" in order to get the decompressed image and push it in an AVI file with MJPEG compression right away (which is a loss of time). I was wondering if there was a way not to perform the rasterize operation and to store the frame as is in a video file in order to speed up the process ?
Thanks !
Gaspard.
Pushing MJPEG frame to AVI file without decompression
Re: Pushing MJPEG frame to AVI file without decompression
Hi Gaspard,
The Camera SDK, does what we call 'late MJPEG decoding'. Which means the SDK won't decompress the frame's JPEG image unless you actually try to get the data. By calling Rasterize(), you're basically saying, 'ok I want the image data for this frame'. At which point the Camera SDK will decompress the JPEG and give you the image data. So the decompression is the majority of the delay (~5ms) when you call Rasterize.
You should be able to keep up with the 100 FPS and ideally pass off to the encoding in another thread or threads to keep up.
What frame rate are you able to achieve?
D
The Camera SDK, does what we call 'late MJPEG decoding'. Which means the SDK won't decompress the frame's JPEG image unless you actually try to get the data. By calling Rasterize(), you're basically saying, 'ok I want the image data for this frame'. At which point the Camera SDK will decompress the JPEG and give you the image data. So the decompression is the majority of the delay (~5ms) when you call Rasterize.
You should be able to keep up with the 100 FPS and ideally pass off to the encoding in another thread or threads to keep up.
What frame rate are you able to achieve?
D
Re: Pushing MJPEG frame to AVI file without decompression
Hey Gaspard,
I had another thought. If do a:
camera->SetLateMJPEGDecompression(false);
It will force the Camera SDK to decode all MJPEG frames. This can be bad, but in your case you want every frame. The up-side is that the decompression will occur on another thread easing the load on your main thread.
Then when you call rasterize it will be _much_ faster.
I had another thought. If do a:
camera->SetLateMJPEGDecompression(false);
It will force the Camera SDK to decode all MJPEG frames. This can be bad, but in your case you want every frame. The up-side is that the decompression will occur on another thread easing the load on your main thread.
Then when you call rasterize it will be _much_ faster.
Re: Pushing MJPEG frame to AVI file without decompression
Hi Doug,
Thanks for your answer !
What I am looking for is to avoid the overhead needed while recompressing the frame when writing in the video file. As the frame is already compressed by the camera, I would like to push it as is in a file without making any decompression. It could be a raw binary file for instance that I can later reopen, decompress and write in an avi file. The point is, I don't see any pointer to data in the "frame" object... Is it possible to have access to the compressed raw data ? A pointer with a size indication would be great !
Gaspard.
Thanks for your answer !
What I am looking for is to avoid the overhead needed while recompressing the frame when writing in the video file. As the frame is already compressed by the camera, I would like to push it as is in a file without making any decompression. It could be a raw binary file for instance that I can later reopen, decompress and write in an avi file. The point is, I don't see any pointer to data in the "frame" object... Is it possible to have access to the compressed raw data ? A pointer with a size indication would be great !
Gaspard.
Re: Pushing MJPEG frame to AVI file without decompression
Hey Gaspard,
a search for "compress" in the Camera SDK header files reveals this:
in file camerarev11.h. Although this line (same file)
suggests it's not a V120:SLIM camera.
Anyway, just wanted to let you know. I do understand what you'd like to do, but I've got no idea and no business with this
a search for "compress" in the Camera SDK header files reveals this:
Code: Select all
Frame* IncomingCompressedFrame(CompressedFrame *frame, bool DataPath=true);
Code: Select all
int HardwareFrameRate() { return 250; }
Anyway, just wanted to let you know. I do understand what you'd like to do, but I've got no idea and no business with this
Re: Pushing MJPEG frame to AVI file without decompression
Hi all,
Many thanks for your help LinusA, but it is not working for me...
Doug, I tried your solution, using the :
camera->SetLateMJPEGDecompression(false);
and you are right, the speed up in the rasterize operation is really significant, allowing me to finally recompress straight away without loosing any frame !
Thanks all,
Gaspard.
Many thanks for your help LinusA, but it is not working for me...
Doug, I tried your solution, using the :
camera->SetLateMJPEGDecompression(false);
and you are right, the speed up in the rasterize operation is really significant, allowing me to finally recompress straight away without loosing any frame !
Thanks all,
Gaspard.