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.
Java |
Next |
Previous |
Comments (7) |
Trackbacks (0)
hmeerlo | 20/11/2006, 14:12
hartti | 20/11/2006, 18:02
Are you able to play the feed I pointed out above with your midlet?hmeerlo | 07/12/2006, 15:42
hartti | 08/12/2006, 20:26
"Also the MediaPlayer does not update the midlet with a SizeChanged event, so the size of the video is unknown"zemesrieksts | 08/12/2006, 19:07
rwklink | 30/12/2006, 20:21
Re: RTSP and Java on S60
pinelife | 17/11/2006, 23:12
-Oren