views:

15

answers:

0

I am trying to capture some video frames from a BlackBerry device and operate on them as images (specifically to do barcode decoding).

I have found some sample code and a spec document which demonstrates how to use the J2ME MMAPI classes to stream video from the device's camera both to a file and to an output stream. The streaming file is in RIM's proprietary "RIMM streaming file" format.

http://docs.blackberry.com/en/developers/deliverables/17968/RIMM_streaming_video_file_1026511_11.jsp#RIM_proprietary_video_format_1001586_11

The sample code on the site shows how to parse this format to extract images - specifically the sample shown will output the "key frames" to a file on the system.

Does anyone have experience with this format? Does anyone know what format the individual frames are? I would like to get a grayscale byte array from the image for processing and am not sure where to start. I've emailed RIM for some help but thought I should check if the SO BlackBerry gurus know anything.

Some bonus info and questions:

There are flags in the metadata which indicate what kind of video encoding it is in: MPEG4 or H263, H264... is this the format of the individual frames? I'm sorry for being so woefully ignorant of imaging and video encoding technology.

The senior dev on our team seems to think this encoding would apply to the whole video file, and that the individual frames would be available in some other format, like RGB or YUV. My gut says this doesn't make sense, if the stream is compressed, all the frames will be affected.

Edited to add

I've since gotten an email from someone at RIM who explained that the key frames are the only frames which will contain a full image, the others will just have differences (which I suspected and confirmed on Wikipedia...) He said that if the encoding is specified as MPEG then the key frames will be JPEGs. I might post another question for video encoding experts, because this is becoming increasingly not Blackberry specific, but does anyone listening know if this is true?