Translate

Sunday, 16 September 2012

Using a render farm with the Cinelerra video editor

Cinelerra is an advanced Linux non-linear video editor. Cinelerra provides a timeline-based editing interface similar to Kdenlive and other non-linear video editors. It also provides a wide range of video effects but only a limited number of ready-made transitions. Many interesting transitions can, however, be created from the functionality in Cinelerra.

This blog post focusses on a very useful feature of Cinelerra, the render farm. These notes are based on Cinelerra 2.2CV on Gentoo.

A render farm enables multiple machines on a network to contribute to video rendering, speeding up this memory- and processor-intensive operation. Cinelerra enables the render farm to be used for both "background rendering" and for rendering of the final video.

Background rendering is a feature of Cinelerra whereby the video is rendered in the background for preview purposes. This is far superior to viewing a preview where frames are skipped to reduce the burden on the CPU (in which case  the preview will be jerky and not representative of the final rendered video). The render farm speeds up background rendering significantly.  In my own case, using an AMD XP4000 single-core processor for background rendering is, well, like watching paint dry. Since I have another machine with an AMD triple-core processor on the network, this can be pressed into service.

As far as I can tell from the documentation, the render farm needs to be set up so that the output directory of the video rendering is the same on all machines on the render farm (which Cinelerra calls "nodes"). I achieve this by logging on with the same username on the master node and the client node (nfs server and nfs client).  Assume that the output of the video rendering is this directory on the machine you are using (the master node):

/home/media_user/videos

then all the machines must have this directory, including the same path.  Here  is an example of how the NFS share would be mounted on the client node:

192.168.1.95:/home/media_user/videos /home/media_user/videos nfs rw,user  0 0

Obviously with NFS you need to make the usual checks that the video output directory is contained in /etc/exports, that the directory is exported rw (read + write) and that the uid and gid (respectively for the user and user's group) match up.

The render farm also needs to be configured in Cinelerra. Below is a screenshot of my own configuration with some notes on the configuration underneath.

  

Cinelerra's documentation covers the configuration options fairly well, but there are a few things to watch out for. The option "Output for background rendering" must include the directory and the prefix of the rendered files. In our case, it's not enough to enter  "/home/media_user/videos". That would be interpreted by Cinelerra as the directory "/home/media_user" and the prefix for the rendered files as "brender" (with the individual files being named by Cinelerra as brender + number, e.g. brender001035).

I changed the default option for "Frames per background rendering job" to the uppermost value recommended by the documentation, which seems to work fine. I also changed "Frames to preroll background" from 0 to 3. The documentation recommends 0 but I found this failed to work properly on video where I was using the Ken Burns effect (zooming in or out). With a value of 0, the interpolation engine didn't work properly with the rendered video switching between a full size image and the size specified by the x y z projector values.

Cinelerra must be installed on all client machines. The syntax for initiating the daemon is:

cinelerra -d [port number]
In our case this would be:

cinelerra -d 1055   

Note the high number used for the port. A port number greater than 400 must be used in Linux if you want the Cinelerra daemon on the client node to be started as a non-root-user.  If root is initiating the process, the default note can be used (i.e. cinelerra -d without the port number will default to 400).

Once your Cinelerra installations are set up as described, all background rendering and final video rendering will use the render farm. The best way to check whether the render farm is working is to run some background rendering on an extended section of your video timeline. When you play back the rendered video, Cinelerra will complain about missing frames if the render farm isn't working correctly. You can also check in Settings => Preferences to see whether the framerate is greater than zero for the client node.

In conclusion, the render farm is a great feature of a great piece of open source software.   

    

Wednesday, 5 September 2012

Why Gentoo is a great Linux distrubution

I have been using Linux as a desktop system at home for a number years, with my usage focusing on academic work and multimedia tasks such as music scoring and video.

Until very recently I used a well-known rpm-based distribution, which was a good introduction to Linux and had the advantage of a user-friendly installation process. The difficult with this, and a number of similar, distributions is the focus on periodic releases where the update process can be unreliable. A major attraction of Gentoo is the ability to do a once-only installation of the base system and then be able to customise and upgrade this base system indefinitely.  

As an IT-literate amateur (with a little bit of very dated formal training in programming), it is a revelation to use Gentoo and I think it shows the flexibility and reliability of Linux at its best. The initial installation and configuration certainly requires time and patience, so it's wise to keep a working system running during the initial setup, for instance on a separate partition. Probably the main hurdle is acquiring a  good understanding of your hardware for the initial kernel configuration. In my case, I found that a well-known network card driver was present on the Gentoo live disk but not in Gentoo's default Genkernel so it took a bit of research on the Internet to troubleshoot this particular issue.   Configuring the kernel was otherwise surprisingly straightforward.

Once set up, using Gentoo is a real pleasure. Available official and user-generated documentation is very helpful and extensive while the portage software repository is huge and well-maintained. The requirement to compile software from scratch adds an element of complexity, but I often found the apparent simplicity of my previous rpm distribution a bit illusory -- I frequently ended up with versioning issues which were hard to resolve.  I also found that the vendor-specific configuration files on my former system made the configuration of Linux much more complex than it actually needed to be. There was something of an uneasy mix between GUI-based configuration and the inevitable manual editing of text files once the GUI options had proved to be inadequate.

I have been particularly impressed by the ease with which complex software like Cinelerra can be installed on Gentoo. The installation process is no easier or harder than with a binary distribution but much more flexible. My initial installation of Cinelerra without the OpenGL compile flag was easily corrected with a short line of text in the Gentoo package.use configuration file. It is interesting to compare this straightforward solution to some of the issues which are evident when users try to grapple with an rpm-based system where the vendor has decided not to include a particular compile flag.

In the usual manner of the IT press, Gentoo is often compared with other distributions in terms of performance and ease of use. Sometimes it's a bit like comparing apples and pears. Some Linux distributions appear to be taking their users more towards a one-size-fits-all Windows-like experience whereas Gentoo offers complete configurability and flexibility -- the ability to build a unique system which optimises the use of system hardware. It demands a bit more technical knowledge which can be readily acquired but the effort is worthwhile in my view.

I haven't mentioned any other Linux distributions by name because they all have their strengths. I am a strong advocate of Linux, particularly the  underlying values of freedom and collaboration which are evident across  much of the GNU/Linux community. I think the Gentoo approach embodies these values in a particularly successful way.