Paul Rouget's home

twitter rss contact

Hi. I'm Paul Rouget. I work for Mozilla. I have fun with the web and the Mozilla platform. I write code. I give talks. I tweet.

This is my blog.

Comments are here

Tuesday, 07 September 2010

Ok, comments are here (powered by Disqus). I think my blog engine is ready now :)

random stuff

Thursday, 26 August 2010

Converting to WebM, OGG/Theora and MP4.

Monday, 23 August 2010

If you want to use the <video> tag, you need to encode your video to 3 formats:
  • WebM/VP8
  • OGG/Theora
  • MP4/h264
Here is a quick howto:

Build ffmpeg (version >= 0.6)

Create a directory, let's say "myvideos". All the comming commands will make sure that everything stays in this directory. Your system won't be altered.

Downloads:

  • ffmpeg source code: here.

dependencies:

  • vorbis: here (the version of you distribution should be ok: libvorbis-dev);
  • x264: here;
  • faac: here;
  • theora: here.
  • vpx:
    git clone git://review.webmproject.org/libvpx.git

Build:

mkdir ~/myvideos/dist

For these 5 dependencies:
  • un-compress;
  • go to the source directory;
  • ./configure --prefix=~/myvideos/dist && make && make install

Let's build ffmpeg:

$ LDFLAGS=-L$~/myvideos/dist/lib \
CFLAGS=-I~/myvideos/dist/include \
./configure --prefix=~/myvideos/dist --enable-gpl\
--enable-nonfree --enable-libvpx --enable-libvorbis\
--enable-pthreads --enable-libx264 --enable-libfaac\
--enable-libtheora
$ make && make install

Convert

To call ffmpeg:

~/myvideos/dist/bin/ffmeg

But first, you need to tell where to find libraries:

export LD_LIBRARY_PATH=~/myvideos/dist/lib/

Here are my 3 command lines to convert to WebM, OGG/Theora and mp4:

  • OGG/Theora
    ffmpeg -i input.mov \
      -acodec libvorbis -ac 2 -ab 96k -ar 44100 \
      -b 345k -s 640x360 output.ogv
    
  • WebM/vp8
    ffmpeg -i input.mov \
      -acodec libvorbis -ac 2 -ab 96k -ar 44100 \
      -b 345k -s 640x360 output.webm
    
  • MP4/h264
    ffmpeg -i input.mov \
      -acodec libfaac -ab 96k \
      -vcodec libx264 -vpre slower -vpre main \
      -level 21 -refs 2 -b 345k -bt 345k \
      -threads 0 -s 640x360 output.mp4
    
Video are resized to 640x360 with a bitrate of 345k.

Hope it helps.

HTML5 forms: more accurate tests for html5test.com

Monday, 23 August 2010

html5test is a good test. It's easy to understand. Neils found a good way to rate HTML5 support. It's not perfect, but I think a perfect test is not possible if you want to keep it simple. But there's still room for improvements.

Look at the current version of html5test, the Forms part. Webkit has a good score (34/38, 89%), although their HTML5 forms support is incomplete (no UI, validity barely implemented, but they expose the input type). The way forms are tested is not that accurate: just testing if the input type is supported as a DOM property is not enough. The good way is to check that the constraint is actually applied (input.validity.valid).

//Exemple: testing <input type=email>

/*
 * How it was tested
 */
var valid = (input.type == "email");


/*
 * A better way to test it
 */

input.value = "foo";
var valid = false;
if (!input.validity.valid) {
  input.value = "foo@bar.org";
    if (input.validity.valid) {
      valid = true;
    }
}

I also added some tests for input.form, input.labels and label.control. I'm also testing the forms related CSS selectors (:required, :optional, :valid and :invalid).

I sent a patch to Neils. You can see the result here beta.html5test.com. Basically, webkit score is less good now for the forms section (29/45, 64%), but still better than Firefox4 ;) (and still very good for Opera).

Firefox4 nightlies now support part of the HTML5 form specification (talk to Mounir, the main developer). The latest nightly's is 24/45 (53%), and it'going to get better :)

My new laptop: nanonote

Thursday, 19 August 2010

The Nanonote, a very, very small laptop, running Linux. Just bought it from Hackable-device. Can you see it? :)

RSS with content

Thursday, 19 August 2010

Now, the RSS feed should include the content of blog posts.

Step after step, I'm building my blog engine :)

IE performance

Thursday, 05 August 2010

Important edit: From the different results you shared with me: Sounds like they are probably using a D2D enabled build. Also, the result of this test is not constant at all (I just had a "111" on IE9). The only thing this test teachs us is that a hardware accelerated browser is faster. I will publish more data soon.

Honestly, I'm super excited to see IE9 coming with so many cool features. It's a little revolution :)

Microsoft, you do it right (well, I would like to see IE9 for Windows XP as well).

I just want to add one note to their awesome performance tests. When they test Firefox they don't activate the D2D acceleration in Firefox (and I understand that, we don't enable it by default, yet). But then, the result is a bit different...

HTML5/CSS3 Slides: DZ Slides

Friday, 30 July 2010

For the last few weeks, I've been using the same HTML template as slides for my presentations. This template is now online. It works great with Firefox 4 and I'm trying to make it work with other browsers (need help here). Feel free to grab the code and play with it:

DZ Slides.

RSS available

Thursday, 29 July 2010

Ok, so now, the RSS should work (paulrouget.com/index.xml). A part of this RSS is generated with gcc :)

gcc -traditional -E -P -C -x c -D VAR=value

RSS coming

Thursday, 29 July 2010

I'm working on it...

Lenovo shop, you do it wrong

Thursday, 29 July 2010

You know, I'm a huge fan of Lenovo products. Like "HUUUGE". I love the Thinkpads.

But, seriously, guys, the Lenovo Shop is just the most awful online store ever. They don't know HTML links (just JS jumps), you get lost in like 2 minutes, it's a mess to understand the difference between all the products... well, a nightmare.

What about a sober but efficient design, like you do for your products?

My new blog

Thursday, 29 July 2010

I use to have a Gandi blog (dotclear powered). Gandi did an awesome job, but they don't allow me to use my own HTML (I want the <video> tag!). So I decided to create my own blog. It's based on a shell script and some Vim magic tricks. No RSS for now, and no comments (for ever, don't want to deal with spam).