10-09-2013 05:39 AM
Does anyone know the format of the raw data for the camera buffer? I want to port an application of mine from the PC and I would like to know some things for the camera buffer so that I can manipulate the pixels.
For instance in my application (PC version) the stream from the web camera has the frame upside down (like a bmp file) and depending on how I set the connection to the web camera the data could be either in jpg or bmp (raw) format.
Solved! Go to Solution.
10-10-2013 05:23 AM
I'm looking into this and will get back to you.
10-10-2013 11:18 AM - edited 10-10-2013 11:22 AM
We support the following two formats:
1. NV12 – this is YUV420 semi-planar (UV planes interleaved)
2. RGB (actually BGRA if you want to get technical).
You can see what the NV12 colour format looks like in the PDF slides here:
If you want to work with NV12 (the default), then you select that mode in your API calls.
If you want RGB, then you have to be aware of some limitations. RGB is usually only used by folks who are integrating with opengl or similar. NV12 (YUV) is standard for video as this is what video compressors take as input.
Example mode selection:
camera_set_videovf_property(handle, CAMERA_IMGPROP_FORMAT, CAMERA_FORMAT_NV12);
Special thanks to @sdlmcveigh for providing me with this information. Hope it gives you what you need.
10-11-2013 01:34 PM
It's worth noting that you can also get a constant stream of jpegs if you operate in burst capture mode. What you want depends on your usecase. NV12 is quite easy to work with, however.
There are a whole bunch of camera samples on Github: http://blackberry.github.io/Community/Camera.html