After getting dvgrab out of the door, I thought about writing a player for DV data. Each frame of a DV data stream contains all required pixels compressed in a simple compression scheme. After decoding the data, the frames must be displayed on screen with the correct timing. It turned out that the standard X Window image display routines were way too slow and so I had to use certain low-level functions that provide direct access to the video hardware.
The next logical step was to start writing the Kino video editor. "Kino" is german for "cinema", I also wanted the name to start with a "K" because many other KDE programs also started with "K" such as Konqueror, Konsole, Kaffeine. However after deciding on the name I found it difficult to get started in the KDE development environment, it was much easier to use the Gnome libraries, so that is what is used in Kino until today. However Kino will run under any desktop environment, not just Gnome.
I knew nothing about video editing, I just wanted a simple way to create a watchable video from the raw footage on tape. When using one of the available Windows video editor programs I noticed that I was repeating the same editin steps all the time.
Each scene on the DV tape had three sections:
- right after pressing the "Record" button on the camcorder the video is shaking, I am zooming back and forth to find the optimal size, There is usually a delay until the interesting part of the scene starts.
- Following that comes the interesting part of the scene. Usually I just leave the camcorder running which means that the scene is wäy too long.
- Finally, someone walks into the picture, the scene becomes too boring or some other disruption occurs.
So, for each scene on the tape I had to do the same operations:
- Do I want this scene in the final movie? If not, find the next scene
If I want this scene, I have to:
- skip the shaking / zooming back and forth part as fast as possible until the first frames worth keeping are found
- delete all video from the current location back to the start of the scene
- fast forward again until the scene is boring or someone disturbs it
- go back a few frames
- delete all video from here to the end of the scene
I am a big fan of command line tools and keyboard commands. So I decided that I wanted to do all these editing operations via keyboard commands instead of mouse clicks. In particular, I wanted to use the well-known (at least to me) vi editor commands for video editing. The analogy:
- a line of text is equivalent to one scene
- one word of text is equivalent to one second of video
- one character is equivalent to one video frame
Hitting the <enter>- or <down-arrow>-key in vi will place the cursor on the beginning of the next paragraph. So my new video editor will go to the next scene when hitting <enter>- or <down-arrow>-key. Entering <arrow-up> will go to the beginning of the previous scene.Entering the <left-arrow>-key or 'w' will fast-forward (or super-fast-forward), similarly entering the <right-arrow>.key or 'b' will move in the other direction.
Deleting from the current position to the beginning of the scene is done with the 'd0' command (when in vi, this will delete all characters from the current cursor position back to the beginning of the line). Deleting to the end of the scene is accomplished by entering 'd$' (which will delete text from the cursor to the end of the line when in the vi editor).
(I got several emails complaining about such an 'insane' editor, so I had to provide standard menus and mouse commands too).
Editing the raw footage of my vacation video was now surprisingly simply:
- after loading the raw video(s) press <enter> and 'w' to quickly decide which scenes should go in the final video
- for each scene, press 'w' to find a good starting point for the edited scene (fine-tune with the arrow keys)
- enter 'd0' to get rid of all the previous junk
- fast forward again by pressing 'w' until you decide that the scene is long enough or until someone walks in front of your camcorder
- delete from here do end of scene by 'd$'
- repeat
- save the edited footage
One can rip through hour-long raw video maderial and produce a good video within minutes.
Ironically, even though I have spent many hours writing my very own video editor software, I have never found the time to actually edit my own movies... There are still boxes with DV video tapes dating back to 1999. Maybe I should train my kids to do the work for me, they actually love watching their own baby videos.
Kino has made it in every major Linux distribution. Most of the current code was developed by Dan Dennedy and Charles Yates (see http://www.kinodv.org/article/static/9).