Archive for March, 2007

YouTube via VLC!

Update, SitRep @ 2012-02-05

Sorry, I haven’t touched this script in ages, in any case, it hasn’t worked for a long time, and I don’t have time to fix it. Sorry about that. Maybe some other JavaScript expert can take a look at the code?

Note: This post has been superseded with a newer one. All updates will now be put at the bottom of this page :)

I stumbled upon Mike Sheldon’s GreaseMonkey script that allows people to watch YouTube videos without Flash, and was excited when I found out it also works on Windows. It’s not supposed to, because it depends on mplayerplug-in, which is only available for Linux, but VLC’s multimedia plugin took care of that problem and played it for me on my Windows system!

So now I can watch YouTube videos with 30fps, and even go full-screen, with no stuttering. You might not have these problems, but because I have a 1 GHz-PC I do (it’s a sorry state of affairs when software can’t play video smoothly on a GHz-PC). This is because VLC also uses hardware overlay to display the video, rather than the slow-ass, boo lame, software rendering method that the Flash player uses.

The only problem is, there are no controls to play/pause or change the volume. Apparently it can all be done via JavaScript. I really liked the smooth video, so I decided to extend the GreaseMonkey script and build those features in.

And so it’s born, my first GreaseMonkey script!

To use, install VLC (Update 2009-01-11: version 0.9.8a, Update 2009-08-10: version 1.0.1 did not work for me, unfortunately, must look into it) and GreaseMonkey, and then download:

vlcflvplayer.user.js

There are some drawbacks to this solution though; you have to wait for the whole video to load before viewing it (so much for the concept of streaming), and seeking works unreliably in my experience.

But hey, smooth video wins it for me! Enjoy!

And, in anticipation that this script will be popular, allow me to advertise about my upcoming trip.

Because this is the most googled page of my blog, allow me to advertise my iPhone app: Got an iPhone? Need a cool world clock? Get nHands Clock!

Here’s a demo of the script so you can see the effects of the script without installing it nor GreaseMonkey. Or not really, considering YouTube likes to change its video URLs so all you get is “this video is no longer valid”.

Here’s a demo of the script so you can see the effects of the script without installing it nor GreaseMonkey. Or not really, considering YouTube likes to change its video URLs so all you get is “this video is no longer valid”.
Update 2009-01-11: Well, I updated VLC to 0.9.6, and either the plugin or my script didn’t work. It worked again with 0.9.8a, although with broken controls because they changed the API. So now I fixed the API-calls in my script. I also updated the size to adjust to YouTube’s new widescreen format.

Update 2009-02-06: Well, this has become my most-visited post, as well as the #1 result in Google for “vlc youtube” (we’re number one, we’re number one!). If you gave the script a try, please leave a comment below to tell me what you think, did it work, what do you think can be improved, etc.

Update 2009-05-30: After a long wait, I’ve finally updated the script, adding the HQ button, as well as making the disk icon (hmm, I wonder what it does…) link to the HQ/HD format when they’re playing.

Update 2009-06-01: Crap, the last update didn’t really work as expected, great job testing it! (It was never possible to get the HD link to show up). It should work now.

Multiple Firefox Profiles

Elvy said

so much love to gina for the great post,
and thanks to louis for the pointer. ^_^

No problem, Elvy gets credit for making me remember that multiple Firefox profiles is possible. I actually have the same problem and without her complaining I wouldn’t have recalled this possibility.

I just tried it now, but because I still have FFox 1.5, I have to use this bit of Windows Scripting hack (stolen from here):

var shell = WScript.CreateObject("WScript.Shell");
var env = shell.Environment("User");
env("MOZ_NO_REMOTE") = 1;
shell.Exec('C:\\\\Program Files\\\\Mozilla Firefox 1.5\\\\firefox.exe -P "Profile 2"');
env("MOZ_NO_REMOTE") = 0;

You need to first start Firefox with “Firefox.exe -P” so you see the Profile Manager, create a new profile (mine is called “Profile 2″), modify the above code to make sure the directory and profile name on the fourth line are correct and save it as a .js file. Double clicking the JS file should execute it using Windows Scripting Host, or if you hate the icon, make a shortcut with Fox’s icon and this command:

C:\\Windows\\system32\\wscript.exe "C:\\wherever\\you\\put\\your\\jsfile.js"

And to make sure you don’t get lost and confused, you can set a different theme for each profile!

Swearing Helps…

Anyway, here’s one for the Googlers out there.

If, while trying to install mod_python into Apache in Windows, you get an error like this:

Syntax error on line 173 of C:/Program Files/Apache Group/Apache2/conf/httpd.conf:
Cannot load C:/Program Files/Apache Group/Apache2/modules/mod_python.so into server: The specified module could not be found.

, here’s how to fix it:

Include the python directory into your PATH environment variable
(set PATH=%PATH%;C:\Python24 or something similar to that), and then try again.

The “fucking hell, so simple and it took me so long!” some people heard from my room was proof that the solution worked for me.

The error is incorrect, anyway, it’s supposed to say something more in the lines of “the module failed to load.”. If it still doesn’t work, make sure you’re using the module for the correct versions of Apache and Python.

In Which I Multimedially Insult A Stranger…

After googling for a faster way to download YouTube videos and finding vixy.net, I stumbled upon this video. It’s an instruction some random guy made on how to use the site, narrated by a geeky voice.

Come on! You can describe the site (vixy.net) in half a sentence! (“Go to vixy.net, follow the instructions there.”) Why do you feel the need to make a video tutorial of the process? Your dweeby voice doesn’t help either, and did you really have to list all those video formats? One thing I learned in public speaking, don’t start listing things, it just drives your audience to sleep.

Looking at his list of videos, that video is apparently not the only tutorial he’s made, there are many more. And from the looks of it, they’re all just screencasts of him doing something on his Mac.

And what’s this “Producer Rewards” you see there? Ah… apparently they pay you if you make an interesting video clip. Aha, so I guess that’s his motive: making money. Sorry kid, but you have to be a lot better than what I saw in that one clip if you’re thinking of making a profit. Besides, why waste bandwidth on video and the dweeby voice if you can do it more efficiently using just plain text? The inefficiency drives me nuts.

But if you prefer video, here’s what I think of this guy, and many others like him.


(hey my first YouTube video. But then I decided that having Flash in my blog is kinda lame…)

Britney Spears’ New Role

Britney Spears is back!
Britney Spears Look-alike in “Skyland”
It’s from an anime animated series, called ‘Skyland’. The resemblance is…

No News

I wonder how many blogs there are out there which are dead. Or was born, got 3 entries posted in it (“Hello world!”, “First post!”, “Well today I…”) and then got abandoned. Some people just don’t have anything to say, I guess. I’d be a prime example of such a person. But anyway, here I am, creating a paradox.

Most blogs have a topic (e.g. cars, efficiency tips, cool things) and so they get updated with fresh (though lately also stale, repeated) content. Competing would be kind of useless, you’d end up with duplicated content sooner or later. Especially since the aforementioned (fancy word huh?) blogs are more or less professionally run.

So what can you blog about? Well, personal things. But in order for that to happen, you need to have an interesting life. Ha, well count me out. I guess I’m too busy to have one. Or I’m just too busy to notice that I have one.

Ah, sucks. One day I’ll be an old man and I’ll wonder what the hell I wasted my youth on. Reading Fark.com?

Anyway, my life consists of work, surfing the net, and finding ways to avoid doing my term project. And lately, fantasizing about going to Norway. The certainty of that undertaking flows up and down.

Also, I’ve been lusting for a new digicam, the PowerShot A710IS Canon PowerShot A710IS [Ha, a Snap preview thingy would've been useful here, to show what the camera looks like]. Amazon.de remembers everything, which has a bad effect that this camera stares me in the face whenever I visit the site.

“You recently looked at this camera!”

“I know!”

Chaos

My Messy Desk
According to the New York Times, it’s okay to be messy.

A Simple Linux Bandwidth Meter Using sed

Well, I was bored yesterday and I came up with this:

getdata() {
    DATA=`ifconfig eth0|sed -n 's/\( *RX bytes:\)\([0-9]*\)\([^:]*\):\([0-9]*\)\(.*)\)/\2 \4/p'`
    RX=`echo $DATA|sed -n 's/\([0-9]*\) \(.*\)/\1/p'`
    TX=`echo $DATA|sed -n 's/\([^ ]*\) \(.*\)/\2/p'`
}
getdata
while true; do
    OLDRX=$RX
    OLDTX=$TX
    getdata
    echo -n -e "\fRX: $((RX-OLDRX)) B/s\nTX: $((TX-OLDTX)) B/s"
    sleep 1
done

What it does is call ifconfig eth0 every second, and compare the total number of bytes received and transmitted up to the previous second, with the number up to this second. The difference is, well, the number of bytes transferred this second. It’s a cheap network usage monitor. :)



Follow

Get every new post delivered to your Inbox.