How do I make h.264 work on YouTube on Firefox on Windows 7 64 bit?

As a general comment, sometimes such problems are caused by missing codecs, fixed by installing a codecs pack such K-Lite. But as your videos do play when downloaded, this isn't your problem.

The video example that fails for you uses Flash, but you prefer the YouTube HTML5 player. More information is found in the article Force YouTube to Use the HTML5 Player:

YouTube's HTML5 player is great, but it's not enabled for all the videos. Even if you go to youtube.com/html5 and join the HTML5 trial, you'll find a lot of videos that use the Flash player. "Some videos with ads are not yet supported (they will play in the Flash player)," mentions the site.

There's a simple Greasemonkey script that forces YouTube to use the HTML5 player for almost all the videos you watch at youtube.com. You need to install Greasemonkey if you use Firefox or Tampermonkey if you use Chrome, then click the "Install" button here.

For Chrome, use the old version from Sept 23.

The script works better in Firefox. If you install the script in Chrome, it will disable the new Ajax interface, but everything else seems to work well.

Here's a video you can use to test the script. Please note that the script doesn't work for embedded videos.

EDIT : As userscripts.org has disappeared, I have modified the links to point to userscripts-mirror.org. In addition, I reproduce the script below :

// ==UserScript==
// @name        ythtml5kiss
// @namespace   mentormayhesset
// @description YouTube the HTML5 player [Firefox+Greasemonkey>=1.0]
// @include     https://www.youtube.com/*
// @include     http://www.youtube.com/*
// @exclude     https://www.youtube.com/embed/*
// @exclude     http://www.youtube.com/embed/*
// @version     3.1
// @run-at      document-end
// @grant       none
// ==/UserScript==

try{
    window.ytspf = window.ytspf || {};
    Object.defineProperty(window.ytspf,'enabled',{value:false});
    ytplayer.config.html5=true;
    delete ytplayer.config.args.ad3_module;
}catch(e){}