Help: Solving Flash Video Playback on Sun Ray 1?

Hi All,

I am trying to solve the problem of Flash video playback on the SunRay1[1], and so far I have had maybe 60% success, but it’s still not good enough.

My biggest problem is that if you Google for “flash video stuttering” or similar then you will get thousands of hits about using faster computers, using a faster network, changing your codecs, etc – but none of that is applicable to a thin client, or my situation.

So here’s the problem:

* YouTube videos play very acceptably on a SunRay1

* Even if I replicate the codecs, bitrate, and everything else I can find out about YouTube’s media, FFmpeg-encoded flash videos played on a SunRay1, using JWplayer, stutter badly and are unwatchable.

For those who speak FFmpeg, here’s how I am generating the FLV videos:

ffmpeg -i video.avi -vcodec flv -b 240k -s 320×240 -g 300 -ab 64k -ac 1 -ar 22050 -y video-low1.flv

…using code (FFmpeg version SVN-r15488) and libraries that I pulled and freshly built this week.

I am also using the latest JWplayer for Flash.

I encoded the above by copying everything that I can learn about YouTube formats:

* the audio is downsampled to 22kHz and mixed into mono LAME MP3 at 64kbits

* the video is Flash 7 format (Sorenson) and set to 240kbits, scaled during encoding to 320×240 and then played back at whatever 4:3 ratio size it is meant to be, in this case 480×360.

* the native frame rate is 25fps, and the FLV file inherits that; since YouTube videos play at 29fps, I am pretty sure that’s not the problem

* also I experimented with encoding with framerates as low as 8fps and found it didn’t help.

The SunRay server is a mostly-idle twin-core Opteron running at 2.4GHz, and as I say it does a fine job of playing back real YouTube videos, with audio, on the SunRay1 thin client. The webserver is on the local network, so there is no delay waiting for data – the 50Mb file is downloaded in seconds.

When playing the FLV file using JWplayer in Firefox, the video stutters, you can watch it refreshing the playback area, and the audio stops and starts, and the video stops and starts in sync; it was worse before I added “-g 300” to increase the keyframe interval, but raising it any higher yields no benefits.

I have the following suspicions:

* Maybe the audio settings also need poking to have increased packet sizes, or something; I do get the impression that JWplayer is working hard to keep audio and video in sync, rather than just streaming the media in a laissez-faire way?

* Maybe the YouTube player has some special magic in it? Certainly it seems to look less pixelated than the JWplayer videos – a sort of “impressionistic” approach to colour?

* Maybe there are some non-obvious FFmpeg settings I need, like how to handle dropped frames on the server, and stuff like that?

In short, I am stuck, and I am pretty sure there aren’t many people who work in this space.

I am kinda hoping that it reaches one of them. Can anyone help?

[1] A SunRay is a networked thin-client device from Sun Microsystems; http://en.wikipedia.org/wiki/Sun_Ray for details; if you aren’t familiar with thin clients then you can probably think of them as “hardware devices that do VNC of another machine”, but they are actually a lot better than that.

[2] I am using a SunRay1 which is the oldest and slowest of the machines; apparently there will be some improvements to its firmware soon to enhance video playback, but I want to get this working *now* …

Comments

8 responses to “Help: Solving Flash Video Playback on Sun Ray 1?”

  1. Hi Alec,
    Any chance I can get a sample video? BTW, the enhancements coming in the October release won’t help flash video. What will help using the next release, even with a Sun Ray 1, would be using a player that supports XOrg’s xVideo extensions such as mplayer. Are you married to that format and player combo?

  2. Hi Craig,

    I’m just putting together a sample video for you, in fact a bunch of them for comparison’s sake.

    It’s all rather ironic, really; I spent ages from 2002-2006 trying to get video to play well on SunRay by converting to RealPlayer, but frankly that’s a dead format nowadays – the software I used for conversion is no longer supported, and looks awful.

    I’ve spent ages trying to get VLC and/or other media players compiled on Solaris, but to no avail; it is rumoured that other people have managed it, but the codecs are not well distributed because of legal issues.

    Now the world – in another example of life-mirrors-porn-distribution – has gone for flash video in a big way, and so the tools for flash playback are becoming ubiquitous; so if Solaris and SunRay are now shooting for the 2005-era of WMV acceleration then there’s gonna be a functionality gap.

    So, no, I’m not wedded to Flash playback; the whole world is. The world wants videos to play in “vanilla” Firefox. Game over.

    I have no idea why it is that YouTube plays OK on SunRay, but my videos don’t; if we can work together to understand that, then I will happily advertise the technique because damn I really need this functionality.

  3. ps: yes, i totally support the new firmware to support video codecs, and some folk i know are drooling for them, especially the virtual desktop crowd… but the world wants flash for the next few years.

  4. What I find odd is that youtube video playback on my SunRay 2 at home when using Sun Ray @ home, ie over VPN is still o.k. Not great but o.k. but Alec’s video is not o.k to the point of not even starting to really play.

  5. this is what i am using as my reference youtube video:

  6. Why Flash??

    Every time I try and move video’s and such to flash players I hit problem after problem and end up going back to Real. I know Real isn’t popular now in the same way that Flash it but it does seem to work! :-/

    There isn’t much different between the companies too with both being just as Proprietary/Open as each other.

    I still haven’t managed to find an open source video player (using open source tech) that I can embed into a webpage to read and understand a SMIL file and stream a section of a video file over RTSP. This is what I am doing for a the video finish of a charity marathon I run. I can do it in Real/Helix but have failed in Flash and neither of them are open anyway.

    Sorry, this post doesn’t really help you, just venting too 🙂

  7. Folk inside Sun can find test video content at

    http://gmpweb.uk/~alecm/test/

    I chatted with Darren Moffat about this earlier today, and the problem seems to be in the Flash Player and how it tries to sync audio and video; JWplayer is evidently not cutting the mustard for SunRay, and this suggests that a free to download SunRay-specific Flash Player would be a really good thing.

    We came to this conclusion by uploading the test video (“video.avi”) to YouTube, where it plays just fine, even on a SunRay 1:

    http://www.youtube.com/watch?v=X2Gp4CvEpxo

    …and then I downloaded/extracted the FLV file from YouTube, and installed it in the on-SWAN directory (play-youtube.html / play-youtube2.html – unscaled and scaled, respectively) – only for SunRay1 performance to go down the toilet once again.

    The only variable in this scenario is the player software, so now we know the culprit.

    The question is: what can we do about it?

    JWPlayer playback on Darren’s SunRay270 was of higher quality, but still stuttered upon scaling. It would be nice to understand *what* is going on, and whether it’s something that can be poked using player settings, or if something more fundamental is going on…

  8. Experiement with FlowPlayer suggests it can play back smoothly… Need to investigate further…

Leave a Reply

Your email address will not be published. Required fields are marked *