Introduction

dvd::rip and transcode are tools for converting between different video and audio formats. dvd::rip is used for ripping the contents of a video DVD (MPEG2 data streams) to disk, eventually cut scenes and start transcode, which then converts the MPEG2 data streams to a desired format (for example xvid and mp3).

Since the transcoding process can take a long time, the work can be split into several fragments which then can be processed by other machines on a network. The best way to accomplish this is to set up a server which controls the transcoding process, from which the (diskless) clients can boot. This was tested on openSUSE 11.1 (as of 10-Jun-2009).

In the following examples the host has the IP address 192.168.0.50 and is named ws50. The clients are named ws51, ws52, ws53, etc. Adjust the addresses to your own setup, if required. "user" specifies a normal user running dvd::rip on the host.

It is important to know that the clients must be assigned a fixed hostname/IP address because you have to specify a list of clients to the dvdrip-master (the controller for the whole cluster). The default behaviour of LTSP is, if you reboot a client inside the default-lease-time (dhcpd.conf), the client is assigned a new hostname and IP address, which is then not seen by dvdrip-master (showing the previously used hostname as "offline").

Requirements

Repositories

The openSUSE-11.1-i586 installation DVD content must be available at /mnt/11.1 (either by copying the contents in there, mounting the DVD or using 'mount -o loop' on an image of the DVD).
The following repositories need to be present:

Packages

KIWI-LTSP

Setting up LTSP on the host

/etc/sysconfig

The following values should be set in System/Kiwi-ltsp:

DHCP_RANGE = 192.168.0.51 192.168.0.100

DHCP_SUBNET = 192.168.0.0

IMAGETYPE = NFS

LTSP_LOCALAPP = transcode ogmtools nfs-client

This will instruct KIWI-LTSP to provide an NFS root-filesystem and transcode, ogmtools and nfs-client as local apps for the clients. The network subnet 192.168.0.0 is used. The DHCP daemon will provide an IP range from .51 to .100 to assign addresses to the network-booted clients.

Setting up repositories required by KIWI

The following repositories are required by kiwi-ltsp-setup (this script is run later):

Packman

openSUSE OSS

This is an example on what to add to /usr/share/kiwi/image/ltsp/suse-11.1/config.xml. Locate the last repository entry and add:

Setting up transcode clustering

Adjusting fping file attribute

Run following as root:

chmod u+s /usr/sbin/fping

This will set the SUID attribute on fping, which is required by dvdrip-master.

Preparing password-less login to the clients using ssh

Since dvdrip-master will log into the clients using ssh, it will not send a password for logging in. Because of this, every client must download a prepared /root/.ssh/authorized_keys file while booting.

If ~/.ssh/id_rsa.pub does not exist yet, this will create one (run as normal user, leave passphrase empty):

ssh-keygen -t rsa

As root do:

cat /home/user/.ssh/id_rsa.pub > /srv/tftpboot/KIWI/authorized_keys

This will add the created public key to the authorized_keys file which will be downloaded by every client at boot time.

Now in /srv/tftpboot/KIWI/config.default locate the line beginning with "CONF=" and add (no spaces or newlines):

,/KIWI/authorized_keys;/root/.ssh/authorized_keys;192.168.0.50

This tells the client to download /srv/tftpboot/KIWI/authorized_keys from the host (192.168.0.50) and copy it to /root/.ssh/authorized_keys.

Preparing dvdrip-data directory

Since all clients must work with the same data files, they all must have access to one folder on the host. This is accomplished by setting up an NFS exported folder in "user"'s home directory.

As normal user do:

mkdir ~/dvdrip-data
cat /etc/passwd | grep "user"

This will create the dvdrip-data folder in the home directory of "user". As second it shows some informations about "user" required for the exported folder. It should look like this:

user:x:1000:100:User:/home/user:/bin/bash

The number 1000 is the numerical user ID (UID) and 100 is the numerical group ID (GID).

This will make the dvdrip-data folder in "user"'s home directory being shared using NFS on the subnet 192.168.0.0. The value "anonuid" and "anongid" must eventually be adjusted to the UID/GID of "user". Both options are required to let the host NFS server assign all files and folders (being created by the clients "root"-user) in there to "user".

The script after.local is being run on the client after booting has finished. It creates the dvdrip-data folder in root's home directory. Afterwards the shared NFS folder "dvdrip-data" on the host (192.168.0.50) is being mounted to it.

Prepare dvd::rip to transcode in a cluster

dvdrip-master must be told which clients in the network will do clustered transcoding. This is done using the dvd::rip GUI. Every client can run multiple nodes, which is useful when having more than one CPU on the client. For example a client having a dual-core CPU can run two nodes. The Intel Core i7 processor has 8 virtual CPUs (4 physical cores, with Hyperthreading enabled, each core shows two CPUs), so it can run up to 8 nodes which could then be named wsXXa, wsXXb, wsXXc and so on. The naming scheme is up to the user. The host can be also involved in clustered transcoding, just add it like every other client too. Beside this, it is suggested to leave "free" one CPU on the host, which is then used for doing the network- and disk-traffic generated by the nodes.

Boot up every client to be involved in clustered transcoding. Make sure they are all up and running. As normal user on the host, log into every client:

ssh root@wsXX

Replace wsXX with the name of the client (ws51, ws52, etc). SSH will answer that the fingerprint is unknown and will be added to the list of known_hosts, write "yes" here. Repeat this until every clients fingerprint has been added. This needs to be done again everytime the user has run "ssh-keygen".

Then run dvd::rip as normal user. Clicking on menu "Cluster" -> "Control Window", the window titled "dvd::rip - Cluster Control" is shown. Press "Add node" to add a each clients nodes to the list of nodes:

Using dvd::rip

Ripping DVDs

For informations about ripping DVDs and creating projects and such, see documentation of dvd::rip.

Transcoding

For transcoding video/audio data using dvd::rip, select "Transcode" tab, select the title, re-fine the settings if desired and press "to cluster". On the then shown "dvd::rip - edit cluster project" window simply press "OK". On the shown "dvd::rip - Cluster Control" window in the "Project queue" list, select the project and press "Start project". When it is finished, one can remove the project from the queue. When there are no more projects left, the clients can be simply powered off.