You Are Here:

Community: Blogs

Hartti Suomela's Forum Nokia Blog

RTSP and Java on S60

hartti | 16 November, 2006 02:19

Streaming over Real Time Streaming Protocol (RTSP) on Java ME platform is supported on Nokia S60 devices starting from S60 2nd Edition Feature Pack 3 devices. Because of a couple of recent requests coming from different directions I have spent some time troubleshooting and testing streaming MIDlets. Hence I thought a summary would be in order (you can find bits and pieces about this topic through various DiBo-postings though...)

 

If you, like me, do not happen to have any streaming server at hand, the first challenge is to find a stream to test with. I spent a while looking for a suitable one. Here is one URL, which I know is working and should be available also in the future: rtsp://ra.yle.fi/yle24/video/uusin_mobile.rm (the URL is a daily TV news stream from Finland - if the language is garbled, its not the stream but language:-)

Feel free to use whatever compatible URL you have. The stream can be a clip (with a specified length) or a "live" stream. Both work well.

 

The next step is to find a working source to test with. Here is one source, which is not pretty, but gets the work done (this sample contains the same URL as above). Compile it and try it out

 After the initial wait, you should see the video to appear (there are a number of exceptions displayed at certain points - those are there for your enjoyment... err... debugging reasons).

 

Not working? Check what access point you have defined in the Real Player of the device. Java streaming uses that one, and if it is not defined or it is incorrectly defined, the streaming does not work.

 

Still not working? Getting a prefetch error? Might be that there is not enough bandwidth. I got that error when I tried streaming over non-3G cellular data connection.

 

Using your own code, and not getting it working (seeing only the first few frames, possibly hearing some audio, but the video is not moving). Do you use yields in your code? It might be that the stream thread never gets enough processing time to get things done. Try to use either sleeps (or "nothing") instead.

 

RSSComments

Re: RTSP and Java on S60

pinelife | 17/11/2006, 23:12

Good stuff! I posted a reference to this article in the S60 Multimedia Blog:http://blogs.s60.com/s60multimedia/2006/11/rtsp_and_java_hints.html
-Oren

Re: RTSP and Java on S60

hmeerlo | 20/11/2006, 14:12

Hi Hartti,

thanx for your post. I can not get it to work on the S60 3rd edition. I keep getting prefetch errors (-4 and -45) and have no clue what I am doing wrong. It certainly isn't a bandwidth problem because a Rtsp reference midlet does play the URL correctly. Do you have any idea?

Regards,
Herman Meerlo

Re: RTSP and Java on S60

hartti | 20/11/2006, 18:02

hartti Are you able to play the feed I pointed out above with your midlet?

Without seeing any code it is hard to say anything specific. (unfortunately I do not have time to troubleshoot your code much, as I have hands ful of other issues.) Try starting from a simple midlet and add features until the streaming fails.

Hartti

Re: RTSP and Java on S60

hmeerlo | 07/12/2006, 15:42

The problem is that it is extremely instable, as is most J2ME work on series 60 compared to other devices (SonyEricsson, Samsung etc). You get numerous Symbian OS Errors, ranging from -4 (out of memory, on a phone with plenty of heap, probably caused by the terrible memory fragmentation of the S60) to -12000 (bandwidth problem). All errors in between pop up at random times as well (-39, -36, -7334 etc). Also the MediaPlayer does not update the midlet with a SizeChanged event, so the size of the video is unknown. So all in all, it is not very stable, but it can work.... sometimes.

Re: RTSP and Java on S60

hartti | 08/12/2006, 20:26

hartti "Also the MediaPlayer does not update the midlet with a SizeChanged event, so the size of the video is unknown"

What do you exactly mean? I have been getting the SizeChanged events in my tests right off the bat.

Hatti

Re: RTSP and Java on S60

zemesrieksts | 08/12/2006, 19:07

Fully agree that J2ME on S60 bears numerous sings of poor implementation and lousy performance for MMAPI. I've tinkered with rtsp on java and in comparison with SE on my N80 my app performed very badly. Is there any issues why MMAPI is so poorly implemented on s60? Hwr, updated firmwares are steady comming - so, hope is with them!

Re: RTSP and Java on S60

rwklink | 30/12/2006, 20:21

In the forum you mention that the code is an edited version of someone elses work but that you have lost the original file.

It seems to me that the original file is downloadable at http://developer.sonyericsson.com/site/global/techsupport/tipstrickscode/java/p_streaming_v800.jsp

While I don't believe that Sony Ericsson has a problem with posting their employees work at other sites, I do believe it's a bad practice to remove the copyright notices of Jöns Weimarcks and Sony Ericsson from the file.

Just my $0.02
You must login to post comments. Login
 

Rate This

 
 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia