×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Regular Contributor
    Join Date
    Jan 2006
    Posts
    59

    Stuttering Video Playback N95

    Hi,

    When trying to play a live stream (encoded with the Darwin server) the stream starts off in Java for 2 seconds...then sometimes hangs for 10 or 12 secods, and starts playing again.

    A lot of times the stream will turn green for some time, and after a while this will restore again.

    after 4 minutes of playing the phone will either crash or the app will crash.

    This is in our own Application as well as the Sun default MMapi example (with our stream URLS's pasted in)

    Now the realplayer on the phone plays the streams perfectly. For hours on end.

    Can anyone comment on this?
    Is streaming video in Java just not done yet with the current state of technology? Or does this sound like something is screwy with the stream? Are there examples of people having successfully implemented live streaming on the N95 (In java)?

    Livestream settings: 30FPS 224 kbit mpeg4 video, en 12.2 amr narrowband sound

    Changing these settings doesn't do much

    Any help is greatly appreciated,

    Reinier
    Last edited by KlaarMobileEntertainment; 2007-11-06 at 12:37. Reason: fixed some typos

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Stuttering Video Playback N95

    Just a guess: If you have used yields in your code, try to replace the yields with short sleeps instead.

    Hartti

  3. #3
    Regular Contributor
    Join Date
    Jan 2006
    Posts
    59

    Re: Stuttering Video Playback N95

    Hi,

    Thanks for your answer!

    I did have a Yield, so I changed this in a Thread.sleep. But no matter how much time I sleep (I even set it as far as 2000) the video remains as stuttery and blocky as ever.

    Is it possible to have the same quality playback in Java as in the realplayer itself?
    Isn't Java (On the N95) secretly calling the realplayer?
    If so, how can such a big difference occur?

    this is my current refresh loop:

    Code:
    		Thread  theThread         		= Thread.currentThread ();
    
    		try {
    			while (theThread == mThread) {
    				repaint ();
    
    				serviceRepaints ();
    				Thread.sleep (1000);
    			}
    		}
    
    		catch (Exception inException) {
    		}
    In the paint nothing spectacular happens (I just draw a progressbar there). But all the paint stuff I have even commented out at one time... also with no visible change

    R

  4. #4
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Stuttering Video Playback N95

    Have you tried without any extra screen painting (you imply so in your last paragraph). Just show the video, do nothing else. Is the video still stuttering?
    (I have seen good quality videos streamed with Java on S60 devices, so it is something in the stream, real player settings - which Java uses, or the something in your code... not very helpful, I know...)

    Hartti

  5. #5
    Regular Contributor
    Join Date
    Jan 2006
    Posts
    59

    Re: Stuttering Video Playback N95

    Hi Hartii,

    If I play the stream from the RealPlayer app, the stream is perfect. So you'd think it is java interfering.

    But then again, by not painting anything at all, and setting the 'gameloop' to 2 seconds intervals. How can java still be interfering?

    Ah,... I also set the stream in the Sun videoplayer example (in the 2.5 jdk) and the stuttering was the same both in the form as the canvas based player. Which sortoff rules out bad code on my part.


    Is there a sourcecode example other than the one from Sun which can be considered the best example of how to do it properly in java?

    And do you know of any test streams anywhere on the internet? (So to rule out our stream being flawed?)

    thanks a lot for thinking along!

    R

  6. #6
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Stuttering Video Playback N95

    This link used to work well as a example source
    rtsp://ra.yle.fi/yle24/video/uusin_mobile.rm

    (news in Finnish)

    Hartti

  7. #7
    Regular Contributor
    Join Date
    Jan 2006
    Posts
    59

    Re: Stuttering Video Playback N95

    Hi Hartti,

    Can I send you the link (via a private message somehow) of the videostream we use so you might give some comment on this?

    The stream you had send me indeed works stutterless, but it is of really inferior quality of the streams we use.
    This leads me to think that the quality we use might be too high.

    Again strange since in realplayer (on the phone) it works good.

    (Maybe in Symbian apps better playback is possible than in Java?)

    R

  8. #8
    Registered User
    Join Date
    Nov 2007
    Posts
    1

    Re: Stuttering Video Playback N95

    Try to avoid "repaint" and "serviceRepaint" when the video is playing. I.e:
    Code:
    if (!videoPlaying){
        repaint ();
        serviceRepaints ();
    }

  9. #9
    Registered User
    Join Date
    Aug 2007
    Posts
    5

    Re: Stuttering Video Playback N95

    Were you able to get make any progress? It would be great if you could share the URL with us.

  10. #10
    Registered User
    Join Date
    Nov 2007
    Posts
    26

    Re: Stuttering Video Playback N95

    Hi,
    Just try this, a guess. Play the player in an independent thread.

  11. #11
    Regular Contributor
    Join Date
    Jan 2006
    Posts
    59

    Re: Stuttering Video Playback N95

    I'm not sure if I can share the link.

    The stream was in a much lower bitrate, and everything went fine. Our streams have higher bitrates (which the internal realplayer doesn't seem to have any problems with) but playing it from java causes artefacts and stutters.

    We have lowered our bitrates just a bit and the streams play now slightly better.

    Of course, the player is instantiated and controlled from a separate thread.

    Reinier

Similar Threads

  1. Streaming Video Audio site - Invite to N95 Owners
    By zoovision in forum News and Announcements
    Replies: 6
    Last Post: 2011-03-11, 08:56
  2. N95 problem with local video file playback
    By dermicha in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2007-07-23, 17:11
  3. 3650 Video playback problems
    By satchmobu in forum Mobile Java General
    Replies: 3
    Last Post: 2003-07-02, 10:17
  4. video playback from memorycard with fullscreen (nim - format)??
    By chris.dah in forum Mobile Java General
    Replies: 0
    Last Post: 2003-04-16, 10:18

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×