Thursday, July 23, 2009

Taking Out The Trash Operating System

It is finally time to talk about one of the most hated design decisions (among many worthy candidates) of the Unix (and friends) operating system: irrevocable file deletion. You see, when you delete a file using, say, the rm command, it decides to simply delete all references to the file from the filesystem and mark the space as free. This means that, as far as Unix is concerned, the file is gone forever!

Modern operating systems, such as Tenex, have included a 'garbage can', so when you 'delete' a file, it goes into the garbage can, so if you accidentally deleted a file you need, you can go in there and get it back. Files are only permanently deleted if the user explicitly 'empties' the garbage can or the system needs more memory (at least this is how it works on Windows).

In a (mostly futile) attempt to be more user friendly, the GNOME and KDE devs looked at the trashcans every OTHER operating system used and decided to come up with their own half-assed implementation. Eventually, in an amazing display of cooperation, they even decided to standardize on the same directory, and people say Linux devs can't cooperate! Of course, since this functionality is not built-in to the operating system but is instead a matchsticks-and-glue implementation that rides on the Desktop environment, it has some problems.

First, it only works with programs that explicitly support it. Programs like rm or any GUI tool that is just a wrapper over shell tools (i.e. most of them) will still delete the files as usual. So, sometimes you can retrieve your important file, and sometimes you can't.

Second, since the trashcan is just a regular directory, it can quickly fill up, and if the user does not manually empty it regularly, the hard drive fills up as well. Just like an extremely lazy person, Linux doesn't take out the trash even if the whole house is filled with shit!

While writing my last article, I came upon an error when I quit Avidemux; it read something like "Unable to create Avidemux log. Filesystem is full." Leaving aside the fact that it was creating a log while it was exiting, this was worrisome. Well, I had been copying a lot of stuff onto the hard drive a few days ago, but I had deleted most of it. I then decided to open my garbage can and empty the trash. Lo and behold, 3 GBs of space opened up instantly!

Well, class, what have we learned today? First, not having a two-step deletion process can cause tens of millions of dollars of damage. Second, not integrating the trashcan leaves the user unsure if he can recover his files if he accidentally deletes them. Third, not monitoring the pseudo-trashcan means one can run out of space very quickly.

Class dismissed!

Wednesday, July 22, 2009

Lights! Camera! No Action!

I am sorry about the lack of posts. Linux just has not interested me in a while. Anyway, today we will take a wonderful look at the world of video editing under Linux. Now, Linux's suckiness when it comes to video-editing is well known, but I am not talking about professional video editing. Today, I am going to look at how Linux handles a very basic feature.

Here's the deal. I have a bunch of porn videos. I want to trim out the crap to leave only the good stuff. The usual way to do this is to split the video into a bunch of clips and then assemble the good clips into a movie. This is easy with Movie Maker, and it is slightly less easy with iMovie. Now let's try it on Linux...

NOTE: I am using Ubuntu 8.04 x86-64 LTS for this comparison, since it is the Linux system I have installed. All the packages come from the Ubuntu repositories. I tried to use every video editor I could find in the Add/Remove section.

The main contenders are the following.

  1. Avidemux

  2. Kino

  3. Kdenlive

  4. Open Movie Editor

  5. Pitivi Video Editor

Let's see how each stacks up.

NOTE: If you want to follow along, you can find the video I am using here. For those with the IQs of lusers, the site is definitely NSFW! The link is down.

FURTHER NOTE: GIMP, being the wonderful program that it is, decided it needed some screen time in some of my images. I am too lazy to redo them, so you will just have to cope. Ah, the wonders of Open Source!

EVEN FURTHER NOTE: Anyone who complains about the movie being WMV can feel free to go back to and pretend the rest of the world uses Ogg Theora.


Alright, let's fire it up!

Okay, this looks decent enough. Let's click "Open" and select "Chrissy.wmv".

Well, this one actually works! Sorta....

Now, since it plays the video properly, it should be able to copy it properly too. Let's just select a portion of the video with the A & B icons. It is actually quite user-friendly. Let's just leave the Video and Audio options as "Copy". It should now create a new WMV file (I named mine chrissy2.wmv). Now, let's open it!

Well, it looks great, but there is no sound! Well, I don't really want to fuck around with audio options, so let's continue on.


Kino looks like it is a great, simple video editor .... for camcorders!! However, since we are desperate, we might as well try it.

Let's click "File->Open" shall we?

Well that's no good! Still, we might as well try to import it. Who knows? It might work!

Since PAL is for Eurofags, I will choose NTSC. You choose whatever you like.

Oh gosh! It failed! Who woulda thunk?!


There is no way in hell I am bringing down all the KDE dependencies for a stupid video editor!

Open Movie Editor

As usual, let's fire it up.

You figure it out!

Alright, drag the Chrissy.wmv onto the Video and Audio tracks. Select a clip. Then click on Project->Render.

Choose to render it as a Quicktime file (the only option, of course). Then click Encode. After several minutes it should give you this.

If you are not following along, you can simulate the image by rocking your head back and forth really fast. It seems to have recorded two frames and looped them for several seconds. At least, the audio is working!

Pitivi Video Editor

Last but (barely) not least, we come to the Pitivi Video Editor. Let's fire it up!

Cool! We can just drag Chrissy.wmv onto the Clips window! Drag & Drop is so awesome .... for 1995!

Well, it seems to support the file, but now what? Apparently, the Pitivi developers care very much about the GNOME Interface Guidelines, and they have been reading up on how to write a GNOME application. Pitivi is so simple (READ: stupid) that it can only supports merging clips into one video and not splitting a video into clips! This would have been useful for the second phase of the operation, but it is useless without the first!


Let's summarize. Ubuntu, the most popular Linux distribution among 'ordinary' (i.e. not super-freetarded) users, features several video editors, none of which can make an acceptable movie clip! I am not trying to splice special effects into my Hollywood film reel here! I am just trying to cut out the boring parts of pornos! All I really needed was an editor suitable for editing home movies, and Linux cannot even provide that!

What else is new?