Home Pauline's Pages Howto Articles Uniquely NZ Small Firms Search
Height Padding
Ubuntu Linux on the Take

Fun with Ubuntu Linux | The Road to Freedom - The Journey Starts |The Road to Freedom - Base Camp | Ubuntu All Together - Sharing, Networking, Backup, Synchronisation and Encryption | Ubuntu on the Lookout - Browsing, Email, Contacts, Calendars and Tasks| Ubuntu on the Move | Ubuntu on the Take | The MSI Wind U100 Netbook for Global Communications and Computing

Contents of this page

Introduction

 The main page covering my experiences in making the transition from Microsoft Windows to Ubuntu Linux - Fun with Ubuntu Linux quickly become excessively long.  This is the second specialised page which covers how to handle all the pictures we take in the Digital Camera era using Ubuntu Linux. It is currently being extended to include my experiences learning how to turn the output of my Digital Video Camera which uses DVC tapes into edited DVDs with a navigation menu.

One of my main reasons for making the transition to Ubuntu was the huge, expensive and uncontrollable flow of data whilst on the move when using Microsoft Windows XP. I got so tired of the continual updates to the Windows XP system and the associated Virus checkers, Firewalls and Malware detectors. Linux was attractive because it needs no virus checkers or separate firewalls which need updating and no unstoppable or essential automatic system updates. The subject of my first specialised page was therefore Ubuntu Linux on the Move which covered all aspects of communications when away from home. Perhaps the second most important activity after communications for inveterate travelers like ourselves is handling all the photographs we take with digital cameras, viewing them and ultimately putting them into a form that can be used on our web site. Retaining the fun approach I have called it Ubuntu Linux on the Take. Logically the third will be "Ubuntu Linux on the Make" covering Web Authoring!

Digital Photography

Digital Photography support has become a major use for computers over the last 4 or so years and increasing so for laptops for use whilst on holiday to download and backup the cards in the camera. This provides a major logistic and storage problem - we have taken some 20,000 pictures in the last 4 years of which less than 25% are printed and even less added to our web site. Many more are used as reference - we take many pictures of, for example information boards for background information so they still have to be easily found.

Firstly it is worth looking at the important differences between graphic images from a digital camera and other images. The photographic images are mostly stored as JPEG (Joint Photographic Experts Group) compressed images, the same format used for most web images and most other photo type images. The difference is that there are now extensions to the format which allow additional information on the camera settings when the picture was taken such. Some are well known and defined such as EXIF, some are more flexible in the metadata they can contain. Early graphics packages ignore the metadata or strip it out and when you modify and save the graphics file it will have been lost permanently. Newer packages give the choice of striping it out or retaining it unchanged - some allow limited changes or new metadata data to be added.

Most Digital Cameras come with their own basic software for Windows PCs and sometimes Apple computers - none come with software for Linux however most of the functionality is built into Ubuntu Linux although some may need to be installed from the CD or repositories. In fact the Ubuntu software is often superior and makes it easy to use cameras from several vendors and integrate the pictures.

Before we start on the details there is one basic point which needs making: Whatever software and hardware you use it is essential that you set the time in your camera accurately and reset it as one changes time zones. If you have several cameras you need to be relatively accurate to a few seconds to interleaf pictures correctly - that needs some care and both cameras side by side. If you have not got it right some editors allow you to adjust the time code in the EXIF data but that is very time consuming.

Requirements for supporting Digital Photography

First we should look at what is required.

Support available in Ubuntu Linux for Digital Cameras

Now we have laid out our requirements we can look at what is available in Ubuntu Linux.

Hardware

Firstly almost all cameras are recognised as a USB mass storage device if plugged into a Ubuntu Linux computer. The System -> Preferences menu has a Cameras tab which allows you to set up for automatic importing using your selected program (gThumb by default, F-Spot by preference). I prefer to plug my camera card in via a PCMCIA card or USB adapter so have did not use gThumb or F-Spot this way under Dapper Drake. Ubuntu automatically recognises that a USB or PCMCIA mass storage device has been plugged in but you may need to mount it after which it will appear in the media folder in the root file system. Hardy Heron is clever enough to see that I am inserting a SD to USB converter and fire up F-Spot automatically.

Programs

F-Spot (Downloading, Cataloging, Displaying and Basic Editing) is available in Ubuntu Linux Dapper Drake but needs to be installed from the CD or Internet Repositories and is the accessible from the Graphics menu. I use F-Spot to 'download' the pictures from the card by using its Copy files to the Photos folder option. This creates a folder called Photos in your home folder with sub-folders for year, month and day and adds them to its catalog. Beware it does not warn you if the files have already been downloaded but just creates a -1 , -2 etc version so work out a procedure if you want to download at various stages without clearing the card. (hint - use the tagging facilities so you can delete overlaps).

The latest version which is part of the Hardy Heron Distribution shows you all the pictures on the card so you can select which to download and I now chose to download to the My Pictures folder on my shared drive immediately.

F-Spot displays are based on a timeline and has multiple tagging so you can use tags to select pictures for printing, slideshows, exporting to another folder etc and also for 'tagging' by classes such as holiday etc. You can create your own hierarchy of tags. This is a very simple but powerful system which is far better than my original Canon Zoombrowser software where one ends up copying into multiple folders.

When we come to editing. F-Spot has a number of built in basic sizing and correction functions including cropping and a very useful colour temperature correction. When editing you can use a copy called filename (modified) and switch between the two as required. You can also use external graphics editors such as the very powerful GIMP and again you have the option of make a copy first. 

The version of F-Spot in Ubuntu 6.06 (Dapper Drake) is 1.1 - the latest version of F-Spot which is available in Ubuntu Hardy Heron 8.04 is 4.3.1.

GIMP (Sophisticated Image Processor) is considered my many to be on a par with Adobe Photoshop in most ways but is Open Source and runs under Linux and Windows. It is always installed in most Linux distributions including Ubuntu. It is an understatement to say that GIMP seems daunting when you first open it but is worth persevering and after a short time it become apparent that it is actually very easy to use and provides a huge number of facilities with instantaneous previews. I will just mention those I find indispensable: Rotation, perspective correction, cropping with and without the aspect ration being maintained and changes in resolution. Colour corrections are always difficult but hue and RGB corrections are available as usual but not the colour temperature correction I find helpful in F-Spot and Picasa. Brightness and contrast are obviously available. I also used to use a gamma correction a lot in PaintShop Pro 4.2 - this allows one to bring out detail in the shadows by a non-linear brightness curve. This and more can be done done just as simply by GIMP using the curves function - it is difficult to describe but a few seconds experimenting makes its power and effectiveness clear.

I find a combination of simple corrections whilst cataloguing in F-Spot or Picasa and then more complex ones when required in GIMP is perfect. In practice my Canon A75 is so good that only a few photos require manipulation in colour so one is only correcting ones own errors in rotation or abuse of perspective and perhaps gamma type adjustments to bring out details in dark areas of a picture. One exception is taking pictures of information boards where one almost inevitably has to angle shots to avoid reflections - the perspective corrections in GIMP make it trivial to drag each corner to the correct place before cropping.

Google Picasa 2.7 (Complete Suite of programs) I can not leave the handling of digital photographs without mentioning Google's Picasa. Picasa was written for Windows by Google and also is provided for Linux using a custom version of WINE which Google have supported. I have covered installation in Fun with Ubuntu Linux. It is a self contained Photo Management and Cataloging system which will index a selection of folders that you select using the 'folder manager' . This can be displayed both on a folder basis and a time-line. It has a basic tag like function by 'starring' pictures and a collection of photos can be gathered into a 'tray' from different folders to work on or export. Pictures can also be given keywords which implemented as IPTC keywords and can be used with a Search function, even so these features are less convenient than F-Spot because of the folder structure. The keywords are permanently attached so they follow any directory changes, backups etc

The latest version has added 'albums', an indexing process where collections of pictures can be gathered together without making actual duplicates. The ability to create albums is very powerful. For example lets say we want to create a folder of pictures to print and a folder of pictures which will end up on the web. First we go through all the pictures in the time frame and put a Star on those to Print. Now those pictures are also in the Special System Album called Starred Photos. If we look at that we can select those in the correct time frame (you may have other starred pictures) by a click at the start and shift-click at end then at the bottom middle click Add To -> New Album and call it MyPicturesToPrint1. We now have all those pictures in an album and if we display that we can clear all the existing Stars and then Star those for the Web folder, select them and Add To another New Album called MyPicturesForTheWeb1. Those folders can eventually be exported (which makes a copy) to a folder within Windows to use outside of Picasa.

The main advantage of Picasa is that it has some very effective automatic procedures for enhancing pictures which can have almost unbelievable results - for example I took a picture in Hong Kong in mist/pollution which had all the detail washed out and a colour tint; Picasa's one click enhancement made it look as if it had been taken on a clear day. It has the usual rotation, crop and red eye functions as well as colour enhancement and a number of various filters. It has a very effective colour temperature adjustment which I used to correct all the pictures of posters taken indoors in natural light which slightly fooled the cameras white balance. The modified pictures can be exported to a folder which can be put on a CD or used by other programs. The originals are not modified and each change can be progressively undone. The only shortfall is that it has no perspective correction but a click on the folder symbol opens the directory containing the picture so a sophisticated editor such as GIMP can be accessed easily and Picasa automatically finds the changed or additional file.

Picasa seemed to have no way of maintaining the Aspect Ratio during cropping for the most common Digital camera ratio 4:3 but I have found an undocumented trick to achieve 4:3, square, and 3:2 crop ratios. To get a 4:3 ratio, you would hold down CTRL while in manual crop mode. For the 3:2 crop ratio, you can hold down the ALT key while in manual crop mode. You can also get square ratios by holding down the SHIFT key while in manual crop mode. On the subject of tricks you can get a full screen image by hovering the mouse over the photo and press CTRL then also ALT - it is full screen until you release a key - however slideshow does the same and has more features available. Under Linux on my laptop the slideshow is not full screen unless manually stepped which I do not understand.

All the changes and the 'Star' are held in a file in each directory of pictures so the changes go with the pictures when they are backed up or moved to another machine. One can use a removable drive and the albums database stays intact when the drive is unplugged and the pictures return when it is plugged back in. The albums database is however machine specific so I plan to use the Keywords to add IPTC tags for print, web and an overall designation such as 'sailing in 2007' .

A shortfall in Picasa is in importing pictures from a camera card where there is no ability to import all the pictures in a folder and sub-folders that I have found which means that they have to be imported folder by folder (approx 100 at a time) and each import has to be given a name (this may have been changed in the latest version). I have not tried direct from a camera. Picasa is however good in that it ensures that one does not import duplicates. The photos are imported into a folder structure in the home directory. version 2.7 has an experimental feature to detect all duplicates in your watched folders.

Wine: Wine Is Not an Emulator nor is it a graphics program however Wine does enable one to run many useful Windows Programs in Linux including graphics programs. It is under continuous development and the number of applications it can handle has increased dramatically including a number of the most demanding games. Because it is under continuous development one needs the latest version and that has obvious risks. I have used Wine to run two well behaved Windows graphics applications; Paintshop Pro 4.2 and Irfanview 3.95. I got the information from Ubuntu Hacks (See the book list below) and their website at Wine HQ. To loosely quote "Wine is an Open Source implementation of the Microsoft Windows API on top of the X windows system and Unix. Wine is a compatibility layer for running Windows programs and does not require Microsoft Windows, as it is a completely free alternative implementation of the Windows API consisting of 100% non-Microsoft code"

I successfully loaded two graphics programs namely Paintshop Pro 4.14 and Irfanview 3.95 which even gave me an Icon to run it on the Ubuntu Desktop.

There is more about Wine under Ubuntu 8.04 Hardy Heron in Fun with Ubuntu Linux - Wine

IrfanView (Graphics Browser, Editor, Slideshow Manager and Batch Converter) is another Freeware program written for Windows which I find indispensable. Fortunately it runs perfectly under Ubuntu Linux using WINE. I covered installing Wine and using it to install and run programs in Fun with Ubuntu Linux-Wine. IrfanView preserves and to some extent allows you to manipulate EXIF and IPTC data. It allows you to Browse graphic images, Create Slide Shows and save their contents, convert from one format to another and carry out powerful Batch commands with renaming. You can save most of the configurations for batch commands and load lists of Files. You can also carry out most of the functions one needs on photos including cropping, resizing, rotation, contrast brightness, gamma, compression, red eye and colour balance adjustments (only colour temperature and perspective are missing). You have a preview as all these adjustments are done from one control panel before finalising them. It was my preferred program for slideshows until I started to use Picasa.

Irfanview also allows you to join up pictures taken to give panoramic views, usually a feature of the Cameras software - I have not tried it yet.

Irfanview can be downloaded at www.irfanview.com and there are plentiful help files although most of it use is very intuitive. I am currently using version 3.95 under Windows XP and in Ubuntu running Wine 0.9.29. The latest version of IrfanView is 4.20 which is Windows Vista compatible and runs under Windows XP but the installer does nothing under Wine 0.9.29. 

Utilities and Techniques I have developed.

I have my system set up with a Partition accessible from both Windows and Ubuntu on our lap top. This has a folder called My Photographs into which I used to download my photographs from the two Canon Cameras using Canon's Zoombrowser software. I wanted to use F-Spot which is generally much more powerful but still keep the photographs on the shared drive. F-Spot has no problem cataloguing the existing photographs but its built in download under the version in the Ubuntu Dapper Drake distribution went to a folder Photos in my home folder. Furthermore when I download from the camera card it makes copies if I inadvertently download the same pictures twice or more times which I tend to do with big cards - one likes to back-up and have a look before taking 500 or more pictures. I have therefore written a single line terminal command to do an intelligent copy from ~/Photos to /media/hda6/My Pictures. It only copies the original, not the multiple copies and only overwrites if the file is a newer version. Having run the copy one should delete the photos in Photos using F-Spot and only then re-import them from My Pictures on the shared drive - this avoids having two copies in the database.

The command uses one of the most powerful of Linux's built in commands find which executes cp on all the matches.

cd ~/Photos; find -not -name *-[123456789].jpg -name *.jpg -exec cp --parents -u {} ~/Photos2 \;

This is how it works: First one changes into the Photos folder with a cd ~/Photos; so that some of the clever copy options work correctly later. Then find searches for all JPEG Images (-name *.jpg) except those ending in -1.jpg, -2.jpg, -3.jpg, -4.jpg etc (-not -name *-[12345].jpg ) which are the multiple copies. The find command has some very powerful options including -exec command \; which runs command on all the matches - if the string is needed one uses {} to represent it. My one liner executes the cp command with two options --parents means that the path to the files is included and the -u option to prevent overwriting unless the file being copied is more recent. For this demonstration I am copying into Photos2 in my home directory whilst in real life I am copying to My Pictures in my shared partition ie "/media/hda6/My Pictures"

This can be run from a launcher on the desktop but as it is a complex command it needs to be put in a BASH script file which by convention lives in the ~/bin directory. I called mine PhotoCopy and the file contents is:

#!/bin/bash
cd ~/Photos
find -not -name *-[123456789].jpg -name *.jpg -exec cp --parents -u {} ~/Photos2  \;

This needs to have the permissions set to execute for Owner as well as read and write (Right click -> Properties -> Permissions tab) 

Then right click anywhere on the Desktop -> Create Launcher - Give it a name such as PhotoMove, browse to ~/bin and highlight the file. You can click on Icon to select an Icon and OK and you are finished.

The new version of F-Spot which is available under Ubuntu Jaunty 8.04 allows one to select the download location but still imports duplicates so the technique above is still useful or could be modified to automatically delete duplicates rather than move the originals. I understand that version 5.0 available under Jaunty Jackalope 9.04 handles duplicates so this is no longer required.

The code to delete duplicates in directories below the current one is:

find -name *-[123456789].jpg -exec rm {} \;

An introduction to Video Editing under Ubuntu

Video has been one of the outstanding areas that I have not investigated up till now. I believed that there was little choice but to carry it out under Windows using my Pinnacle Studio Version 10 but I have been experimenting and it seems that there are now a number of tools which may add up to an adequate suite for capturing, editing and authoring DVDs from my Digital Video Camera which uses the small DVC tapes and a DV firewire connection. At present there is only one program which carries out all the stages but even Pinnacle Studio gives them almost complete separation in practice and only recently has it integrated the DVD authoring at all. There is a lot to be said for keeping the stages separate.

Firstly I think one needs to specify what one needs to be able to do to edit a Video.

Minimum Video Editing Requirements

The cutting edge - Repositories, building software and dependency nightmares.

Once you get involved in video processing you are entering into the land of geeks. Little of the software is stable and the libraries it builds on are changing by the day so the geeks build everything themselves from the floor up and there is a lot to build. One program alone I looked at installing had 40 dependencies on other programs and library routines and many of them would have their own dependencies. This is why Ubuntu, and Debian which it is based on, have a package management system which means that anything you try to install automatically installs the required dependences or will not install at all. The price one pays is that everything will lag by 6 months to year which is normally not a problem but in the case of Video then it may mean you are working harder. It is possible to add additional repositories which contain packages but it is possible to get some conflicts if they diverge in the updates, sometimes the actual versions are important both backwards and forwards. It is also possible to install individial packages via the package manager .deb files. In both cases a consequence is that an upgrade between versions ie Hardy Heron to Intrepid Ibex will probably fail unless the extra packages are removed first.

I have tried to chose programs which are supported within the Ubuntu package manager but that is not sufficient and initially I had to use .deb files from Getdeb.com and also added an unofficial Ubuntu Repository at Akirad ( http://akiradproject.net/repository) - now there are better alternatives. I did not want to break my main systems so everything I have tried has been on a special Wubi installof Intrepid Ibex on my HP DX2250 with AMD Athlon dual core 64 bit processor. The Wubi install was for AMD 64 bit and I have found that some programs are not supported yet for 64 bit. The one early attempt at trying to install a major program from scratch lead to a long period of attempting to satisfy dependences and eventually giving up and having to reload from scratch. My end system may not be optimal but I have something working to build on.

The Aikrad Repository

The Aikrad Repository contains versions of much of the Video software which is more up to date and more complete than in the Ubuntu Repositories. It also contains some useful tutorials but mainly directed at cinellera and dvdstyler. It has many of the Codecs etc included which do not get into the Ubuntu Repositories and packages because of problems of a proprietary nature. It is however slightly intrusive as there are periodic reminders that it is all being done by one person and the odd contribution would be in order. Initially it was the only way to get an up to date version of DVD Styler which accepted far more input file formats and a version of ffmpeg which included full mpeg2 support. It is very easy to install as one just has to download a .deb file, double click it and open the package manager to update following the addition of the repositories. There are two mirrors as well as the main repository in case any get overloaded. By the time a year had gone by Dvdstyler had been also added to an Ubuntu Launchpad Repository and I have been able to remove the Akirad Repository.

The Ubuntu Launchpad Personal Package Archive (PPA) Repositories

The Launchpad Personal Package Archive (PPA) service is a the way Ubuntu developers build and publish packages (Repositories) of their code, documentation, artwork, themes and other additions to Ubuntu . This is only part of Launchpad which allows users to report bugs, contribute code, submit translations and generally collaborate in an efficient and transparent fashion. PPAs enable developers to publish ready-to-install packages of their software directly to users through the mechanism of Repositories. Launchpad PPA repositories exist for a large nuber of programs including:

Video Capture

The first stage of producing a video is the capture of the video footage from the camera as a video stream or by transfer of files. A video stream needs to be broken up into individual scenes based on the time code and the file names need to be unique and such that they can easilt identified. The best way is to include the date and time of the start of the clip in the filename - one can also include a reference to the labeling on the name, location etc.

Setting up Permissions and Groups for Firewire capture

Access by Firewire is made very difficult under Ubuntu because there are security issues - a loopback Firewire connection can allow an ordinary user root access if they are expert in hacking. This is not an issue for a home machine but is an issue in a business.

The first action you need to carry out is to add yourself to the video group which has the necessary permissions for accessing video streams. You can add yourself to group video by: System -> Admistration -> Users and Groups -> Click to make changes and enter your password -> Manage Groups -> Select video and click properties -> Tick your username box -> OK -> Close -> Close.

You now need to set the permissions for device which is capturing the firewire (IEE1394) video stream which under Ubuntu is /dev/raw1394. First you have to know that this device is only loaded when a firewire device such as a video camera is plugged.

There are now two ways to proceed, the first is simple and quick, especially if you are happy using a terminal. You plug in and turn on your video device such as a camcorder, wait a few seconds for the driver to be loaded and then set the permissions by typing in a terminal:

sudo chmod 666 /dev/raw1394

You will be asked for your administrator password for security. This will be good until you reboot for video capture

The second way provides a permanent fix. For those using Ubuntu or any of its derivatives from 9.04 onwards you can modify the udev rules. First some background information; udev is the device manager for the Linux 2.6 kernel series and it dynamically mounts and unmounts devices such as USB drives and firewire devices as and when they are plugged in and removed. This is a rule based system that matchs against exported values of the event generated by the kernel when divices are plugged in and removed and the properties of the device. The rules may possibly lead to naming and creating a device node and also running programs to set-up and configure the device. It is the mechanism that opens a file browser on the desktop when a usb drive is plugged in. We can use a simple rule to set up the group of the /dev/raw1394 devcie when it is plugged in:
  1. Find the udev rules folder - /lib/udev/rules.d in in recent versions . It may be in /etc/udev/rules.d in older versions prior to 9.04.
  2. If it is the standard place you can now open the file 50-udev-default.rules for editing using gedit by:

    sudo gedit /lib/udev/rules.d50-udev-default.rules
  3. Scroll down until you reach the firewire section and add this line under the existing entries:

    KERNEL=="raw1394", NAME="raw1394", GROUP="video"
  4. Reboot to set up new udev rules.

You should now be able to use the firewire device for control of and video capture from the programs following.

Kino and dvgrab

Kino is a well developed program which can be used as a simple editor in its own right but is most useful as an easy way to capture video from a camcorder and to split it up. It is available via Add/Remove.

The usual way to operate is to use Kino to control the video camera to set it to wherever you want to start and then capture video. It has three main capture formats, Raw DV and two formats where the audio is split out, format 2 is prefered if you plan to use Windoz at any time. The best way to split up the video is to make each video clip into a separate file and to add the time code to the name. This is also the recommended way for use by the Open Movie Editor. The only problem I had with Kino was that it had to be run from the command line as with Sudo (root priviledges) to control the video camera. I overcame this by adding myself as user to the 'disk' group and also changing my authorisation to include additional priviledges by System -> Administration -> Users and Groups. Note that disk does not appear as a group there for security reasons so a terminal command has to be used. The command line to do this is:

sudo usermod -aG disk $USER

The authorisations screen after changes lookes like this:

dvgrab

dvgrab is the command line program that Kino uses to do the control of the video camera and acquisition of the data from the video stream and is written and maintained by the Kino project. It can, and is also used by other programs for video capture such as Kdenlive. I prefer to do my video capture using Kino as it has the best GUI interface as you would expect as they were both written as an entity. The Kino interface gives excellent and reliable control of the video camera, good diagnostics including information on any dropped frames and easy setting up of the file naming and locations for the capture. You can view the video in parallel if you have a fast machine as well as viewing thumbnails of the captured video.

I have not used dvgrab directly from the command line but it could be the most reliable way on a very slow machine or for high resolution video. You can see all the options by looking at the manual file and some programs such as Kdenlive allow you to add options when they integrate dvgrab into their suite.

man dvgrab

Video editing

OpenMovieEditor

This is the work of a single person and shows a lot of promise although I was not using the most up to date version as it was loaded via Add/Remove. It has a reputation for instability although not for losing data - I had few problems compared to Pinnacle Studio. It is slightly unusual in its interfaces and it took me a while to, for example, find out how to reload a saved project (They are all in a drop down list top right) and the way buttons work, for example the button to the right of the project name allows one to change the name - I never found out how to delete a project! There is an excellent tutorial at http://propirate.net/repos/openme-developers/doc/tutorial.html in which I found is an almost exact mimic of my requirements list!

Each scene has to be dragged individually to the timeline where it clicks to the end of the earlier project. You can not do a multiple selection (that I can find). You can drag either end to make cuts but then the scenes have to be rejoined. This means it is best to work on each clip as you bring it in - different from what I tend to do but probably a better way.

When you have finished the project needs rendering and here there is a real problem as there is only one preset which is for the Apple Quicktime format although other containers are possible there seems to be nothing which is very compatible and acceptable to turning into a DVD. This means that we will have to do a transcoding.

It is best to split the video into a number of sections of 15 - 20 minutes and then combine them as chapters at the DVD authoring stage. It makes editing quicker and less time is spent when changes are made as each stage runs at real time or slower in the case of transcoding.

One tip is that I found one has to turn desktop effects (compiz) off to get a proper display. Right click the desktop -> Change Desktop Background -> Visual Effects or install fusion-icon which will enable/disable compiz and set up options.

JACK - Audio Proccessing and intergration in OpenMovieEditor

OpenMovie Editor uses a system of audio intergration called JACK which needs to be running (Applications -> Sound and Video -> for you to be able to hear and edit audio within OpenMovieEditor. Jack and its control panel can be installed by Add/Remove Qjackctl. It needs to be set up to use a 48000 sound sample rate using it's internal Setup - the tab looks like this:

Adding Frei0r Plugins for special effects in OpenMovieEditor

This is one of the few times I have actually done a compilation and install of anything from scratch. The principles are very simple and standard fortunately and in this case there are few problems with dependences so it is reasonably safe. Download the latest set of plugins from http://propirate.net/frei0r/latest.tar.gz and copy it into your home folder.

Now open the folder in the file manager and Double click on the archive latest.tar.gz. Click on Extract. Click on Extract again.

You'll get a folder called frei0r-plugins-1.1.22 or similar.

Open a terminal and Enter the Frei0r folder with the appropriate folder name:

cd frei0r-plugins-1.1.22

type

./configure


then

make

and finally

sudo make install

The frei0r filters should now be available however some of the most useful filters need other programs such as Gavl (Gmerlin Audio Video Library), a library for handling and conversion of uncompressed audio and video data to be installed first - I think I did not have libgavl-dev as well as libgavl0 so the one allowing as scaled image within an image was not present.

Frei0r (and Gavl) are now available through Synaptic for Jaunty and higher and is also in the launchpad PPA Repository for Kdenlive or the Akirad repositories for Hardy and Intrepid so you do not need to do the above if you are using Kdenlive or install a Repository.

Transcoding from OpenMovieEditor's Apple Quicktime output format to an mpeg2 format (.vob)

Transcoding - command line program ffmpeg

ffmpeg needs to be loaded via the Synaptic package manager. The transcoding should have been easy but ffmpeg did not handle mpeg2 under Ubuntu Intrepid Ibex on my AMD Athlon 64 x2 bit machine as a codec was missing in the version in the repository. I therefore had to do the next two steps on a old slow AMD Athlon 2500 32 bit machine. I also had to add a lot of extra command line options to get the right level of data compression, the default was far too poor a quality. These led to the need for more options to be explicety specified such as the 4:3 aspect and required data rate 4000 kbytes (8000 kbytes crashed latter stages and the default 200kbytes was web quality). In the end it became a very simple process. The coding I finally used on my first video is shown below:

pcurtis@triton-ubuntu:~$ ffmpeg -i Tandem-2.mov -b 4000k -aspect 4:3 Tandem-2.vob
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-shared --prefix=/usr
libavutil version: 1d.49.3.0
libavcodec version: 1d.51.38.0
libavformat version: 1d.51.10.0
built on Sep 26 2008 12:56:27, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Tandem-2.mov':
Duration: 00:23:02.0, start: 0.000000, bitrate: 30338 kb/s
Stream #0.0(eng): Video: dvvideo, yuv420p, 720x576, 25.00 fps(r)
Stream #0.1(eng): Audio: pcm_s16be, 48000 Hz, stereo, 1536 kb/s
Output #0, svcd, to 'Tandem-2.vob':
Stream #0.0: Video: mpeg2video, yuv420p, 720x576, q=2-31, 4000 kb/s, 25.00 fps(c)
Stream #0.1: Audio: mp2, 48000 Hz, stereo, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame=34550 q=2.0 Lsize= 694010kB time=1382.0 bitrate=4114.0kbits/s
video:674562kB audio:10797kB global headers:0kB muxing overhead 1.262368%
pcurtis@triton-ubuntu:

I found that the above seemed to give some strange results in that the time and lengths did not always display correctly so I tried various other transcoding methods and ended up with a script which front ended Mplayer and memcoder called movie-to-dvd which should have worked with very few parameters but I finally found needed some more explicite information on the quicktime .mov input namely the aspect ratio to prevent the input being cropped. I used:

Transcoding - videotrans script movie-to-dvd

I latter discovered a series of useful scripts for transcoding based round Mplayer. You need mplayer mencoder and videotrans added via the System - Administration -> Synaptic Package Manager

Videotrans is a collection of utilities and scripts designed to help with DVD authoring:

movie-to-dvd does exactly what I need and will convert anything that Mplayer will play to am mpeg2 video and AC3 or mp2 audio suitable for DVD use and they can be combined in a vob container which is the perfect input for DVDStyler by:

pcurtis@triton-ubuntu:~$ movie-to-dvd -A 4:3 -m pal -M test.mov

-A 4:3 specifies the input aspect ratio. -m pal that the stream is pal and -M specifies that the streams should be combined as a .vob ready for DVDStyler. A -q parameter can be set to change from the default 6000 kaud maximum data rate either -q low, -q normal or -q high or a numeric value in kbaud

Kdenline as an alternative to OpenMovieEditor

Since I first wrote the video editing section Kdenlive (KDE Non-Linear Video Editor) has undergone a lot of development and now needs to be considered very seriously as an alternative to Open Movie Editor, especially as it may not need all of the additional stages, programs and transcoding required by Open Movie Editor.

I have loaded it onto the machine described above which already had a lot of extra programs and libraries installed and nothing seemed to be missing from it. The only downside is that it is designed to run on a KDE desktop, ie Kbuntu so the interface does not look as familiar, however I am already running other KDE programs such as the K3b CD/DVD burner so it should not be a problem - it will just bring in the parts of the KDE system that it needs. Kdenlive is available in Hardy, Intrepid and Jaunty but the versions are sufficienty out of date and the development cycle so fast that it is very desirable to add the Knedlive Launchpad PPA Repository so it can be loaded by the Synaptic Package manager and kept updated automatically. The Kdenlive Repository is loaded in Jaunty by by:

System -> Administration -> Synaptic Package Manager -> System Menu > Software Sources > Third-Party Software; click add and paste this line in:

deb http://ppa.launchpad.net/sunab/ppa/ubuntu jaunty main

close Software Source window and click reload.

After adding the repository, you also need to add the key for the repository to your system's list of trusted keys, type the following command line in the terminal:

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B5115B98AA836CA8

Then click the reload button in synaptic and install Kdenlive package or type the following command line:

sudo apt-get update && sudo apt-get install kdenlive

Kdenlive's main features are:

The versions provided in Ubuntu are inevitably out of date as progress has been so fast and version updates are now on a bi-monthly basis so you really need to load their repository which also has some of the essential packages such as FFmpeg which need to be kept up to date.

The potential advantages over Open Movie Editor seem to me to be:

The disadvantages of kdenlive compared to OME that I have found are:

Are the repotential problems in having both OME and Kdenlive installed for evaluation?

Evaluation so far:

I have tried out most of the essential editing functions and have input some video as a test.

I will report more when I have tried it out more fully but so far it does what I expected from the specification and if it is reliable and continues to deliver what is promised I will switch allegiance.

DVD Production

The Video Editing stage may be the most important and chalenging part of producing a Movie but turning it into a good DVD is equally important if one wants a professional looking result which is easy to show.

Standard DVDs are limited to about 2 hours of high quality video but can be longer if a little quality is sacrificed. This is longer than the attention span of most people watching home made videos and longer than justified by most subjects. A DVD is normally broken down into a number of separate Titles which can be selected from a menu at the start. Each Title can be broken down into Chapters and DVD players almost always allow one to move forwards and backwards by a Chapter (and Title) at a time. Chapters can also be reached from a menu and additional sub-menus can be used below or chained from the main root menu which is displayed when the DVd is first played.

What does this all mean for editing and producing our movies. I find it best to edit the movie in sections which each correspond to a separate Title. I try to limit each chapter to about 20 minutes in length and that corresponds to 4 Gbytes of 'raw' DV format or 750 Mbytes of MPEG2 which is the underlying video format on a DVD. There are advantages in keeping the MPEG2 file sizes to under a Gbyte because there are some limitations in file sizes on some systems although I have never had any problems with larger ones.

It is very important to limit the number of format changes, which are usually refered to as Transcoding. The best way is to make a single transcoding by doing the editing in the native format in which the unedited video exists which is DV (Digital Video) from a camcorder using Compact Digital Tapes (DVC) which last for an hour. Camcorders with hard disks and DVDs will most likely use an MPEGx format and Digital cameras use a variety of formats and will normally have a lower resolution than a DV recorder which is 720x576 - you may wonder how this matches to a 4:3 but this is because the pixels are defined to be rectangular so the result needs to be expanded to 768x576. You need to remember this when adding still pictures and make sure if the editor converts for you from 4:3 or if you need to convert yourself.

Returning to the main point I capture in one of the DV formats which all leave the video unchanged and only differ in how they handle audio. I set up the video editor to use the same format internally so no transcoding is required until the editing is completed. At this point the files are unchanged and there is a lot of information on all the effects and transitions. The production of the output is called Rendering and obviously there are changes wherever there are transitions or effects applied - this is the time to carry out the transcoding to the format used on a DVD so no further changes will be needed during Authoring. This is where the Open Movie Editor falls short as it can only currently output to an intermediate format if you are eventually producing a DVD. Kdenlive can output directly to MPEG2 (.mpeg2 or .vob) file and avoid time consuming and quality destroying Transcoding of the video stream.

This also gives me a very well defined interface between the video editing and DVD authoring steps. I can produce files with MPEG2 Video and AC3 audio streams combined into .vob files from Kdenlive each of which corresponds to a single Title on the final DVD which can be used without any need for further transcoding in the DVD authoring process. If the files are under a Gbyte they will not even need to be split up can be passed directly into the DVD image. This only leaves menu creation and addition of chapters to the DVD authoring tool. In an ideal world the information on the chapter positions and headings would be added in the editing operation and passed from editing to the authoring stage. This integrated approach is used in Pinnacle Studio but also implies you need to work with a whole DVDs worth of video simultaneously which is very slow and inefficient and I feel the split aproach is quicker and more reliable.

Looking at the two Editors I have used. Open Movie Editor produces files which need transcoding to .vob files and has no built in DVD authoring. Kdenlive can render directly into .vob files suitable for an Authoring tool to pass directly onto a DVD and has a simple DVD authoring tool integrated into it in as much as it can be run automatically on the output from rendering as well as being used as a stand alone program. It is actually a front end to a command line program called dvdauthor which has been the stand tool for many years and offers almost anything you can conceive of using and a few other options as well. The GUI front end offered in the Kdenlive suite is fairly simple but convenient. However to get the best results there are other more flexible GUI programs based on dvdauthor and I prefer the one called DvdStyler for quick and professional results but Qdvdauthor is also very popular and may offer some extra facilities.

DVD Authoring - DVD Styler

I tried several programs to combine the output files from Open Movie Editor (or kdenlive) and this one suits me although it is not in any of the repositories at present. It has a very simple interface but enable one to make very complex menus if one desires - it is in a different class to the facilities built into Pinnacle Studio. It is actually a very good GUI front end to the almost universal dvdauthor command line program which assembles multiple mpeg program streams into a suitable DVD filesystem. I had difficulty making the other common alternative Qdvdauthor work reliable, or at all, whilst DVD Styler did exactly what I wanted to make simple DVDs in a very intuative and user friendly manner. There are Ubuntu Packages on the Sourceforge DVDStyler site and a full manual on the DVDStyler site and recent copies of Ubuntu have a version accessible from Add/Remove but not the latest one.

The latest DVDStyler is now available from a repository which can be added by:

System -> Administration -> Synaptic Package Manager -> System Menu > Software Sources > Third-Party Software; click add and paste this line in:

deb http://ppa.launchpad.net/dvdstyler-maintainers/ppa/ubuntu jaunty main

Repeat with the following line

deb-src http://ppa.launchpad.net/dvdstyler-maintainers/ppa/ubuntu jaunty main
close Software Sources and click reload. Note change jaunty to kalmic or your current ubuntu version as required.

After adding the repository, you also need to add the key for the repository to your system's list of trusted keys by typing the following command line in the terminal:

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0x4212adf59724ec2d

Now click the reload button of synaptic, search for and install the dvdstyler package or type the following line in a terminal:

sudo apt-get update && sudo apt-get install dvdstyler

I have added a couple of screen dumps to show the interfaces and how easy and flexible it is to use

DVD Burning - Brasero or K3b

DVD Styler can burn the final DVD itself but there are advantages in spliting the stages in case you have a problem and do not wish to wait another hour for DVD Styler to redo a complex job. Brasero is the standard built in DVD burner but I have been using K3b (which can be installed by Add/Remove) for a while and it is very flexible and powerfull so I tend to use it most of the time - it does a reliable burn and a good DVD and CD validation but note it was designed for a KDE desktop so has a somewhat unfamiliar style of interface when you first meet it.

DVD playback - Xine, Gxine, and Mplayer

Xine is used internally by DVD Styler and seems to be the most reliable for DVD playback so it is best to install it via System -> Administration -> Synaptic Package Manager and search for and install ui-xine gxine and mplayer. The Gnome front end to Xine is called Gxine which seems to be better for playing DVDs with menus. For playing commercial encrypted DVDs one needs to also install libdvdcss2 libdvdread3 libdvdnav4

Summary of packages to install using the Synaptic Package Manager for video processing and DVD playback

Tricks of Video Editing under Ubuntu

To follow

Conclusions

Digital Photography: Ubuntu Linux has all the facilities to handle photographs that I had under Windows, in fact the main photo and graphics editors I use (Paintshop Pro, IrfanView, Picasa and GIMP) all run both under Linux and Windows. Under Windows I used the Canon Zoombrowser program provided with the camera to 'download' pictures from the camera/card whilst under Linux there is a powerful program called F-Spot for downloading and photograph management. The problem is then one of deciding which programs to use - initially I used F-Spot to download, carry out minor corrections and cataloguing and selection for printing and web use followed by InfanView in batch mode to reduce the resolution, increase compression and rename them for web use. This is the best approach for purists who wish to avoid use of any proprietary software which is not completely Open Source and free of commercial considerations. I have now compromised and use F-Spot for Downloading and then use Picasa for normal trimming/corrections and selection using the albums feature - for major corrections I use GIMP before final tuning in Picasa. I then export the 'print album' from Picasa to a folder on a CD for Printing and the 'web album' to a folder I save for use by InfanView in batch mode to reduce the resolution, increase compression and rename them for web use.

Video Camera Support: Less refined and intergrated than packages such as Pinnacle Studio under Windows but useable. I have taken three DVC tapes through to DVDs with Titles, Chapters and Menus on a reasonable powerful machine under a Wubi install of Intrepid Ibex

Before You Leave

I would be very pleased if visitors could spare a little time to give me some feedback - it is the only way I know who has visited, if it is useful and how I should develop it's content and the techniques used. I would be delighted if you could send comments or just let me know you have visited by Sending a quick Message to me.

Fun with Ubuntu Linux | The Road to Freedom - The Journey Starts |The Road to Freedom - Base Camp | Ubuntu All Together - Sharing, Networking, Backup, Synchronisation and Encryption | Ubuntu on the Lookout - Browsing, Email, Contacts, Calendars and Tasks| Ubuntu on the Move | Ubuntu on the Take | The MSI Wind U100 Netbook for Global Communications and Computing

Home page | Pauline's Pages | Howto Articles | Uniquely NZ | Small Firms | Search

Copyright © Peter and Pauline Curtis
Content revised: 31 st October, 2009
Valid HTML 4.01!