Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Java Programming Media Movies The Internet

Theora Codec Ported to Java 237

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."
This discussion has been archived. No new comments can be posted.

Theora Codec Ported to Java

Comments Filter:
  • ...that this time, this is a good development. Am I right? I hope so.

    Cb..

    • by Anonymous Coward
      Well, unfortunately, Java was removed from Windows [microsoft.com]. So people can't use this with an out-of-the-box Windows installation. They have to manually go and download and install the Sun JVM [sun.com]. Not something the average home user knows how to do.

      Thus it still seems that to reach the largest market, providing streaming video in WMV and QuickTime (and possibly Real) formats would be the best solution.

      This would have been a great development five years ago, though.
      • Strategy... (Score:3, Insightful)

        by bogaboga ( 793279 )
        The strategy will be to have DELL, IBM, HP and others install that java onto all desktops they sell. Then "all" mankind will be able to watch those videos. I should mention that I do not know what agreements M$ has with OEMs in relation to additions/subtractions to Windows. With that done, M$ will feel kicked in the stomach ouch...!! And the streams work. Very soon they will be slashdotted.

        BTW, I did not realize that mine was the usual FP!!

        Cb..

      • I'm sure that doing the whole thing in ActiveX would be cake.

        This can just be the web page embedded client for non-windows machines.
      • real player 10 supports playing theora/vorbis ogg streams out of the box
  • Great! (Score:3, Funny)

    by wheels4u ( 585446 ) on Friday September 10, 2004 @06:48PM (#10217809)
    Now I can watch porn everywhere!
    • Re:Great! (Score:2, Funny)

      by Anonymous Coward
      Yes, because watching porn on the internet was such a challenge before.
  • by Anonymous Coward on Friday September 10, 2004 @06:53PM (#10217844)
    Was linking to a video feed from slashdot's front page a mistake?
  • by Anonymous Coward on Friday September 10, 2004 @06:55PM (#10217859)
    Given all these reports that Java code can be made almost as quick as c/c++ (especially when number crunching), if not faster, why hasn't this happened before?

    Is it just that bit hackers are more comfortable in c?

    I would there would be a big benefit to having decoders/endcoders in java. On that note it would be nice if there were one defacto decoder/encode instead of ffmpg, jpegtools, transcode etc.

    Sorry for the ramblings, I guess everyone likes to re-invent the wheel ;)
    • by MyHair ( 589485 ) on Friday September 10, 2004 @07:15PM (#10218020) Journal
      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.)
      • Define stable. I've been using it for ages (Over a year) and it's been perfectly stable. So by stable do you mean if it IS stable, or if they CALL it stable (1.0)?

        Besides, Theora isn't stable, it's still in alpha. And yes, while above I said that it counts what it IS not what they CALL it, but alphas are not even feature complete, let alone stable.
      • Um, was there a stable open source video codec before Theora?

        Yes.

        IIRC, XVid didn't stabilize until fairly recently.

        Who cares about Xvid? Really now.

        Take a look at ffmpeg/libavcodec, lots and lots of very fast, very high quality, very stable codecs for encoding/decoding. All lgpl'd.

        Anyway, I suspect the newness of an unencumbered open source codec has a lot to do with why this wasn't done before.

        I believe MPEG-1 is completely unencumbered, due to patents expiring, and has been for quite some time.

        • >the VP3 codec was unencumbered as of Sept 2001, which means anyone could have implimented it anytime in the past 3 years.

          They did, and they called it Ogg Theora.
          • Yes, I'm well aware that Theora is based on VP3... However, it's a very different situation.

            Theora requires a different container format, cannot be decoded with the VP3 codec that many platforms already have installed, and STILL isn't even in beta stage.

            I certainly hope Theora becomes a good codec, but I've been following development, and it looks like 3 years wasted for nothing.
        • Actually, I would upgrade if newer version were faster and more stable, but the opposite is true.


          Opposite? When 0.9 came out, everybody praises how it's faster than previous releases.
    • Given all these reports that Java code can be made almost as quick as c/c++ (especially when number crunching), if not faster, why hasn't this happened before?

      Java was very slow for several years. It still suffers from a large memory footprint, and if you are processing a stream or large data set you have to be somewhat intelligent about how you write your code so as to prevent copying lots of data unnecessarily.

      In my view, it's probably more important that whatever reference algorithm is specified, tha
    • "Given all these reports that Java code can be made almost as quick as c/c++ (especially when number crunching), if not faster, why hasn't this happened before?"

      Who wants yet another video codec on the web?

      Don't worry, I agree with you that it should have happened sooner, but I can't ignore the former life I led where I worked at a company making web video technology. It was typically "make it work in WMP or Real Player or get it." Can't say I blame them, their audiences didn't demonstrate interest in
    • by badriram ( 699489 ) on Friday September 10, 2004 @07:48PM (#10218232)
      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....
      • I'm getting about 15% processor utilization on my P4 2.4Ghz. Loads really quickly and the video quality seems pretty good.

        I'd bet that a lot of the CPU utilization comes from the fact that it wouldn't be using direct draw like most players would rather than any codec issues.

        Wonder if jdk 1.5 would make a difference in CPU.
        • JRE 1.4 onwards should be using DirectDraw for their graphics output, though perhaps not as optimally as a purpose built codec that talks directly to the DirectX API.
        • by j3110 ( 193209 ) <samterrell @ g m a i l.com> on Saturday September 11, 2004 @02:43PM (#10222172) Homepage
          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.
      • by Anonymous Coward
        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.
      • Hmm.... what OS? On my Fedora core 2 system its barely using anything, I mean along with a Tomcat and Apache server running, and a few other things, my laptop isn't getting past 35.7% use in userland. Regardless, that is a damn clear stream, I've never seen a stream like that, especially while slashdot is pounding away. I mean something that clear with only a 35KB stream, its nuts. I am really impressed. Oh and as a side note, keep an eye out for the new Java VM to be released by Sun, I'm running the beta (
    • People just assumed that it wouldn't work. This assumption has now been proven wrong. I just watched the stream and it is pretty impressive for 32 bit/s. I kept an eye on memory usage and cpu usage. Memory usage is very acceptable (65 MB for a firefox nightly build + jvm + applet). It consumes about 40% cpu on my amd 2200+. The same applet in a freshly started IE is 46 MB. The difference is probably due to the fact that I had firefox open for the whole morning already (it tends to accumulate some weight ove
    • It has happened before: FAST (Fast Search And Transfer) had some Java technology for compressing and streaming video. For some reason they stopped the development; however, the demo I managed to see a couple of years ago was good, though small-scale.
  • by Anonymous Coward on Friday September 10, 2004 @06:58PM (#10217883)
    This guy [theprecipice.org] has been working on an mpeg-4 and mpeg-1 Java player for several years and has said that it will be released within the month. The demos on thsi site, although basic, look promising. His Mpeg-4 video can apparently go full screen given enough cpu. The good bit? it's going open source.
  • by Metteyya ( 790458 )
    For Real and Apple to reimplement and promote their own codecs the same way. Well, if we really want it - because Theora really does well.
    • I really want a nice capable MPEG4, preferably one capable of handling what comes out of divx and xvid. I don't care if it does apple or real, and I definitely don't care if it does microsoft. I want the same player to do MPEG1 and MPEG2, of course, though it doesn't have to do DeCSS - it would be a nice feature but I don't need it. If I'm going to stream something I want it to be something standard for which I can use any of a number of encoding tools. There's an easy path to turn almost any kind of video
  • Cool ... but (Score:4, Interesting)

    by Combuchan ( 123208 ) <seanNO@SPAMemvis.net> on Friday September 10, 2004 @06:59PM (#10217897) Homepage
    The demo on Firefox w/ XP professional (i'm at work) keylocked the machine (eg, press caps lock, no light) and it appeared completely frozen until a couple three-finger-salutes woke the machine up enough to use the Back button to get out of the page.

    I didn't hear any audio, but the video quality was wonderful. I'd love to dump Real et al. for this sort of thing--streaming media servers just tend to suck (anybody who's installed RealServer on a unix box will likely agree with me).

    Moreover, if you have any sort of secure web application that has streaming video, you can just stick this in rather than trying to wrap the same security concept around two different application servers. That alone is Very Cool.
    • by Anonymous Coward
      The demo on Firefox w/ XP professional (i'm at work) keylocked the machine (eg, press caps lock, no light) and it appeared completely frozen until a couple three-finger-salutes woke the machine up enough to use the Back button to get out of the page.
      Sounds like your computer is broken. Applications don't have that level of control over your system, even in Windows. Add more processors.
  • Compilable with GCJ? (Score:5, Interesting)

    by Dr.Dubious DDQ ( 11968 ) on Friday September 10, 2004 @07:01PM (#10217917) Homepage

    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?

    • Because Sun's java VM is faster than GCJ compiled native code in most cases.
    • by Teckla ( 630646 ) on Friday September 10, 2004 @07:44PM (#10218209)

      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.

      • In a nutshell, pre-compiling doesn't offer any performance advantages.

        That's a claim which is unproven. There are applications where gcj provides a significant speed-up, and there are others where Sun's JIT-VM runs faster. But it's not necessarily a fair comparison: Sun has spent a lot of resources on a smart and highly-tuned implementation, but there has been comparitively little work on Java-specific optimizations in GCJ. (Most of the effort has focused on functionality, especially the libraries.)

        • There are applications where gcj provides a significant speed-up, and there are others where Sun's JIT-VM runs faster.

          I'd expect short lived applications where JVM startup time is significant, or ones with very few loops or other repeated code to be in the first category, while long lived processes that basically repeat the same sequence of instructions (eg video codecs) would be in the second category.

      • Precompiling does offer advantages, at least at this point:

        1) More efficient binary code. Seriously, if you think you can make Java generate more efficient code than the Intel C compiler in a general purpose situation, you be my guest but you are going to lose. Intel has an extremely efficient compiler for the precompiled world and in general precompiled stuff, even on just an ok compiler, is faster than JIT.

        2) Access to native resources. Java abstracts everything by necessity to pull cross platform compa
        • For video, using DirectDraw is a major performance boost. You can do it C++, you can't do it in Java.

          So why do I see recommendations in Sun's bug database to use the command-line option -Dsun.java2d.noddraw to work around certain display bugs?

        • by Teckla ( 630646 )

          Precompiling does offer advantages, at least at this point:

          While there are almost always "exceptions to the rule", it's been proven out in the real world that precompiled Java generally doesn't offer performance advantages over non-precompiled Java using modern JVMs such as Sun's and IBM's, with some exceptions such as startup time.

          1) More efficient binary code. Seriously, if you think you can make Java generate more efficient code than the Intel C compiler in a general purpose situation, you be my gu

    • gcj does not give you maximum performance. My QR-decomposition code runs a lot faster on IBM and Sun virtual machines than compiled with gcj with maximum optimisation flags.
  • Seriously works! (Score:5, Insightful)

    by Anonymous Coward on Friday September 10, 2004 @07:03PM (#10217923)
    For some reason it seems to load faster than realplayer, quicktime or windows media player.

    I am using Java 5 RC which for me GUI program feel faster than .Net apps like RSS Bandit! Its actually a real option for anyone wanting to stream video.

    Also, please note I do feel dirty calling it Java 5...

    And nice work putting a video stream on the front page! Thats nice and considerate /.
    • by Lisandro ( 799651 ) on Friday September 10, 2004 @07:13PM (#10218003)
      My first thought exactly. "Holy shit, it looks better and loads faster than a Realplayer stream!". This is on my work's terminal (a PIII 800mhz with 512mb) on Opera 7, and the stream is flawless.

      Makes you notice how far Java has came peformance-wise lately. Ah, and kudos to the programmers. This is great work.
  • Its not futile! (Score:5, Insightful)

    by Ars-Fartsica ( 166957 ) on Friday September 10, 2004 @07:05PM (#10217948)
    Ogg Vorbis hasn't taken over the world, but people are using it and some vendors are supporting it. Theora will likely never slay Quicktime et al but that doens't mean a meaningful community of users can't emerge.

    Don't discount the business value of these open formats - for a hardware or tools vendor it is one less license to pay.

  • by Speare ( 84249 ) on Friday September 10, 2004 @07:06PM (#10217953) Homepage Journal

    Clients still have to download the player, it's just that the player is now in a form which is downloaded with less effort.

    • Not an entire player, but a codec.

      Now, you could argue any codec implementation could be downloaded automatically. But that is not practical or desirable unless 2 concerns are resolved:

      1) A reliable way to make the client download the right binary version of the codec (mac? win? linux - and if so what libc? and so on).
      2) Security - I don't particularly want to run "InstallJoeBloggsCodec.exe." It could install spyware, put junk in my registry, open a back door server, who knows what.

      Java is made fo

    • by Tobias Luetke ( 707936 ) * on Friday September 10, 2004 @08:34PM (#10218459)
      No, Huge difference, The player runs in a sandbox. That means everyone can be 100% certain that it won't install spyware of any sorts in the system.

      This is very very good.
      • Unless, of course, someone develops an applet and signs it with full privileges - then it can do anything it wants, as long as you click the "ok" button to let it.

        (Unless that's changed since I last did applet stuff, which is a few years now)
        • This I think was one of the worst aspects of ActiveX. All of the ActiveX widgets on the web ended up popping up so many security confirmation dialog boxes that a malicious (spyware most likely) widget slipped through because "it looked like all the others." If on the other hand most web pages used Java applets instead, the dialog box becomes sufficiently rare as to illicit a closer look.

          It's kind of like bulk email. Back when spam was only one message in fifty, picking it out was easy. After a majority
  • by ElForesto ( 763160 ) <.elforesto. .at. .gmail.com.> on Friday September 10, 2004 @07:08PM (#10217972) Homepage
    I used to work at that place during the dot com explosion, and they had some pretty neat Java-based video stuff that ran very nicely even on modems. They even ended up making the broadcast software Java-based so that they didn't need to install software anywhere. Of course, the downturn took it's toll and I think it's run out of some person's house now or something.
  • Port to .NET/Mono (Score:2, Insightful)

    by Anonymous Coward
    Since there's a port to Java, is there anybody willing to port to .NET or Mono?
  • by spludge ( 99050 ) on Friday September 10, 2004 @07:26PM (#10218100)
    I just tried it in both Firefox and IE. It looks great (sounds good too) and it loads really quickly! I hope sites start switching to this rather than using real media or WMV streams for windows media player.
  • Re: (Score:2, Redundant)

    Comment removed based on user account deletion
  • by KrackHouse ( 628313 ) on Friday September 10, 2004 @08:13PM (#10218341) Homepage
    The guys at BannedMusic.org [bannedmusic.org] are using a similar system to make it simple to use BitTorrent. This combination of technologies could be the kick in the butt that Open Source needs to reach the mainstream.

    A quote:
    The best solution seemed to be a simple modification of BitTorrent: an installer that runs BitTorrent and begins download of an included torrent file. Windows users can click on the "Easy Download" button on an album's download page to get a 3mb executable. When they launch this executable it installs BitTorrent (which happens very quickly in the background) and immediately begins downloading the album they were seeking. After they've used the "easy download" once, they can simply click on the .torrent files to begin downloading. And they'll be able to use other sites that require BitTorrent.
  • by shutdown -p now ( 807394 ) on Friday September 10, 2004 @09:17PM (#10218661) Journal
    Now we only need an ActiveX plugin which will automatically download and install JRE on one's computer, and it will Just Work!
  • what is that dude doing to the giant penguin doll... that's just wrong...

    and there he went and knocked the camera off its mount. sweet!
  • Reinvented really.

    The Livecam server we developed in 1995 and dominated the adult industry already did all this and supported more viewers with better quality.
    We supported Motion JPEG or H.236 in 1999 with GSM audio, with 20Kbps to 70 Kbps streams.

    I just love it when someone else come out with it all over again and everyone thinks it's new.

    ----Original Message-----
    From: James S
    Sent: Friday, September 10, 2004 5:18 PM
    To: sokol@videotechnology.com
    Cc: Jesse Monroy
    Subject: Hey These guys just invented the Ja
  • by Doug Dante ( 22218 ) on Saturday September 11, 2004 @01:44AM (#10219550)
    In the movie Antitrust, the protagonist's best friend develops an innovative video codec. Because of all of the potential endpoints from which the codec could be run (cell phones, PCs, video game systems), he embeds the code for decoding the code in the stream itself. This is somewhat similar to downloading an applet containing the codec and all of the data.

    The villian, his boss, rips off the codec and has him killed.

    This technical detail was probably the most interesting part of an otherwise thoroughly mediocre movie.

    BTW, I kind of had the impression that his codec generated some sort of code. That code is then transmitted to the client and executed, and is ouput is the set of pixels seen on the screen.

    • Not a new technique (Score:2, Interesting)

      by ReKleSS ( 749007 )
      Just for interests' sake, that technique (code that creates the pixels) does exist, but isn't in common use any more. Back in the days of dos games, when performance was critical, self-drawing sprites were used - the code would output some executable code that would drop the sprite into video memory. Since it was moving direct values into memory, instead of reading memory and writing back, it was faster. However, as I said, the technique isn't used any more, because it's just too troublesome for what is now
    • I kind of had the impression that his codec generated some sort of code. That code is then transmitted to the client and executed, and is ouput is the set of pixels seen on the screen

      I seem to remember the creator of Vorbis (Monty) writing once that he wanted to make an audio codec exactly like that but that there wasn't enough time. The priority was to get a working codec out there, which later became Vorbis.

      I can't seem to find anything about it on Google so it's possible I imagined it :)

"The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts." -- Bertrand Russell

Working...