Ogg/Theora Applet instead of Flash

Miscellaneous

ad free blog

2007-12-30 by Thomas Fischer [en]

Thomas Fischer Due to youtube.com and other similar sites, videos on websites have become very popular. However, Flash has several drawbacks such as closed source and limited support of non-Windows systems (see "Why Flash sucks"). Luckily, there is an alternative available based on patent-free and GPL'ed software.

Fluendo offers a java applet called Cortado that can play (streaming) multimedia files including ogg vorbis and theora files. Advantage with this approach is that is does not require to install any codes on the target computer and should run on any java-capable system.

To put a video on your website, you have to perform some simple steps:

  1. Convert your audio or video file into an .ogg file.
  2. Upload both the .ogg file and the Cortado .jar archive on you webspace.
  3. Include some applet code into your website.

Converting existing audio and video files

To convert existing audio and video files, you may want to use ffmpeg2theora. This program is easy to use, but to fine-tune the conversion there is a set of parameters e.g for quality, resolution and sampling, contrast, brightness or gamma control.

Including the applet on your website

Depending on where you got the .jar file from, it may have different names. In my case it is called cortado-ov-debug-0.2.2.jar for audio (ogg vorbis) only and cortado-ovt-debug-0.2.2.jar for audio and video (ogg vorbis+theora).

To embed an applet on a HTML page, there is both the applet tag and the object tag. The former one was invented by Netscape, not standardized by W3C, but works with most browsers. The latter one is standardized, but is said to be more complicated to be used. Although I favour standardized procedures, I'll stick with applet for this example.

The code for the video below looks as follows:

<applet code="com.fluendo.player.Cortado.class"
        archive="cortado.jar"
        width="320" height="240">
   <param name="url" value="rabbits.ogg"/>
   <param name="duration" value="10"/>
   <param name="local" value="false"/>
   <param name="keepAspect" value="true"/>
   <param name="video" value="true"/>
   <param name="seekable" value="true"/>
   <param name="audio" value="true"/>
   <param name="bufferSize" value="200"/>
</applet>

For your own video, you may have to change the following parameters:

archive
Location (URL) of the .jar file to use
width
Width of your video in pixel
height
Height of your video in pixel
url
Location (URL) of your video
duration
Length of your video in seconds, used for the slider

For more details on the parameters, please refer to the README file.

Finally, the applet should appear on the website as shown here:

Update: Of course, as the java applet is a player only, the video is available as a stand-alone file on the web server, too.

Keywords: Linux
Trackback-URL: http://www.t-fischer.net/blog/20071230_Ogg_Theora_Applet_instead_of_Flash

Writing comments is currently not possible. Feel free to write me an email to the address shown on my homepage.

More social bookmarking links than anybody else ;-)
LinkARENAalltagzTechnoratiMister Wongdel.icio.usGoogle BookmarksYiGGsimpyfurlblogmarkstailranktektagoneviewdiggslashdotfolkdyahoo my web
Valid XHTML 1.0!Valid CSS!UTF-8 EncodedUse Metric & SIGentoo LinuxSession Initiation ProtocolAny BrowserWir wollen keine Softwarepatente!Coffee PoweredUnix-AGKDE Developer (KBibTeX)Hacker EmblemPlay OGGXING profileDANTE MemberThe content of this page is licensed under a Creative Commons Attribution-Share Alike 3.0 License, unless noted otherwise.Blog
Date of Modification: 2009-Feb-21 18:08Chuck Norris