2011
01.19

Yay, I completely missed that OpenOffice.org finally supports OpenType fonts… Only basic support though, all the real OpenType candy isn’t properly supported yet. It’ll probably take another ice age to pass before OpenOffice.org will properly support OpenType.

However without Sun or Oracle holding it back LibreOffice may stand a better chance of staying up to speed on current technology.

2011
01.13

Encoding Theora using ffmpeg

So, there is ffmpeg2theora which you want use to easily encode to Ogg/Theora/Vorbis, however you can use plain ffmpeg too which offers a bit more flexibility in some ways. For example you can embed Theora and Vorbis into a Matroska container, which should have an index, which could make seeking easier (in theory).

So for an example, the following commandline encode a source video file, into a DVD quality (720×576 anamorphic widescreen resolution), using a “Long” GOP of 15 which again should make seeking more efficient, although it will increase filesize):

# ffmpeg -i input.mp4 -s 720x576 -aspect 16:9 \
         -vcodec libtheora -g 15 -qscale 8 \
         -acodec libvorbis -ac 2 -aq 6 \
         -sn output.mkv

It’s just an example you can customize to hearts desire.

2010
12.31

Sometimes some tools have issues dealing with some multimedia containers. Multimedia (audio &  video) containers are reasonably complex matter (Monty will fill you in), and sometimes stuff breaks, as recently with GStreamer and MPEG 2 Transport streams (which are produced by AVCHD camcorders).

However a workaround is relatively easy if you’re not too afraid of the Linux commandline. Since you can use ffmpeg to remux the original video and audio losslessly into a new container (for example Matroska). The following commandline remuxes all files with an MTS extension in the current directory into new similarly named Matroska files:

# for FILENAME in *.MTS; do ffmpeg -i ${FILENAME} \
                    -vcodec copy -acodec copy -sn \
       `echo ${FILENAME} | sed 's/MTS/mkv/g'`; done

It’s fairly easy to modify the above commandline to remux anything into anything else (at least to a certain extent, not all container formats can accommodate all codecs, but Matroska pretty much can). Just replace all occurences of MTS (and possibly mkv). Good luck.

2010
12.12

Pushing half a T

Since my previous post, I’ve pushed half a terabyte of traffic from my own webserver, and page hits this week are already 3000+ as apposed to the usual 1000+. Yay for statistics…

2010
12.06

As some of you may or may not have noticed a new version of Darktable got released two weeks ago. And in the meanwhile I’ve been working on a set of somewhat shorter screencasts which should have good coverage of most features of Darktable and related topics.

So just in time for Sinterklaas I present to you, the Darktable 0.7 Screencast Library. I managed to improve the audio quality, though I sometimes make some silly mistakes. I call lighttable mode, lightroom mode here and there, and I seem to confuse left and right sometimes.

Darktable Installation On Ubuntu (download)

Darktable Lighttable Basics (download)

Darktable Tagging & Collect Plugins (download)

Darktable Darkroom Basics (download)

Darktable Darkroom Black & White Plugins (download)

Darktable Darkroom GND Plugin (download)

Darktable Darkroom Colorzones Plugin (download)

Darktable Darkroom Watermark Plugin (download)

Darktable Working With Styles (download)

Darktable Capture Basics (download)

The above videos have been recorded at 1280×800, so they’re best viewed fullscreen. If you’re using Firefox to view the videos you can just right-click and choose “Full Screen”.

2010
10.31

Changing GDM Wallpaper

As far as I know there is currently no way to change the wallpaper of the logon manager (GDM) via a nice graphical tool on Ubuntu 10.04 or 10.10, so we need to get busy with some commandline tools.

First we copy an image we downloaded to our system backgrounds folder:

# sudo mv Aurora_by_Alexandre_Garbugli.jpg /usr/share/backgrounds

Then we edit the GConf settings for the gdm user, which is where GDM gets it’s settings from:

# sudo -u gdm gconftool-2 --type string \
    --set /desktop/gnome/background/picture_filename \
    /usr/share/backgrounds/Aurora_by_Alexandre_Garbugli.jpg

Now logout, and enjoy the new logon wallpaper.

2010
10.23

And Suddenly It Hits Me…

I’ve been doing Linux for a while now, though initially I stuck with my Windows 2000/XP desktop. I actually started out with Slackware 8 (if I recall correctly), I chose Slackware because I read that’s what all the 1337 people used, heh, did I setup myself for failure, having no linux/unix experience at all… So at some point I gave up, and went back to Windows. I didn’t completely gave up though, a couple of month’s later I tried Mandrake 8.1, which was more of succes, but I never really used that as a desktop. Eventually I ended up with RedHat 7.3 (Valhalla) which I actually used (near full time) on my desktop for a month or two, getting back to Windows again, since I was a bit of a gamer back then. After that I was pretty much done with Linux on the desktop, but still loved the thought… In the meanwhile I started playing with Debian (Woody), which I regularly used for running some gameservers on for LAN parties (did I mention I was a gamer back then)…

A year or two went past, and then it happened… the Ubuntu desktop… and best of all it was Debian based using GNOME (my already preferred desktop) by default. Their initial release (4.10) was very promising but quite, well,… Warty… Another couple of month’s passed and Hoary (5.04) was released, I really jumped on the desktop Linux bandwagon. I definitively removed Windows from my desktop some month’s later… And then it hits me, I’ve been effectively using Ubuntu on my desktop for the past five years… Time flies when you’re having fun…

2010
10.17

Encoding WebM using ffmpeg

Since a new batch of distributions got released like Ubuntu Maverick Meerkat, ffmpeg 0.6 has made it into the mainstream, allowing easy encoding of WebM.

If you’d like to encode your own high quality WebM movies, you can do it like so, first make sure you have a libvpx_720p ffmpeg preset, check if /usr/share/ffmpeg/libvpx-720p.ffpreset exists, if not create it and put the following content in it:

  vcodec=libvpx
  g=120
  rc_lookahead=16
  level=216
  profile=0
  qmax=42
  qmin=10
  vb=2M
  #ignored unless using -pass 2
  maxrate=24M
  minrate=100k

Then you can use the following commandlines to encode your movie (using two-pass mode):

# ffmpeg -i input.mp4 -s 1280x720 -vpre libvpx-720p -b 3900k -pass 1 \
         -an -f webm -y output.webm
# ffmpeg -i input.mp4 -s 1280x720 -vpre libvpx-720p -b 3900k -pass 2 \
         -acodec libvorbis -ab 100k -f webm -y output.webm

Using a video bitrate of 3900kbit produces very high quality for a resolution of 1280×720. When encoding a resolution of 960×540 a video bitrate of 2000kbit produces similar high quality.

2010
10.03

Photo Printing Preprocessing

Most linux applications don’t support preprocessing images for print output, and there are a few things that need to be done to get good quality prints. In this article I’ll be focussing on Darktable. So make sure you sharpen your image in Darktable to the point where the pixels are crisp when you zoom to 1:1, don’t oversharpen at this point. Then export your photo to a 16 bit TIFF in Adobe RGB color space if you have a printer profile (if not an 8 bit TIFF in sRGB color space will be fine).

Then we need to compensate for possible bleeding of the inks on paper, so a tad of oversharpening is in order, ImageMagick to the rescue. First we resample the image to 300 DPI, sharpen the image using an unsharp mask and add a small black border followed by adding a larger white border:

# convert -filter cubic -density 300 -resize 2049x3075 -unsharp 4x2+0.8+0.1 \
        -bordercolor black -border 18x18 -bordercolor white -border 198x198 \
                         PMJ_20101003_1234.tiff TEMP_PMJ_20101003_1234.tiff
Next we convert our 16 bit AdobeRGB TIFF to an 8 bit TIFF in the native printer output space using a relative colorimetric rendering intent (which works best for me):
# tifficc -o /home/pmjdebruijn/.color/icc/hema_matt_coated_photo_paper.icc \
    -t 1 -c 2 -q -b TEMP_PMJ_20101003_1234.tiff PRINT_PMJ_20101003_1234.tiff

Do note, that most (if not all) printer output color space are lookup table based, which means that if precalculated perceptual tables are present, they have been mapping against a working color space when the profile was generated, most often sRGB or AdobeRGB, in any case be careful when using the perceptual rendering intent that the input file’s working color space is the same as the perceptual tables have been precalculated for.

2010
10.01

hpcups

As most of you probably already know, HP is probably the only manufacturer that releases fully open source printer drivers (called hplip/hpijs), which made their way into most Linux distributions a long time ago. The end result is that pretty much any HP printer works out of the box with any recent Linux distribution. Yay!

That said, I have been annoyed at hplip at times, one of my long running pet-peeves is that it seems to have always lacked a way to force the printer to use only the black cartridge for greyscale images. Without forcing this, most inkjets use small amounts  of the colored inks to smooth gradients etc. The problem with this is that you end up with a subtle (but usually noticeable) color cast. When one wants an inkjet printer to do greyscale using only the black cartridge you rid yourself of that color cast, but you trade in smoothness, so it’s likely that dithering may be more prominently visible.

But like I said, it seems the default hplip drivers don’t seem to allow this, now enter the hplip-cups package where (in contrast to plain hplip package where settings for resolution, ink tank usage, etc are tied into static presets) you can set all your printing options independently, like output mode, media type, print quality. There are some incompatible combinations, and you’ll be visually warned about them.