Missing Codecs in Firefox to Play Video in Gallery2

Update:

Instead of doing all the work below, you should first try installing this plug-in: Windows Media Player Firefox Plugin

Every once in awhile, I’ll hit a video on my gallery that requires me to download a codec, but telling it to download fails to find a codec that’ll work. If I copy and paste the URL into IE, the video plays fine. I started searching the Gallery forums.

I found this thread: Combination Gallery 2/AVI/Firefox does not display video, and it appears a lot of people are hitting this issue:

When adding an AVI file to my gallery it is recognized and ffmpeg creates a thumbnail for it. Viewing the item with Internet Explorer will result in the video being displayed.

However this does not work with Firefox. For some reason it seems that the Windows Media Player plugin in firefox does not recognize the video/x-msvideo MIME-type. Check about:plugins and scroll to Windows Media Player to confirm this.

Technically this is not a Gallery problem, but a bug by Microsoft in there Firefox support. However since Microsoft is not very likely to fix this it would be nice if someone could provide a work-around and integrate this into Gallery.

Before, I would just tell every video to use mime type: video/x-ms-wmv, however, Gallery2 supports a wider range of mime types, so I decided to let it do its own thing.

It turns out, to fix this problem, you need to associate video/x-msvideo in Firefox. Instructions provided by: Avi in firefox.

To do this, open the following file in notepad:
%APPDATA%\Mozilla\Firefox\pluginreg.dat

Search for “Windows Media Player Plug-in Dynamic Link Library” and add the bolded lines:

Windows Media Player Plug-in Dynamic Link Library|$
10
0|application/asx|Media Files|*|$
1|video/x-ms-asf-plugin|Media Files|*|$
2|application/x-mplayer2|Media Files|*|$
3|video/x-ms-asf|Media Files|asf,asx,*|$
4|video/x-ms-wm|Media Files|wm,*|$
5|audio/x-ms-wma|Media Files|wma,*|$
6|audio/x-ms-wax|Media Files|wax,*|$
7|video/x-ms-wmv|Media Files|wmv,*|$
8|video/x-ms-wvx|Media Files|wvx,*|$
9|video/x-msvideo|Media Files|avi,*|$

Increasing 9 to 10 tells it that there’s 10 mime types you should associate this plug-in with. Adding the video/x-msvideo line tells it to associate mime types of that with Windows Media Player. Afterwards, all my avi files began to play fine.

After saving this file, restart Firefox and video with the mime type of x-msvideo should play fine.

Sherbert vs Sorbet

The other weekend at Bellevue Square, Stanman, Saran, Carolyn and I were discussing about ice cream, which ended up either Stanman or I bringing up ordering Rainbow Sherbet at Thrifty (before they got bought by Rite-Aid). Rainbow Sherbet has been and still is my favorite ice cream flavor (I think…). Anyway, we got to the point where we were debating how to pronounce sherbet and what sherbet really was.

When I was small, I called sherbet, well sher-bet or sher-bert, but then I learnt the word sorbet (pronounced sor-bay), so I thought, maybe that’s how you pronounce it (i.e. sher-bay). Others chimed in that sherbet was a derivation of sorbet (but pronounced differently) or that it was just another way of spelling sorbet and are in fact the same thing.

Then I mentioned that sherbet wasn’t really ice cream because it didn’t contain any milk (needed for the cream part of ice cream), but Stanman argued that it was an ice cream and does in fact contain milk. I’ve always associated sherbets with frozen fruit juices and they don’t really taste like they contain any type of milk in them. I mean when I get a “dream” smoothie from Jamba Juice, those taste like it has milk.

According to Merriam-Webster, the correct pronunciation is sher-bet, with a variant: sher-bert.

Anyway, thank god for Wikipedia: Sherbet (U.S.)

Sherbet (often pronounced and even occasionally spelled sherbert in American English) is a frozen dessert made from iced sweetened fruit juice or puree. Sherbets usually have more ingredients, such as milk, egg whites, or gelatin, than sorbets, which are generally made from iced fruit puree and other ingredients. Sherbet in the United States must have a milkfat content between 1% and 2%, and a slightly higher sweetener content than ice cream; else, it must be sold as ice cream if the fat content is higher or sweetener content lower, ice milk if milk or sweetener content is lower, or as sorbet if no milk is present at all. American sherbets have a minimum density of 6 lb/gal (720 g/L) and are flavored either with fruit or other ingredients.

There you have it. Sherbet does in fact contain milk, but is not ice cream due to the lower milkfat content and the higher sweetener content.

Random Crap:

Are You Smarter Than a 5th Grader – Larry pledge (from SueOn) – Contestant Larry gets confused on a 1st Grade Grammar question.

Mathematicians set Chinese testMaths enthusiasts are being challenged to answer a sample question from Chinese university entrance tests. The Chinese math entrance exam is actually quite difficult. I was able to solve i and ii, but iii has been giving me trouble. Plus my math skills are still rather rusty. On the other hand, the English Math test was a joke.

‘Kryptonite’ discovered in mine (from Digg) – Kryptonite is no longer just the stuff of fiction feared by caped superheroes. A new mineral matching its unique chemistry – as described in the film Superman Returns – has been identified in a mine in Serbia.

Police: Thief tries to trade stolen JeepA Bridgeport man has been arrested after he tried to trade in a Jeep to a car dealer, a month after allegedly stealing the same Jeep from that same dealer, police said.

Super Street Fighter II Turbo HD Sprite Comparison (from Digg) – Man, Ryu has never looked so slick! French website Gamekult has posted this “confidential” slide from a Capcom press conference showing a comparison between the original SSFII Ryu sprites scaled up to HD resolution and what the new HD sprites will look like. What a difference, eh? If the other characters and backgrounds look as good as this one (which one naturally assumes they will), this will be one of the must have games on XBLA and well worth the MS points to purchase it. The evolution of Ryu!

Exclusive Cakes You’ve Never Seen (from Digg) – “It is sweet miracle cake, a piece of childhood in a serious adult world. All you need is to blow out a candle and make a wish. Cakes are very different, but made with sincerity and therefore loved.” Enjoy. These custom cakes look awesome.

Man cuts off penis in restaurantA man cut off his penis with a knife in a packed London restaurant.

The Most Expensive Movies Ever Made (from Digg) – interesting list. Read the story here.

The Most Excruciatingly Painful, Yet Typical, Customer Service Call EverI was listening to a call recording from our Service Quality Tracker, and the call was so ordinary, yet pointless, that I was inspired to create some video commentary.

Suspected robber flushes money in toiletDeputies with a search warrant removed the toilet from its plumbing and found shredded U.S. currency in the toilet trap, Swanson said. I’m actually curious. Since it’s confirmed that the $50,000 stolen was shredded and flushed down the toilet, does the bank get the money back, in the form of new bills or depositing electronically into their account?

CalTV: UC Berkeley’s Online TV Station (from MS newsgroup) – sounds like the cal press has gone video.

WordPress Theme Generator (from Digg) – This online generator creates your own custom unique WordPress Theme. Without any need for HTML, JS, PHP, or CSS knowledge. Change the colors, settings, layout, preview live, click “save” and download your unique WordPress theme zip-file. Extract, upload, set, and you are done! If you have any questions or need additions email me. Interesting… I haven’t had time to play with it yet, but let me know what you think about it.

GH2 – Dead! – XBOX360 – Expert (8 Years Old) (from Digg) – Guitar Hero II – XBox 360 – Dead! – My high score is 259,820

Cities plagued by rodents, emergency declaredThe rodent population in six Peruvian regions has ballooned due to unusual weather patterns and the government declared a state of emergency on Tuesday to control the plague, including in the capital city, Lima.

Updating WordPress Plugins

After upgrading wordpress to 2.1.*, I noticed that comments now had its own new tab. However, Akismet Spam was still under Manage. Turns out I was using Akismet 1.4 when 2.0 is already out. Upgrading took some work where I had to deactivate the plugin, download and extract the newer version and then reactivate the plugin.

After updating Akismet to 2.0, it moved the Comment Spam to the correct tab now.

Gallery’s plugin system was a lot user to use than WordPress, where all I had to do was click on the upgrade button. I can even see a list of official plugins, experimental plugins, and even community plugins and they’re installed with a simple click.

Maybe we’ll see this in a future version of WordPress.

Gallery – Tags

So after switching over to the Ajaxian theme, I’ve decided to see if tagging support has been added to Gallery (maybe via a plug-in). Well it actually started when Artemyst asked me if Gallery supported tagging or he was going to switch to something like danbooru. I searched and found this thread: [Tags] New Module for Gallery 2.2.

I’ve given it a whirl and it’s rather neat and they’re still adding a bunch of features and stuff. Don’t bother downloading the one attached to the thread. You can download this plug-in right out of your Gallery’s admin panel. From their wiki:

  • login as admin
  • plugins from the left navigation
  • Click the Get More Plugins tab.
  • Click the Show repository list button.
  • Check the Community plugins box; Save
  • Click the update repository list button; click continue.
  • Under the Extra Data section download the the tags module.

This will put 2 new items in the side bar of your admin panel:

  • Tags Management
  • Tags Settings

Tags Management is managing your tags. You can view the list of your tags here, but mostly it’s meant for deleting and renaming your tags. In Tags Settings, you have some more tweaks you could do like limit the number of tags shown, to enable Tag Cloud, etc.

The Tag Cloud is rather cool. You could see mine here: Tag Cloud

I’ve only started tagging new stuff and some random old stuff to test out it’s feature. It’s come a long way I must say. I was playing with v1.0.0 for quite awhile and had many issues. You can read the thread I posted earlier to see what a newb I am.

Things the author said we could look forward to include joining of tags (i.e. And/Or 2 or more tags).

The ability to add tags directly in album view was a really nice addition. Too bad for Ajaxian, the theme disables that block since it squishes all the images together. It’d be nice if the same box was available in photo mode. Bulk edit’s really nice too with the ability, well, to edit 15 items at a time, instead of 1 by 1.

What I really want is to be able to allow anonymous tagging, but sent into a moderation system, and maybe even have a service like Akismet to filter out spam.

Ajaxian Theme Misalignment

I had begin noticing some weird alignment issue with Gallery’s Ajaxian Theme. On page 2 onwards of any album, the bottom next and last button links would be shifted a bit lower than it’s desired location:
ajaxian theme - misalignmentajaxian theme - misalignment

I started a thread on Gallery’s forum: ajaxian theme and mis-alignment of next/last on page 2 onwards and pointed out that the top links look okay, while the bottom didn’t. I also noted the fact that source wise, the top had them in reverse order, where it wrote out the next/last links first, before writing out the first/previous:

top:
<div class="next-and-last">...</div>
<div class="first-and-previous">...</div>

bottom:
<div class="first-and-previous">...</div>
<div class="next-and-last">...</div>

I thought maybe if I can reverse the order of those statements, this might be fixed. I decided to see if I could figure this out. Looking at the style sheet (/themes/ajaxian/theme.css), it appears this is how the blocks are defined:

.next-and-last {
    float: right;
}
.next-and-last.no-previous {
    float: none;
    text-align: right;
}

I started playing with the .next-and-last style, but didn’t really get anywhere unless I manually set it to be shifted up x-pixels.

I then found /modules/core/templates/blocks/Navigator.tpl, which actually uses this class and it just appears to be something simple that returns first-and-previous or next-and-last block.

Then I found /themes/ajaxian/templates/album.tpl, which actually calls the Navigator.

On the top, it showed:
{g->block type="core.Navigator" navigator=$theme.navigator reverseOrder=true}

but the bottom only shows:
{g->block type="core.Navigator" navigator=$theme.navigator}

I added the reverseOrder=true to the bottom, and that fixed it.

Enjoy!

Upgraded to Gallery 2.2.1

I’ve also decided to upgrade my Gallery to the latest version and played with some of the themes. Ended up picking one called Ajaxian, which I think is rather nice. It does a nice job with the pictures, but I’m hitting some problems with the album view where the icons cover up half the picture and there’s really no intuitive way to use it for videos and mp3s. Only after you figure out how to use the pictures will you be able to figure out how to play video and play audio.

I’ve also been playing around with the different plug-ins, like the flash mp3 player, square thumbnails, rss feeds, etc. Not too sure how everything works yet, but we’ll see.

If you hit any problems with that, please let me know.

Upgraded to WordPress to 2.1.3

I upgraded my blog to use the latest WordPress (version 2.1.3)

If you see any problems, please let me know.

Thanks in advance!

It was actually a lot simpler than I had originally imagined. They suggested I delete all existing content besides the wp-content folder and the wp-config.php, but I just renamed it (just to be safe in case I had added some custom code). I deactivated my plug-ins as suggested. I uploaded the files onto my server. Then I just went to wp-admin/upgarde.php and it said there was only one step and I was done. I reactivated all my plug-ins and things just worked.

Now if they can just streamline the upgrade process where I just click 1 button.

Random Crap

Forgot to wish Tekman HAPPY BDAY!

I’ve added 2 new categories: Food and Comics

I found this bumper sticker and found the slogan hilarious: My kid has a cooler job than your kid. – Microsoft College
my kid has a cooler job than you - microsoft  college

Otters holding hands (from Esca) – Vancouver Aquarium: two sea otters float around, napping, holding hands. SO CUTE! You know, I haven’t visited Vancouver Aquarium yet.

I know it’s way past April Fool’s day, but it appears that after you graduate from college, people just forget about April Fool’s day. I got so many people IMing asking me if this was real: Google TiSP and when I mention it was April 1st / April Fool, they go, “Oh yah! I forgot about it.” Another Google joke was GMail Paper.

Along the same topic, there was Ten of the best April Fool’s Day hoaxes: US museum (from Digg) – Here were the ones I liked:

  • In 1957, a BBC television show announced that thanks to a mild winter and the virtual elimination of the spaghetti weevil, Swiss farmers were enjoying a bumper spaghetti crop. Footage of Swiss farmers pulling strands of spaghetti from trees prompted a barrage of calls from people wanting to know how to grow their own spaghetti at home.
  • In 1996, American fast-food chain Taco Bell announced that it had bought Philadelphia’s Liberty Bell, a historic symbol of American independence, from the federal government and was renaming it the Taco Liberty Bell. Outraged citizens called to express their anger before Taco Bell revealed the hoax. Then-White House press secretary Mike McCurry was asked about the sale and said the Lincoln Memorial in Washington had also been sold and was to be renamed the Ford Lincoln Mercury Memorial after the automotive giant.
  • Burger King, another American fast-food chain, published a full-page advertisement in USA Today in 1998 announcing the introduction of the “Left-Handed Whopper,” specially designed for the 32 million left-handed Americans. According to the advertisement, the new burger included the same ingredients as the original, but the condiments were rotated 180 degrees. The chain said it received thousands of requests for the new burger, as well as orders for the original “right-handed” version.
  • Noted British astronomer Patrick Moore announced on the radio in 1976 that at 9:47 am, a once-in-a-lifetime astronomical event, in which Pluto would pass behind Jupiter, would cause a gravitational alignment that would reduce the Earth’s gravity. Moore told listeners that if they jumped in the air at the exact moment of the planetary alignment, they would experience a floating sensation. Hundreds of people called in to report feeling the sensation.

Bulgaria goes into debt to buy fleet of Porsche Cayenne ambulances (from Digg) – There’s few things that could make one turn away from the blue light at the end of the tunnel and return to the land of the living, but a ride in a Porsche Cayenne ambulance just might do the trick. Apparently Bulgaria agrees, as the cash-strapped country’s health ministry is using a loan from the World Bank to buy a fleet 32 Cayenne’s destined for ambulance duty (a Russian Porsche Cayenne police vehicle is shown above). Maybe I should work as an ambulance driver for the Bulgarians.

Don’t buy an HDTV without reading this first (from Digg) – Forking out a few thousand dollars or even just a few hundred is a serious investment, and the last thing you want to do is buy an HDTV with lousy color rendition. Navigating the minefield in consumer electronics is a confusing proposition even for the seasoned gadget geeks, so I created this survival guide to help you make a wise decision. I’ll explain the various types of HDTVs as well as cabling and testing the color depth of your display. I think this guy does a rather good explanation of the difference between the types of HDTVs and all those random specs one usually has no idea what they’re talking about.

MPAA names its Top 25 movie piracy schoolsThe MPAA may be gearing up for an RIAA-inspired assault on US colleges and universities. Last week the group announced its support for the “Curb Illegal Downloading on College Campuses Act (2007),” and MPAA head Dan Glickman said that his organization would work with school administrators to put an end to movie piracy on campuses, which Glickman says costs the industry $500 million annually. Stanford and Berkeley rank 24 and 25 respectively.

HostTracker (from Digg) – website monitoring service. I’ve been using InternetSeer, but this one looks good too.

tapefailure (from Digg) – tapefailure lets you record your users’ browsing sessions and play them back, just like a tape, as well as view numerous useful statistics about your users. Really sounds like a neat feature when it gets released.

Panama co. says brews world’s biggest cup of coffeePanama’s top coffee producer said it believes it has set a new record for the world’s biggest cup of coffee, after brewing 750 gallons (2,840 litres) in a giant mug on Sunday.

bowling dental insurance ad
Very Clever Marketing Campaign (from Clip Haven)
However, if I was bowling in this alley, I’d sort of be creeped out.

DreamHost 500 Internal Server Error – Part 2

So I get a reply to my request for more information and here was DreamHost’s reply:

Well, each shell/ftp user has their own resource quota…so basically, all of your sites are sharing a quota at this point, as well as your shell user…so if your nano session happened to be the one process that crossed the threshold, then it would be the one killed. One thing you might try is creating another shell/ftp user, and setting the site to run under the new user. This would give the entire site it’s own resource quota, and probably help to prevent these errors in the future.

As far as the process watcher, the threshold is reasonable, and it’s a VERY simple program…just a couple of IF statements. IF overall server load is above a certain level, enforce the rules. IF a user reaches a certain CPU/Memory level, kill the offending process. Not much to go wrong…

Let me know if you have any other questions.

Thanks!
Jeffrey

So I’ve decided to split my blog and gallery into 2 users and then I’d get twice as much CPU power (if what he says is true). Turns out I can actually create upto 75 user accounts.

Unfortunately there’s no way to set users to share directories, so I ended up creating a new subdomain and copying stuff over. When you visit the old gallery link:
http://www.krunk4ever.com/gallery/,

You’ll automatically be redirected to:
http://gallery.krunk4ever.com/.

I originally was hoping to put it in the 1st level, but gallery was giving me some problems if I didn’t place it inside /gallery, since it was originally inside gallery.

I somewhat got the 1st level thing working by fixing my .htaccess file and in config.php, set a baseUri:
$gallery->setConfig(‘baseUri’, ‘/main.php’);

The process was actually less painful than I originally thought. I had imagined hacking the database and having to do a bunch of random fixes.

The only thing I had to do was copy over 2 directories:
/gallery (where the website code was located)
/g2data (where the images and data were actually stored)

In config.php, I had to update data directory:
$gallery->setConfig(‘data.gallery.base’, ‘/home/krunk_gallery2/g2data/’);

When I loaded gallery, it asked me to run through the update wizard.

The initial setup failed because the web user didn’t have write access to the g2data directory. It suggested that I had chmod 777 the g2data directory. After I did that, that error went away.

The last thing I did was update my .htaccess to do all my redirection by adding this line:
Redirect permanent /gallery/ http://gallery.krunk4ever.com/gallery/

Afterwards, everything just worked. If you hit into any problems with the gallery or my blog, please let me know.

DreamHost 500 Internal Server Error

I’ve been getting a bunch of 500 Internal Server Errors on my website, especially when adding images to my Gallery. Takes about 3-4 times before it’ll work. DreamHost is apparently having some recent slew of problems and are currently trying to fix all the issues: DreamHost Status.

If you unfortunately hit this problem, try refreshing the page a few times and it should work. I apologize beforehand for the inconvenience.

Looking at the error.log, I see:

[Sun Apr 15 19:33:12 2007] [error] [client xxx.xxx.xxx.xxx] Premature end of script headers: /dh/cgi-system/php5.cgi
[Sun Apr 15 19:33:12 2007] [error] [client xxx.xxx.xxx.xxx] File does not exist: /home/krunk4ever/krunk4ever.com/internal_error.html

I had tried reverting back to PHP 4.x, but get a similar error:

[Sun Apr 15 22:30:15 2007] [error] [client xxx.xxx.xxx.xxx] Premature end of script headers: /dh/cgi-system/php.cgi
[Sun Apr 15 22:30:15 2007] [error] [client xxx.xxx.xxx.xxx] File does not exist: /home/krunk4ever/krunk4ever.com/internal_error.html

Oh well, guess I can only wait for them to fix the problems.


Update

So DreamHost got back to me:

It appears some scripts on your site are being killed by our process watcher program. This keeps the CPU/Memory load balanced for all users on the server. Unfortunately, while we can’t change the settings on that, there are ways to reduce the CPU and Memory footprint of your site. One is to make sure you’ve disabled hotlinking of your images. More often, the culprit is robot “crawlers”, such as googlebot, which like to get caught in loops on some sites, causing the load to jump on the server.

You might find the following articles in our wiki useful in helping you reduce the load your sites put on the server:

Finding Causes of Heavy Usage

CPU Resources FAQ

and

Bots spiders and crawlers

Please feel free to let me know if you have any other questions.

I’m note exactly sure what changed and I’ve already enabled caching for WordPress and full acceleration on Gallery. Hotlinking has already been disabled a long time ago. I went ahead and followed one of the suggestions of delaying crawlers by added a robots.txt:

User-agent: *
Crawl-Delay: 60
Disallow:

However, the wiki does state that Note: this is relatively worthless as it has been confirmed that Googlebot ignores it

We’ll see if it gets any better.