Theora Codec Ported to Java
fons writes "These guys have ported the Theora codec to Java. This means that ANY Java-capable browser can now be used to watch video streams on the net (clients don't have to download a player!). You can watch a demo showing some boring guys sitting in the office. At least the music is ok :) On their site you can find a link to an interesting interview with the
boss, and it looks like more cool stuff is coming soon."
You can see an mpeg4 video demo here. The in-page JavaScripting seems broken, but the video and audio is good.
Um, was there a stable open source video codec before Theora? IIRC, XVid didn't stabilize until fairly recently. Plus aren't there worries about patents and XVid?
Anyway, I suspect the newness of an unencumbered open source codec has a lot to do with why this wasn't done before.
P.S. OW! Somebody turned up the volume on the video feed! (During Aerosmith's/Run DMC's Walk This Way) I'm shocked the feed is still up. (Watching on win2k, Firefox 0.8 (yeah, need to update) w/ Sun Java 1.4.2_04.)
Just by chance, did you change your USER_AGENT string somehow ? If it is set to MSIE or something else than Mozilla/Gecko, Java will crash. This is a know bug of SUNs JDK :((
Makes me curious - at this point, apparently, what Theora most needs is optimization of the code to make it work faster.
How optimized is this Java port of the codec, and will it be possible to compile it to 'native' code using GCJ for maximum performance?
Most of the time, Java code is Just-in-Time (JIT) compiled. Even the old MS Java Virtual Machine that comes with IE will JIT compile Java bytecode.
That means the Java bytecode is compiled on-the-fly. You generally end up running native code.
The latest Sun JVMs (and it's been this way for quite a while) will interpret code that doesn't get called often, but will aggressively compile code that gets called a lot. The theory is that the end result can perform better than Ahead-of-Time (AOT) compiled code.
In a nutshell, pre-compiling doesn't offer any performance advantages.
Seems to load quick but it uses atleast 50% of processing power of my Athlon XP 2200. Most DIVX, WMV, MPEG files use maybe 15% processing power while showing a video.
So it performance stills lacks, but i am still impressed that class and decoder load that quick even under slashdot load....
On the other hand, I bet that most of those other codecs you have on your machine are not straigth C/C++, but have inner loops optimized in assembly, using MMX, SSE and/or 3DNow instructions to their full extent. After all, video codecs are the main purpose why those special instructions were developed.
we've put up another mirror at http://194.78.112.13:8080/cortado/index.html The main site is pulling about 55Mbit/sec and is saturating at 2403 peak clients, it's still alive and kicking though :) enjoy! the fluendo team.
UT 2004 and Doom 3 both use OGG Vorbis to do their music. Well between these two engines, you are talking a lot of games. A very large number of games start by licensing either the current Epic or iD engine since they are so solid.
These two alone will provide a big boost for Vorbis in the gaming world.
I ran top, and all my CPU usage was XFree86 and kernel. That tells me that the bottleneck is most likely ALSA/X11 calls on my system. My CPU usage hits around 50% on an Athlon XP 2100+. I'm running JDK 1.5.0.
I bet if I used OSS, it might make a difference. It may even be sending the sound through the X11 Server for all I know.
I'm satisfied since my Java was using 10%. Java either does, or will, use OpenGL at some point (ldd doesn't seem to think so, but Java loads all platform libraries dynamically except for a few basics, and X11 if it is being used as a plugin). Also, I don't know if the codec even bothers to support Java2D. It may be that I get 50% CPU utilization because it keeps sending X11 calls to the X server using X11 Accel. that is really old to be compatible with remote X11 servers.
I hope this sheds a little more light into what's going on, and maybe someone that knows a bit more about Java2D and Linux/ALSA/X11 workings can make some more educated guess that I can.
I use the NVIDIA OpenGL under Debian with the latest Debs for everything in unstable (I even have it working with Neverwinter, and get more than adequate FPS) 2.7.8 Kernel, NVIDIA's AGP driver.
Karma Clown