Join Now

J2ME MPEG Decoder

david.caabeiro | 16 May, 2008 22:48

From time to time switching to other less used languages is a good thing (especially when doing Symbian)

I recall having seen requests to decode MPEG streams in J2ME (without relying on any media API such as the MMAPI of course):

http://discussion.forum.nokia.com/forum/showthread.php?t=101607
http://discussion.forum.nokia.com/forum/showthread.php?t=129788

Surprisingly enough I haven't seen any decoder so far. So this little hobby project aims to provide such functionality for MIDP 2.0 devices (CLDC 1.0).

The code is self explanatory (I hope) and I set up a page for it on the Wiki: http://wiki.forum.nokia.com/index.php/J2ME_MPEG_decoder

As the text states, the main aim was providing a simple example for learning purposes. There's a lot of room for improvement and optimization and it would be really nice to see some collaboration if anyone's interested.

Even though you won't get the performance available with the MMAPI, using a software decoder has some good pros:

* You are in control of the code, which is rather lightweight (The current jar file size with no obfuscation is about 36KB)

This also means not having to deal with differences and limitations in the implementation, bugs, etc, something the MMAPI has been quite good at (limited aspects, missing events, problems with full screen videos are some of the issues I recall in the past)

* More phones available, as you don't need to rely on the MMAPI

* Being in control of the stream(s), allowing to achieve things such as picture in picture, etc.

An obvious improvement would be supporting MPEG-2 streams (H.264 / MPEG4-Part 10 would be the real achievement) and adding streaming functionality (RTP)

A rather obvious problem is that audio is not supported, yet there are many possible use cases for this project (video surveillance being one of them)

Oldest device I got with MIDP2 was a Nokia 7610, where (depending on the video) up to 5 fps was achieved.

Here's a screen capture rendering "The Wall":

MPEG Decoder screen capture

 

Enjoy.-

 

Comments

You must login to post comments. Login
 
 
Powered by LifeType
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZjavaQ
     qfnZtypeQUqfnTypeZBlogContentQ
     qfnZtypeQUqfnTypeZBlogE45ntryQ
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX