Monday, June 8th, 2009

Firefogg: Ogg Theora Encoding Plugin

Category: Utility, Video

>

Test Drive the latest Thusnelda theora encoder with in-browser Video Encoder Firefogg.

Firefogg is an open source extension written by xiph hacker Jan Gerber that lets web developers request ogg video from their users. Since Firefogg is a Firefox extension it allows users to stay up to date with the latest and greatest theora encoder improvements. Firefogg supports a rich api for enabling web applications to drive in-browser transcoding from any source footage to ogg theora video (and possibly other free formats in the future). Firefogg supports simultaneously uploading while its transcoding via resumable one meg post chunks. It also supports fall-back to HTTP POST all-at-once. Both methods include progress indicators.

Firefogg can also encode to a local file and an example local transcoding application is on the site. The sample application builds on jQuery UI so it supports custom themes. Integration for firefogg with wikimedia commons are in testing. With Firefoxs video tag support this should be a helpful extension for converting video to ogg theora or supporting ogg theora video contributions in your website.

Firefogg can minimize the need for costly server side transocding infrastructure. It also helps avoid the extra transcode problem that plagues net video where a user saves to a compressed format locally to save time uploading; then the server re-transcodes the video so others can view it with a flash plugin. With Fireofogg we can go strait from the high quality source to the format distributed on the web site.

Here is an example of using the API yourself to convert video:

javascript
< view plain text >
  1. if(typeof(Firefogg) == 'undefined') {
  2.   alert('You dont have Firefogg, please go to http://firefogg.org to install it');
  3.   window.open('http://firefogg.org');
  4. }
  5.  
  6. var ogg = new Firefogg();
  7. if(ogg.selectVideo()) {
  8.   var options = JSON.stringify({'maxSize': 320, 'videoBitrate': 500});
  9.   var data = JSON.stringify({'title': 'example video'});
  10.   ogg.upload(options, 'http://example.com/addvideo', data);
  11.   var updateStatus = function() {
  12.     var status = ogg.status();
  13.     var progress = ogg.progress();
  14.  
  15.     //do something with status and progress, i.e. set progressbar width:
  16.     var progressbar = document.getElementById('progressbar');
  17.     progressbar.style.width= parseInt(progress*200) +'px';
  18.     progressbar.innerHTML = parseInt(progress*100) + '% - ' + status;
  19.  
  20.     //loop to get new status if still encoding or uploading
  21.     if(ogg.state == 'encoding' || ogg.state == 'uploading') {
  22.       setTimeout(updateStatus, 500);
  23.     }
  24.     //encoding sucessfull, state can also be 'encoding failed'
  25.     else if (ogg.state == 'done') {
  26.       progressbar.innerHTML = 'Upload done. You can close this window now';
  27.     }
  28.   }
  29.   updateStatus()
  30. }

Related Content:

Posted by Dion Almaer at 7:04 am
9 Comments

++++-
4.3 rating from 21 votes

9 Comments »

Comments feed TrackBack URI

Crowdsourcing the transition to open video – nice!

But whats the fox doing to that fish??

Comment by Unfocused — June 8, 2009

Great extension and even better article picture :)
In other news – The mystery about the gender of the famous Firefox has unraveled after a long period of speculation.

Comment by tsonev — June 8, 2009

@Unfocused

Giving it the tongue.

@tsonev

How so?

Comment by mdmadph — June 8, 2009

Yes, the logo is amazing, but the fish does not really look to be consenting…

Comment by frenchStudent — June 8, 2009

that poor fish!

Comment by thnkfstr — June 8, 2009

Even though I love this idea, it’s wrong on so many levels it just cannot make its way into production code.

Comment by hdragomir — June 8, 2009

The fox reminds me of Troy Mc Clure.

Comment by andytesti — June 8, 2009

Makes me want to write a firefox extension just so I can create a logo for it with a rotated firefox on top, that’s genius.

Comment by Jadet — June 8, 2009

I don’t understand what’s the big deal with this encoder.
there are a lot of better services and encoders in the market.

Comment by videoencoding — July 22, 2009

Leave a comment

You must be logged in to post a comment.