Ubuntu Linux: Subtitles, Video Editing and DVD Authoring

Translating movie subtitles is my new hobby. I had no previous knowledge of what subtitles are, how they are embedded in a DVD movie, how to rip them off, how to create new subtitles, and then finally how to prepare a DVD with translated subtitles that could be played on most popular software, hardware and standalone DVD players. I found out that it was not an easy job to embed UTF-8 encoded text on DVD as a separate subtitle stream. So I decided to hardsub my movie, which means that users will not have the option to turn off the Urdu subtitles.



First I needed to rip the DVD to my hard disk and there are some very good tools available for Ubuntu Linux that work great. (Warning: As always, check the relevant copyright laws for your country regarding the backup of DVDs). I used dvd::rip which rips and transcodes the files into avi format. It also provides the option to rip the subtitles separately, but since most DVD movies has subtitles embedded in streams with Pictures it was basically useless for me. However there are other tools that rip the subtitles and also help you save them as text using OCR.

There are many tools available for Ubuntu/Linux to create or translate subtitles in many different formats. I needed to figure out a Subtitle format that supports utf-8. Then I needed to find a software that allows me to embed the subtitles on the Video without any significant quality loss. After trying Subtitle Editor, Gnome Subtitles, Gaupol and Ksubtitle; I finally settled on Subtitle Editor. I had lots of trouble to use the preview features but some how I worked my out. I started working on subtitles and was very disappointed to find out that the preview didn’t display Urdu characters perfectly. Even though the subtitle format I was using had formatting and stylizing support too.

I decided to work on my subtitles without previewing them but even then I need to know if I have the tools available that would demux my subtitles on the video. Luckily we have a very nice dvdauthor tool available. It comes with a tool called Spumux. I generated a movie with my sample translated subtitles and the results were very bad. The quality of video was outstanding but Spumux didn’t displayed Urdu Characters correctly. May be, it was all my fault, may be I forgot something. But even after hours of checking through subtitles, xml file (required to use with spumux to tell it about the job) and creating many clips; I wasn’t able to get my text right.

I was disappointed and had to log on to Windows XP to see if there are any open source software for windows that do what I wanted to do. While there, I opened Windows Movie Maker, playing little with it I realized that I can add Subtitles with Windows Movie Maker. Windows Movie Maker not only did the subtitles but it also displayed them beautifully on the screen. I saved the clip and it was brilliant. But then it occured to me that if Windows Movie Maker can do this then there must be some alternate to it for Ubuntu Linux.

So lets see what we got in Linux to do the job. For video editing I tried Kino, Cinelera, and LiVES. To be very honest, it was a really very frustrating experience for me to figure out how these tools work. Kino is probably the most user friendly of all three but still Kino is a difficult thing to learn and you definitely can not work with it if you are working on an entire movie. It is good for movies you capture using your mobile phone, cam corder or other such devices. Even if I saved my movies in several small clips, it was difficult to navigate around my storyboard and add subtitles on a precise location. I wouldn’t spend time telling you about how it went with Cinelera or Lives. They both have horrible user interfaces and they are bundled with features that were completely useless for me.

In short I failed to add subtitles to my videos using Ubuntu Linux. I am now doing it on MS Windows XP, using Aegisub
and some other little open source or free applications. Aegisub is available for Linux but I was not able to install it on my Ubuntu 7.10 due to unmatched dependencies. I feel that the options for video editing are not very good for Ubuntu/Linux users. The tools we have are not user-friendly, advanced and there is not much to choose from.

Even if I failed to do my work with these tools but it does not mean that they are useless for every one else too. In fact some of them are quite sophisticated and as it is with most open source applications, they give you a lot more control than proprietary solutions. What we need to do is to concentrate more on improving them. We need to use these software, file bug reports, submit feature requests and help each other using these tools. We need to appreciate all those who are working on these projects (Guys if you are reading this, your tools didn’t help me. But thank you anyways). May be the community should organize some events where we gather around to focus on these tools and improve them.

Excited about KDE 4.0

Just a few days ago the KDE 4.0 was announced. It seems that everyone was already excited about KDE 4.0. People using Kubuntu 7.10 Gutsy can try KDE 4.0. Ubuntu Geek has an explained version of the same intstructions here. Tombuntu has ten tips for KDE 4.0 Beginners and patchshorts writes about 5 Things to hate about KDE 4.0.

I am not trying KDE 4.0 yet, I think it is still in development phase and since I am not an advanced KDE user I might find it difficult to use. Reading about KDE 4 at OpenSuse website and Kubuntu I feel that I might run into problem if I try to install it. DistroWatch weekly scares me further away in the featured story titled “Distributions and KDE 4:

KDE 4 is the start of something amazing and this is possibly the best definition of the current release – it’s here, it’s available, but it’s nowhere near ready for the prime time. It’s a decent start, though. So let’s give the KDE developers a round of applause for the courage to try something new and extraordinary, something that will eventually mature into a stable and reliable desktop environment we can all be proud to use on our computers.

Right now I have Kubuntu 7.10 and I am trying to get familiar with the K environment. I hope that KDE4 will be available with Ubuntu 8.04 Hardy Heron which is a long term support release. It will be much safer and enjoyable to try KDE 4.0 then or may be I should wait till the release of KDE 4.1.

Using Terminal to Shutdown Processes

XFCE does not come with a system monitor utility like the one I had in Gnome. I used the utility to kill unresponsive processes. So how do we kill unresponsive programs using the terminal? To understand how Linux handles processes and how you can control them read this great article by Gary Sim (in plain English). Here is what I learnt from Gary’s article.

We need to know the process id of the program that is not responding. We find out process id or PID by running the command

ps aux

This command displays all running processes. Below are a few of the many running processes on my computer. The list is long so I am only showing you a few to give you an idea.

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
nom 3006 0.0 0.3 2476 772 ? S 23:15 0:00 gnome-pty-helpe
nom 3097 0.0 4.0 16584 10348 ? Ss 23:23 0:01 gksu -u root /u
root 3102 0.0 0.4 3712 1068 pts/1 Ss+ 23:23 0:00 /bin/su root -c
root 3105 0.0 0.2 2256 592 pts/1 S+ 23:23 0:00 /usr/lib/libgks
nom 3321 0.7 3.2 14920 8364 ? Ss 23:44 0:01 mousepad

Now find out which one of them you want to kill. I want to kill the mousepad it has the PID 3321 and I kill it by running this command:

kill 3321

Just incase if this command doesn’t work you can try

kill -9 3321

I am very happy with XFCE. But I need to find out a nice and lite pdf viewer. Evince is great but how could I download evince without downloading so many gnome libs? There is an evince-gtk package in Debian experimental but I can not install it due to dependency issues.

Troubleshooting Volume and Sound Card Configuration in Debian

I had a problem with gnome-volume-control. It didn’t save my volume control settings and displayed a mute sign on every startup.

While trying to solve this issue, I did something (I don’t remember what it was) that totally messed my sound configuration and now gnome-volume-control stopped working at all. Today I solved this problem and thought that I should write it here may be some one would find it useful. Please note that these instructions are written for Gnome. You can use these settings for KDE too but for that you will have to set sound system to use Alsa.

The first step is to make sure that you have following packages installed:

  • alsa-base
  • alsa-source
  • alsa-tools
  • alsa-tools-gui
  • alsa-utils

ALSA is Advanced Linux Sound Architecture. It provides sound drivers and provides audio and MIDI functionality to Linux Operating System. With the above packages installed we are now equipped to move on. Now start the Terminal and run:

# alsaconf

Remember that # sign tells you that the command should be entered with super user privileges.

This command will start a wizard ‘Alsa Configurator’ to assist you configure your ALSA settings. Read and follow the instructions, they are self explanatory and you just need to press the enter button on your keyboard. This script automatically closes gnome-volume-control and a notification appears informing you about that and asking you whether or not you want to reload gnome-volume-control applet. Choose Don’t load or do nothing and press the Reload button when you are done with Alsa Configurator script.

gnome volume iconNow if you pressed the Don’t load button then you will have to start gnome-volume-control. I will tell you only the easiest way. Move your mouse to the panel, right click and select Add to Panel and then add Volume Control applet. Double click the volume icon on your panel and set the sound. Don’t worry we are going to test it later.

Exit volume control and type

# alsactl store

now run

# speaker-test

You hear the sound?

Yes: Thats good now close the terminal to get rid of this annoying noise. You can now set your volume control settings to your desired levels.

No: Try again, reboot your system and they try to play some music or sound files. Sound doesn’t work at all? Then I suggest you read the expert advise. If the expert advise is too difficult for you to follow then you should try Debian IRC chat room for help.

Photo Management Applications

After disliking camera phones and people using camera phones for a long long time, I finally gave up and bought myself one. I am totally in love with my new camera phone. I love it for making things so easier. I can plugin my phone and share pictures and videos with the world. It is time for me to install some nice software to organize these audio, video and image files. Specially I am looking for some tool to organize image files and upload them to Flickr.

Unfortunately there is no plenty of such tools. I only found Picasa and F-spot. Picasa is Google’s proprietary software, I don’t mind using proprietary software but it is too slow, cluttery and doesn’t match with the rest of the environment. I don’t like installing software if they are not available via synaptic. But the lack of good alternates forced me to try Glimmr and Gnickr. Glimmr installed but I can not do anything with it as the program freezes often, doesn’t connect to my flickr account and crashes whenever I try to use anything in the Go menu. I installed the deb package for Gnickr but was unable to launch it for some unknown reasons.

Now my only choice is F-spot ubuntu’s photo management utility with the release of Edgy Eft(ubuntu 6.10). I am using Dapper Drake (ubuntu 6.06 LTS) so I had to install F-spot via synaptic.

The problem I am facing with F-spot is that I would prefer adding tags in a much more easier way. I just want to select an image right click and enter all the tags I want. F-spot also comes with some pre defined categories. May be I will learn how to do these things easily with f-spot after using it for sometime.

Right now I am using Nautilus to manage photos on my hard drive. It is much easier that way. Though I am unable to tag images but I can save them in different folders and nautilus’ default preview generation makes it easy to browse these galleries. There is a Nautilus script available to upload images to flickr directly from the file manager, but I was unable to try it as the script depends on a perl module and that perl module has other dependency issues.

After spending sometime looking at the available tools for photo management on Ubuntu I have made a set of features that I want from my ideal photo management utility:

  1. There is no need to import and make copies of image files stored on my computer.
  2. Tagging should be simpler. The application should use xml and save meta data inside the image.
  3. Clicking on a image provides me a menu to fill meta data information such as camera used, date picture taken, whether its a modified or an original version, who owns this image, tags, notes, comments, etc.
  4. Image editing is a plus but it should be simpler. I would rather use image editing applications to create different versions of image.
  5. Uploading to flickr or web albums should be easier.

Update: I tried Digikam with Kipi-plugins under Gnome desktop environment. Unfortunately it needs Konqueror to communicate with Flickr.

    Ubuntu for Bad Guys

    I am Muslim and we don’t really celebrate Christmas here in Pakistan. So Satanic or Christian doesn’t matter to me. But since downloading the Satanic Edition was easier I decided to give it a try, besides I was already feeling like downloading some new wallpapers for a change and this Satanic Edition is nothing more than a bundle of hot evil graphics.

    It looks great and the idea of having something Evil on our desktops is nothing new, people had been downloading strippers to their desktops for ages so why not the Satan himself?

    Deleting Unwanted Files

    Recently I realized that the Disks utility was showing 8.6 GiB consumed on my Ubuntu partition (I have Xubuntu installed on another partition and have one FAT partition). I decided to free up some disk space by deleting temporary files. I found that there is no tool in Dapper to automate this process. There is a tool for KDE called ‘Kleansweep‘ and also there is a feature specification on launchpad to integrate a similar tool in Ubuntu. But right now Dapper users should do it manually relying on Google and their own instincts to decide what is safe to delete and what could break their system’s stability.

    To free up disk space we need to delete unnecessary files. But where are these files and how do I know that it is safe to delete them? I have found that it is safe to delete files in /home/username/.thumbnails/normal and /home/username/.thumbnails/fail folder.

    It is also safe to delete the downloaded packages in /var/cache/apt/archives I personally don’t like to delete these files. Infact I even copy and paste these files to a separate partition on my hard disk. Why? Because these files are the downloaded packages we install using apt (apt-get or synaptic). If we uninstall a package and then later decide to reinstall it we will have to download it again which consumes time and bandwidth. But if you are not like one of those people who install and uninstall software on a daily basis without need or reason then it is safe to delete these files.

    You can also free up disk space by emptying browser cache, saved chat files, old log files, etc.

    Have we cleaned all unnecessary files? I don’t think so. I really think that there should be an easy to use application to do this job.

    « Older Entries Newer Entries »