Light, Camera, Action... Kino!

ArticleCategory: [Choose a category, do not translate this]

Applications

AuthorImage:[Here we need a little image from you]

[Photo of the Author]

TranslationInfo:[Author + translation history. mailto: or http://homepage]

original in en Katja Socher

AboutTheAuthor:[A small biography about the author]

Katja is the German editor of LinuxFocus. She likes Tux, film & photography and the sea. Her homepage can be found here.

Abstract:[Here you write a little summary]

Kino is a program to capture video from your camera to your computer, to manipulate your movie (only basic features are implemeted yet but hopefully there will be more in the future) and to export it back to your camera.

ArticleIllustration:[This is the title picture for your article]

[Illustration]

ArticleBody:[The article body]

Installation

Kino uses the ieee1394 (i-link, firewire) protocol to communicate with your digital video camera. For this purpose you need to have a firewire card in your computer. I am using the Exsys-6501 firewire card (www.exsys.de) which works very well under Linux.

All recent Kernel versions (I use 2.4.18) have IEEE1394 support. You need to enable the following IEEE1394 related kernel options at kernel compile time:

CONFIG_IEEE1394=m
CONFIG_IEEE1394_PCILYNX=m
CONFIG_IEEE1394_PCILYNX_PORTS=y
CONFIG_IEEE1394_OHCI1394=m
CONFIG_IEEE1394_VIDEO1394=m
CONFIG_IEEE1394_SBP2=m
CONFIG_IEEE1394_RAWIO=m

You find the homepage of the firewire team that writes the kernel code at http://linux1394.sourceforge.net/. I recommend however not to download the kernel code from there but to use the code that is already integrated into the mainstream kernel (www.kernel.org)

To use the firewire functionality you need to install libraw1394, libavc1394 and libdv. All three are available at sourgeforge:
sourceforge.net/projects/libdv
sourceforge.net/projects/libraw1394
sourceforge.net/projects/libavc1394
I used libraw1394_0.9.0.tar.gz libdv-0.9.5.tar.gz libavc1394-0.3.1.tar.gz
libdv-0.9.tar.gz works as well but it has a bug in its mmx code. You need to edit the function mmx_ok(void) in the file mmx.h and change it to always return 1 (return (1);). Version 0.9.5 does not have this problem.
To install the libraries use the usual

./configure
make
make install

Now load the kernel module video1394 with modprobe:

modprobe video1394

run lsmod and check that the following modules are loaded:

video1394 15344 0 (unused)
ohci1394 17136 1 [video1394]
raw1394 6896 0 (unused)
ieee1394 24848 0 [video1394 ohci1394 raw1394]

There are various ways to automatically load modules but the simplest solution is to add "modprobe video1394" at the end of the file /etc/rc.local (redhat/mandrake).

Finally you need a device file which is generated with the following commands:

cd /dev
mknod video1394 c 172 0
chmod 666 video1394

libraw contains the test program testlibraw. If you run it and the installation was successful you should get the following output:

> testlibraw
successfully got handle
current generation number: 17
1 card(s) found
nodes on bus: 2, card name: ohci1394
using first card found: 2 nodes on bus, local ID is 0, IRM is 1

doing transactions with custom tag handler
trying to send read request to node 0... completed with value 0x23127bac
trying to send read request to node 1... completed with value 0x60217dac

using standard tag handler and synchronous calls
trying to read from node 0... completed with value 0x04477dac
trying to read from node 1... completed with value 0xd37380ac

testing FCP monitoring on local node
got fcp command from node 0 of 8 bytes: 01 23 45 67 89 ab cd ef
got fcp response from node 0 of 8 bytes: 01 23 45 67 89 ab cd ef

polling for leftover messages

Now you can install kino (kino-0.5.tar.gz was used for this article). You install it with:

./configure
make
make install

Capture (camera->computer)

[capture your video]
Connect your camera with your PC via firewire. Then switch your camera on, start kino (in this order) and go to capture in kino. You will notice that you can now control your camera with kino, you can start playback, stop, pause, rewind, etc.

If you now want to capture your movie to the computer first click on "setup". You will find a very good description of every button of the set up menu in the manual (under the topic Kino Preferences) so I won't repeat it here. I just want to make the following notes:
Under file you have to specify a directory and a filename. The directory must already exist. If you forget to give a filename in addition to the directory your movie won't be captured on your computer.

If you close the dialog box the specified file should now also be visible on the main screen.

There is the possibility of auto split capture which will divide the movie into several scenes when there was also a cut in the filming and usually works very well.

But for trick films I recommend to disable this option because otherwise every frame will be a scene which then makes cutting almost impossible.
Leave setup now.

If you now press the red button your movie is captured.
Now go to "Editor", open your movie and press play to watch it!

Manipulating your movie

[edit your video]
Go to Editor for this. So far kino only supports very basic editing but for many cases you will probably already find it sufficient.
Go to File and open an existing movie. If you click on Frame Position with the left mouse button (below on the right) the current frame number plus the total frame number are shown. You also see the display of a video player and can play your selected movie, rewind it etc.
You can copy scenes, cut them and paste them.

Cutting scenes out

You go to the frame before you want to cut and split the scene in two, then you go to the last frame you want to cut and again split the scene in two. Now you go to the scene you want to cut, click with the mouse on it and "cut".

You can also append another movie to your selected movie by clicking "insert file before frame". The appended file only needs to have the same format and size etc.

Saving

While you are still editing your movie it would be unecessary to use more disk space than you need. So just go to File--> Save as and save the Playlist. These playlist files are very small xml files. They refer to the original AVI files which were created during capture.

If you are finished with all your editing you can export (not save) it into one big file on your hard disk or record it back to your camera.

You can also use the command line that you can see in the interface of kino. See the manual for the available commands.

Timeline

Under Timeline you can get a list with the frames of your movie. How many frames are shown depends on the interval you have chosen. This can help you to get an overview over the whole story.

AVI is not AVI

A note on AVI. AVI is not a specific format of its own (like e.g. gif or jpg). AVI is a container format. Kino can export and import AVI in dv2 and dv1 format. dv2 is often better if you plan to further process the video with other programs. Jpeg-encoded AVI is also very popular. To convert dv2 AVI into jpeg-encoded AVI use dv2jpg (sourceforge.net/projects/dv2jpg/)

Export

You can save still pictures from your movie, you can save it to another avi file and if your camera allows that you can transfer your edited movie back to your camera.
[camera VTR setting]

Export to camera

First switch your camera on, then start kino and go to Export. Even for exporting the movie to the camera the control button on your camera should be set to "VTR". It might be surprising since you normally use this mode to play the video rather than record, but this is how it works for most cameras and definitely for Sony cameras.

Select the panel "IEEE 1394" [export to fire wire] and press the red button to start the export procedure.

Export to AVI file (not as playlist)

Go to export and select the panel named "AVI". Here you can select the file type (dv1 or dv2). Use type 2 (dv2) if you want to process the film further. You can select a file name and press the red button to start the export procedure.

Still pictures

To get one or several still pictures from your movie go to Export and select the panel named "Still Frames". Here you can enter a file name and the file extention sets the file format automatically. I don't know which file formats are supported but .jpg and .gif both work fine.

It is also possible to export the sound into a separate file. But I have not tested this since I always add the sound to my films after cutting.

References

mirror server hosted at Truenetwork, Russian Federation.