Activating HW acceleration for embedded YouTube videos

Ever since Google Chrome became terribly slow in gmail, drive, etc regardless of computer or platform, I’ve picked up Mozilla Firefox again. The switch didn’t go painless but I really was tired of typing a whole sentence before Chrome would display it. This problem produces itself not only on google sites but actually in about any text box I would type, be it intermittently.

The main issue with switching to Firefox was stuttering video playback. As you may know, chrome bundles its own flash plugin which is actually the same plugin but tweaked to work optimally with chrome (pepper api). At the same time google controls distribution/patching.Β  So, if google can tweak the plugin for good performance, why can’t we? πŸ˜‰

First thing I discovered, is that somehow flash hardware acceleration was disabled. You can enable this by right-clicking on any flash video and click on “settings”. In the “Display” tab, you can check “Enable Hardware Acceleration”.

flash enable HW acceleration settingSmooth youtube vids FTW! Fullscreen video’s also showed up on the correct monitor now (dual head setup). My joy was only for limited time, as I discovered hardware acceleration dit not work for embedded youtube video’s. I was happy nevertheless as the bulk of video’s I watch are on youtube.

However, today, watching the Jolla Tablet intro movie embedded on the site, I could not help feeling the itch again. Why oh why did this play fluently in chrome but did it suck so hard in firefox? Check out this framerate:

yt_embedded_noHWaccel1I started by creating a virgin system account to avoid having my 7 year old home dir, possibly dragging along some evil deprecated setting, be the culprit. This didn’t change anything but at least I had both a blank Firefox and Chrome profile to test with.

First I was under the impression that there would have to be a global flash settings file since when right-clicking on the embedded video, it showed the “Settings” as disabled. There does indeed exist such file: /etc/adobe/mms.cfg in which you can put “EnableLinuxHWVideoDecode=1”. This only crashed my firefox. I did install an additional vdpau package but it didn’t matter. Also, looking at the “Nerd stats” (right-click on video), I learned even youtube vids didn’t have hardware accelerated decoding, only accelerated rendering. So I didn’t proceed on this path.

Now let’s check out how chrome is doing it. Pulling up the “Nerd stats” did surprise me: chrome does not use flash by default for embedded video’s, it uses WebM/VP9!

This begs the question: how is Firefox’s WebM support? Turns out it’s no problem, just change your youtube html5 setting from “default player” (=flash) to “html5”.

youtube html5 settingsSo theΒ  chrome pepper flash tweak actually came down on not using flash. πŸ™‚ Youtube does this by default on chrome but not on firefox. Naughty Google!

You may notice that Firefox does not support all youtube hmtl5 features yet. In particular, you will be served VP8 video’s instead of VP9 which may make a difference in the available resolutions. However, Media Source Extensions and WebM VP9 can already be activated by setting:

media.mediasource.enabled = true

in about:config. Experimental h264 support can be activated with:

media.mediasource.ignore_codecs = true

You can track the MSE support in firefox in this bug report.

Itch scratched and fixed. Finally πŸ™‚

Convert PDF to image files

Another entry in my PDF series. πŸ™‚

At work I had to convert a few PDFs into jpeg files. The PDF files actually contain just images, so extracting the images would’ve been as good, but converting PDF pages to images is easier. πŸ™‚ At least on windows. On linux you could use pdfimages, which should be available for your distro through some poppler util package.

A general approach is to use the versatile ImageMagick software. Using the convert command, it’s simply a matter of:

convert -density 200x200 -quality 85% inputfile.pdf outputfile%03d.jpg

to convert inputfile.pdf to a set of jpeg files. Of course you can choose any supported output format you like: png/bmp/gif/etc.. The density option is important as it specifies the output dpi which is only 72 by default. Imagemagick uses Ghostscript to do the pdf reading, so on windows you have to make sure that environment is set up correctly. In my case I had to add its bin directory to the path and set the working dir to the lib path as it didn’t find gs_init.ps otherwise (adding to the path didn’t help). If you know a better way, please let me know in the comments. I also specified the quality option to have a jpeg quality factor of 85, which is 75 by default.

Since I had to process a batch of them, I thought it would be nice to have a cool batch script to do them automatically. Here is what I came up with:

C:
set path=%path%;C:\programs\gs\gs8.54\bin
cd C:\programs\gs\gs8.54\lib
for %%C in (%*) do call :startconvert %%C
goto :eof

:startconvert
convert -density 200x200 -quality 85%% %1 %~dp1%~n1%%03d.jpg
goto :eof

Replace the paths as appropiate. To use the bat file, simply drag and drop one or more pdf file on the bat file. It will put jpeg files in the same directory as the pdf file and number them using 3 digits (%03d printf format). %~dp1 stands for the full path of the 1st argument file, %~n1 for the name only (without extension). Also note you have to escape all other %’s.

iTunes on linux

Read the update below!

I hate to admit it: today I created an iTunes store account. In my defense, I felt forced, as the CD I wanted to buy was only available as a physical CD and not in digital download form. It will probably become available in digital form in a year or so, but who wants to buy a 2010 compilation CD in 2012? πŸ˜‰ And who wants a jewel case CD which you have to rip anyway to have any use of it (besides gathering dust).

So today, once again, I gave installing iTunes on linux another try. I followed the google #1 guide which suggested to install an old version (7.2). Unfortunately, when you go to the store, it says it can’t connect or that the service is temporarily down or something. So I thought, wine updates every 5 breaths, I wouldn’t be surprised if it actually runs the latest version. Store connection works indeed in iTunes 10! I created a login from within iTunes, made a test purchase, and yes, we have lift off. πŸ™‚ I can see how iTunes is such a success. Just type in the search box, click and a few seconds later you have a high quality drm free mp4/AAC on your harddrive. Very tempting indeed. And the excellent recommendation system only encourages too of course.
A guide for converting to mp3 (or wave) from within iTunes can be found here. I don’t need that on the desktop, .m4a plays back fine, but my car lofi radio only plays mp3/wma.

I’m still a bit confused as to why the CD is only downloadable from iTunes and not form the publisher’s webshop. I guess they have an exclusive deal with Apple to only release the downloads after some time..

Update: The next morning I arrived at work and installed iTunes to download my newly purchased album. Surprise, surprise! iTunes does not allow one to redownload a purchased song!! It’s insanely unbelievable in this time and age, but yes, it is impossible right now. I guess most people don’t know any other way, but for a lot of gamers who use steam, it is the most ordinary thing to do.

Time Machine for Linux: Back In Time

Recently, I watched a vid about Apple’s Time Machine and was quite impressed. For the first time in ages, I was considering to try out MacosX, after all, you have to give them credit: they just keep innovating as no other computer company. The plan was quickly abandoned though, when I discovered it wouldn’t run on my newly bought AMD monster-machine (post about that in queue ;)).

Anyhow, I searched some alternatives and somehow nothing as user-friendly showed up.. Until today I stumbled upon the solution by accident while I was checking out LinuxJournal’s tech tips! Quite interesting/entertaining stuff there btw. πŸ™‚ I’m talking about about Back In Time and considering the Ubuntu dev, it even has a KDE4 gui, yay! πŸ™‚

Check out the LJ screencast and the LifeHacker article.

Opera 10 send mail problem

I just discovered I had a mail in my outbox I sent last week. It turned out one of my email accounts was not properly migrated from Opera 9.
I ran Wireshark and it seemed Opera was sending a wrong parameter with the EHLO command (which queries an ESMTP server for its capabilities). It sent EHLO smtpserver instead of EHLO myhostname. Of course the server replied this could not be the case since he was that host himself. =)
So I grepped the accounts.ini file to see where that information could come from. It turned out there was a fqdn property present containing the smtp server name which was not present anymore in a newly created account (yet it seemed to attach some value to it, apparently). So I simply deleted the fqdn property and all was solved. πŸ™‚
Keep in mind, I am upgrading the same opera profile since Opera 7 so I guess my particular upgrade scenario has received less attention. πŸ˜‰

drop dropbox

For some time now, I’ve been evaluating dropbox. From time to time, I need to be able to store a file and have it available at another location in a synced fashion. First some history.
Before Dropbox, I was (ab)using gmail through the firefox gspace plugin, but, 1) you need firefox 2) you pollute your mail space 3) it’s buggy and bloated 4) but still doesn’t have all features I want. The reason I chose gspace back in the day, was because it was presumably cross platform through use of the firefox platform. That turned out to become limited functionality and eventually useless at all (may be fixed by now). It had also issues with having your gmail open in a tab at the same time. So I looked for an alternative and dropbox seemed promising.

My requirements for a ‘online storage’ solution are:

  • cross platform native clients: to allow sharing between work and home computers.
  • web interface: when you’re in the wild at someone else’s computer where you don’t want to install a client.
  • corporate-proof: can operate from behind different types of proxies.
  • server-side backup: when you accidentally overwrite a file from another location, or when syncing fails to do the right thing.

My nice-to-have’s are:

  • revision history: same as server-side backup but extended to multiple backups.
  • desktop integration: status overlay (aka tortoise stuff), context menu to perform web actions, for example, revert to some revision, make public, …
  • exclusion filters: handy when you don’t want your lock or temp files (due to editing) to be uselessly synced all the time.

Dropbox seemed to fulfill all my wishes except exclusion filters. Until recently. πŸ™‚ At work, when I resume after suspend, the client doesn’t automatically sync back to the server (this can also be a proxy issue here at work, but it doesn’t work anymore and there’s nothing I can do about it, i.e. it’s closed source). But there are other things that bug me: 1) explorer integration is slow but not optional. So you have to live with it. 2) The (windows) client feels sluggish and quite heavy to load. 3) Linux client always lags behind and the desktop integration is only for gnome. Linux users had to wait long for a release, but even now, they are not treated very well. Then of course, there is the whole discussion of dropbox being closed source but the front-end part being open source, confusing people all around. πŸ™‚ They give the impression they care about the linux users and open source, but in reality, they can’t make it true. In fact, I have no problem using a closed client, but it has to work very well then. πŸ˜‰
Dropbox has free and paid accounts. The free accounts are limited to 2GB storage and only 30 days history. No problem for me.
So up until recently, I was quite happy with dropbox, but since the windows client fails to reconnect after resume and the linux fails to start, I guess I’m counting its last days. πŸ™‚

If anyone knows a decent cross-platform alternative, please let me know.

But it did raise that thought again in my head: why not try to start an open source online storage sharing solution? Is it so hard? Why does it not exist yet? Of course, I’m not targetting a system which can take loads and loads of people uploading their latest torrents to share with the rest of the family *rolling eyes* πŸ˜‰ But simply, you know, some system that can handle a few accounts (or even just private) which you can install on your own server and offers basic syncing functionality with some better-than-dumb compression/file-diffing mechanism. Personally, I also wouldn’t need fancy public web sharing like photogalleries and the like, so…

Maybe I’m missing something? πŸ™‚