Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
myamada
Posts: 46
Registered: ‎05-21-2010
My Device: ...

Format of frames from the RIMM streaming video file format

Does anyone know what the image format for indivual frames in the RIMM streaming file format is? I was able to use the sample code that is posted here:

 

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

 

to open up a the video recording API and start streaming video ... the parser seems to be working and saves key frames to the filesystem but I have no idea how to interpret these frames.

 

I know there is a descriptor which will signal MPEG4 or H264, but does this apply to the individual frames? I am woefully ignorant about video compression and imaging tech... A senior dev here suggested that the  frames might be in some format like YUV or RGB, but my gut says that if the streaming video is encoded or compressed, then the entire thing will be affected... isn't that right?

 

Thanks a lot for any help.

 

I'm sorry for cross posting this from Stack Overflow, but it's inevitable... here's my original question there:

 

http://stackoverflow.com/questions/3937687/what-is-the-format-for-individual-frames-in-the-rimm-stre...

Please use plain text.
Administrator
MSohm
Posts: 14,517
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Format of frames from the RIMM streaming video file format

The RIM format is documented here:

 

RIM proprietary video format (RIMM streaming file)

http://docs.blackberry.com/en/developers/deliverables/11942/RIM_proprietary_video_format_1001586_11....

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Contributor
myamada
Posts: 46
Registered: ‎05-21-2010
My Device: ...

Re: Format of frames from the RIMM streaming video file format

[ Edited ]

Thanks MSohm, but I know. Actually I posted a link to the same set of docs in my original post which you might have missed. I believe that the RIMM format is a container which is holding the frames in some other encoding, like MPEG or H264. My question was about this format.

 

I've since gotten an email from a developer contact at RIM who said that if the video encoding is MPEG then the key frames will be JPEGs.

 

Does anyone with more experience with video compression and encoding know if this is true? When I tried to do EncodedImage.createImage() with the byte array supposedly containing a key frame, it threw an IllegalArg exception.

 

 

Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.634 Dev OS, Z30 (STA100-5)-10.3.1.634 Dev OS, Passport (SQW100-1)-10.3.0.1154, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Format of frames from the RIMM streaming video file format

Get the frame data and read through it, if it doesn't have tags that match JPEG then it's not JPEG. If you simply passed it into EncodedImage.createImage and it threw an exception then it rules out BMP, WBMP, JPG, PNG, TIFF, and GIF.

 

Since we got those out of the way look for a "magic" that might identify it, patterns in the beginning of the file (end would be data). Go to a normal MPEG video and get the frame out of that (there are tools to do that) and see if some data elements are the same.

 

You play around with it enough you can find out the format of it.

 

On a side note can you try and save part of the RIMM data (header and a frame or too), it might make it easier for someone to try to figure it out without needing to write a app of their own to extract data.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.
Contributor
myamada
Posts: 46
Registered: ‎05-21-2010
My Device: ...

Re: Format of frames from the RIMM streaming video file format

[ Edited ]

Thanks, good suggestions, I'll try some of them.

 

As for saving part of the RIMM header, if someone else wants to take a look at it feel free - the code is available from

 

http://docs.blackberry.com/en/developers/deliverables/11942/CS_Parsing_a_RIM_proprietary_video_file_...

Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.634 Dev OS, Z30 (STA100-5)-10.3.1.634 Dev OS, Passport (SQW100-1)-10.3.0.1154, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Format of frames from the RIMM streaming video file format

How did I miss that? I might try it out later. The other reason for asking you for the code was because it is in whatever format you recorded it in where as I might end up with something else (though there are not many options it can still happen).

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.
Contributor
myamada
Posts: 46
Registered: ‎05-21-2010
My Device: ...

Re: Format of frames from the RIMM streaming video file format

I spent the afternoon doing some research and trying it out on a device...

 

When I write out individual key frames as parsed from the KeyFrameOutputStream class they always begin with 0x000001b6. This doesn't seem to be a JPEG start code, but instead an MPEG reserved start code ... I do not know enough about video encoding to understand how to use this information though. Just thought I would add what I've found.

 

http://books.google.com/books?id=f6Cuz9Tig-MC&lpg=PA138&ots=67HMjjWoa6&dq=1b6%20mpeg&pg=PA138#v=onep...

Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.634 Dev OS, Z30 (STA100-5)-10.3.1.634 Dev OS, Passport (SQW100-1)-10.3.0.1154, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Format of frames from the RIMM streaming video file format

Not bad, I would say try to copy the data over to the desktop and find a utility to convert to a image. If it doesn't work then you will have a fun time trying to figure Otherwise you know it follows the standard and can find some source code to parse it.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.
New Developer
skjolber
Posts: 6
Registered: ‎11-03-2009
My Device: Not Specified

Re: Format of frames from the RIMM streaming video file format

Hey guys, were you able to decode the video frames into pixels?

 

I can read the frames all fine, but FFMPEG just gives me green pixels for both H264 and MPEG-4 video.

 

I DO however have a codec that works in windows, the mc_demux_mp2_ds.ax from blackberry, so I think Blackberry should stand up and document their format with a working example.

Please use plain text.