Open Source Video Editing for Beginners

An introduction to Kdenlive
Open Voices, Issue 4
opensource.com

Copyright

Copyright © 2013 Red Hat, Inc. All written content licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Preface: Video Editing the Open Source Way

In November 2011, opensource.com began running what would prove to be one of its most successful series ever: a video editing tutorial by independent multimedia artist Seth Kenlon. Condidting of six installments, this series introduces aspiring videographers to Kdenlive, a powerful multi-track video editor available for GNU/Linux. Kenlon demonstrates how the software can perform both basic and advanced video editing techniques, so anyone—from first-time directors to seasoned veterans—can quickly begin leveraging this freely-available tool.

This volume collects Kenlon's short, accessible pieces into a single, comprehensive guide. Expertly written, it stands as a testament to the open source way—knowledge freely shared so others' creative visions might flourish.

Introduction to Kdenlive

GNU/Linux has infamously been wanting for a good, solid, professional-level free video editor for years. There have been glimpses of hope here and there, but mostly the editors that have the look and feel of a professional application are prone to blockbuster-worthy crashes, and those that have been stable have mostly been stable because they don't actually do anything beyond very basic editing. Kdenlive changes all of that.

At the film production facility at which I work, Kdenlive is the Linux editor in production use, and it performs (and frequently out-performs) the Mac boxes in cost, upkeep, flexibility, speed, and stability. This article series seeks to illuminate for professional editors how Kdenlive can replace proprietary tools, nearly as a drop-in replacement.

A good video editor is one that is suitable for anyone wanting to edit video, with powerful features that enable the video professional to do any task required of the job, yet with the simplicity that allows a hobbyist to quickly cut together footage off of a phone or point-and-click camera. Kdenlive can be both of those things, but regardless of the scope of your video project, there are right and wrong ways of doing things. Over the course of five articles, we will review the practical usage and the common set of best practices that will ensure your projects are successful.

Installing

Kdenlive is a complex install, no question about it. It requires the MLT backend to deal with multimedia, and for maximum compatibility with all possible video codecs, it wants as many video decoding and encoding libraries that you can possibly throw at it.

The easiest fix, obviously, is to simply use the Kdenlive version provided by your repository. The watershed release for Kdenlive, in terms of stability and feature-completeness, was the 0.8 release; all major distributions currently provide 0.8 or above in their official repositories, their "official unofficial" add-on repos, or build services (like Slackbuilds, AUR, et cetera).

First launch

During the first launch, Kdenlive will perform checks to discover what video codecs and sources it has available to it. You'll be given the chance to rectify anything you may have neglected to install.

The usual advice about troubleshooting applies--last month while setting up a Fedora 15 editing workstation, there was an error with the MLT-SDL module, causing the new install of Kdenlive to not launch. A quick Internet search for the issue provided the solution, and we were up and running in no time.

You'll also be asked to create a default Kdenlive project folder. This isn't anything you'll be locked into later, and in fact it's often best to separate projects to distinct directories, but choosing a sane default ensures that you don't inadvertently dump important project files out into random folders without realizing it.

Your workspace

Kdenlive uses Qt4 for its interface, so customization is easy. It's pretty common for video editors to use a darkened theme to emphasize the video rather than distract the eye with a bright glowing interface (also, the dark theme helps during color correction). To change the theme of Kdenlive, use Settings Menu > Themes. The available themes come from the available KDE4 themes, which you'll find in your System Settings.

Since I am often editing late into the night, I use the default theme during most of the edit (I find the light from the monitor precludes me from having to turn on a desk lamp and still prevents me from blindly knocking over my coffee) but during colour correction, the bright theme is distracting. Good neutral themes for color work are Obsidian Coast or Wonton Soup.

You'll probably want to use Kdenlive in full-screen mode (a near-kiosk mode is available by right-clicking on the window's title bar and selecting Fullscreen), but within its main window there are several different components. These sections can be popped out of the main window, tabbed, rearranged, and floated. All available components of Kdenlive's visual workspace can be seen via its View menu.

The layout of Kdenlive is up to you and your own work style. You may choose to emulate the default layout of whatever video editor you might be used to, or you may find a layout that works better for you. Once you've created one that you like, you can save it via View Menu > Save Layout As.

A typical layout will have at least these panels:

The Project Tree: otherwise known as a "bin" or "clip browser" in other video editors.

Clip Monitor: a place to preview raw footage before commiting it to the final edit.

Project Monitor: a place to watch your edited footage.

Timeline: the destination for all selected clips you use in your project.

We'll review what each of these panels is used for and how to use them, but first let's import some footage.

Importing footage

Before importing footage, you should save your project. This may seem strange given that your project is currently empty, but giving your workspace a name and location on your hard drive will establish the default skeletal structure for all Kdenlive projects. Kdenlive, like most professional-grade editors, generates lots of cache files and metadata. Starting your work without determining a place for all those temporary files to go simply means that you'll be dumping temp files into your default kdenlive directory and then abandoning them once you save.

Save your test project in its own subdirectory. I generally keep my Kdenlive project directories in a ~/kdenlive directory, with the default location being its own subdirectory called ~/kdenlive/default. This tends to work quite well and lends itself to being able to off-load old projects onto backup drives without worrying about whether or not that project is actually self-contained or whether I need to search through files to locate dependent media. Keeping the projects self-contained, even if it means replicating media, is quite liberating and should be used unless you are working in an infrastructure with stores of shared media that don't need to be saved along with your project data.

Creating a standard path for your projects is also helpful in the event that you need to migrate projects from one system to another. If the file paths are always ~/kdenlive/project-name, then Kdenlive losing track of media files is less likely. The path of your default Kdenlive project folder can always be changed via Project Menu > Project Settings > Project folder.

Now that you've saved your project, you can import footage. There are several ways to do this, and Kdenlive can handle them all. Since most cameras record to solid-state media now, "importing" footage often consists of little more than putting your camera into USB storage mode, plugging it into your computer, and dragging and dropping the camera's directory tree to your Kdenlive project folder. Note that carrying over the entire directory tree is essential, since many cameras use complex muxed formats that require metadata about the clips in order to actually play the clips. Do NOT just drag over the "Streams" or "Clips" folder.

Once you've copied the footage to your harddrive, you can add those clips to your Kdenlive project via Project Menu > Add Clip (or by right-clicking in the Project Tree and selecting Add Clip). You may be notified by Kdenlive that the current project setting is not the same as the footage that you've just imported. This is telling you that your project setting has defaulted to, for instance, DV NTSC but that you've just imported CIF sized clips.

If this is the case, then you should accept Kdenlive's offer to change the project profile to match your clips. It's best to edit in a native environment and perform any transcoding only when exporting, so regardless of what you actually intend to create, you should try to edit in the format that you shot, or else transcode up-front (a topic we'll cover in more detail in Article 5 of this series). Otherwise, you'll be capturing footage from some external source, like a tape-based camera, or even, in theory, a webcam. All of these options are accessible via the View Menu > Record Monitor.

The Record Monitor is a robust video capture frontend. It currently defaults to Firewire and will warn you if dvgrab is not installed on your system, but don't panic--you can change this. Click the wrench icon to configure what backend Record Monitor attempts to use.

The configuration menu for Record Monitor should give you a choice between Firewire (dvgrab), Video4Linux (USB and, accordingly, built-in webcams on laptops), Screen Grab (via RecordMyDesktop), and even third-party capture cards. Choose the appropriate back end.

Once you've set the default capture device, return to the Record Monitor and select from the pop-up menu on the lower right the back end you'd like to use. You may need to click the "Connect" button on the left of Record Monitor in order to bring the capture device online. Finally, press the Play button to preview the external video, and Record to save it to your hard drive.

Three-point editing

The editing process was invented and refined more than 100 years ago and is still just as applicable as ever. The first of these editing principles that we have inherited from men and women dealing with hundreds of feet of celluloid film is the three-point edit.

To perform a basic edit in your footage, click on a clip in your Project Tree. It appears in the Clip Monitor for you to preview. This is akin to a film editor taking a strip of film from the film bin and running it through a Moveola (a small, hand-cranked, personal film projector).

Once you've played the clip past the introductory footage (actors getting ready for their shot, the clapboard or slate, and so on), set an "In" point for that clip by hitting the "i" key on your keyboard. Allow the clip to continue playing until you find the end of the action you want to use in the clip. Mark "Out" with the "o" key on your keyboard. You've just set the first two points in your three-point edit.

The third point is where in your timeline the clip should appear. If this is the first clip in your movie, then probably the logical place for it would be 00:00:00:00, i.e., the very beginning of your timeline. To do this quickly, press "v," which will drop the video between the In and Out points of your clip into the selected Video track of your Timeline (by default, this will be Video Track 1, but you can select a different one by clicking the track label on the left of the Timeline). On many other video editors, the video playhead in the Timeline determines where the clip is dropped. In Kdenlive, you get a dedicated target tool for this purpose, meaning that you needn't move your playhead from its parked position just to drop in a new clip. The target tool appears as a small white box in the top SMPTE ruler bar of the timeline.

You can also do a drag-and-drop add by grabbing the video thumbnail from the Clip Monitor and dragging it down to the Timeline.

The basic tools

There are three basic tools in Kdenlive: the Select Tool (s), the Razor Tool (x), and the Spacer Tool (m). This is a fairly standard, albeit basic, toolset. There is no ripple edit tool, roll edit, or any of the power-user tools that some editors might have become accustomed to on other editing systems, but I've found that adapting to the simplified toolset is almost natural. For the amount of use most of the specialized tools actually get, it's probably difficult to justify maintaining the associated code. I noticed the lack of some specialized edit tools when I first launched Kdenlive, but in practice haven't even noticed them missing.

The Select Tool is exactly what you'd expect: click to select a clip, drag to move a clip. Use the it for related tasks as well, such as selecting the active track, creating Guides and Markers, extending or shortening video clips in the timeline, control-clicking to select multiple clips at once, and so on.

The Razor Tool creates splices in a video region in the timeline. In theory this isn't really a necessary tool, since you could always just use the Select Tool to shorten a video clip manually, but in practice, it's nice to be able to target a point at which you wish to cut out or in, make a splice, and then delete the excess footage. If you do shorten a clip with the Razor Tool and delete the excess footage that you've just sliced off, you will be left with a gap between your new out point and the beginning of the next clip in the timeline. To get rid of this empty space, you can right-click on it and select Remove Space. Note that you need to Remove Space on both the Video Track and the Audio Track if you are using separate audio.

Rather than using the Remove Space function, you could manually move the video and audio regions over using the Space Tool. This tool simply selects everything to the right of where you click, i.e., it selects all video and audio regions in the future and allows you to either move them to the left or right in your timeline. It's a common task, although unforunately the Space Tool is quite rigid in how it selects. It will select and move every media region on every track. Should you ever decide that you want to select all regions on, for instance, only track one, then you'll need to either lock all other tracks, or you'll need to zoom out and just use your Select Tool to manually select the regions you want to grab.

Conclusion

Kdenlive excels at a very difficult task: importing media from a myriad different sources, organizing them into projects, and allowing them to be manipulated in any variety of ways. It's user-friendly, powerful, simple, and yet capable of so much. It is easily a drop-in replacement for industry-standard video editors, as you shall continue to discover in the forthcoming articles in this series.

Advanced Editing Technique

In the previous article in this series, we reviewed the different methods of importing footage into Kdenlive, best practises in organizing project files, and the layout and tools provided by Kdenlive. In this article, we will discuss advanced editing techniques and review most of the tools you'll be using on a day to day basis as a video editor.

A brief history of the editing workflow

The initial edit of a movie is called a "Rough Assembly", and it literally consists of each take of each scene, from "Action!" to "Cut", lined up in a row on the timeline, in scripted order, one after another. The rough assembly might last for hours and is really just a good way to review all the footage available.

After this basic edit, a new cut is created, and it is called, simply, the "first cut". It's usually based around the master shot; a wide shot that encompasses all of the action of the scene as it appears in the screenplay. Close-ups, two-shots, and cut-aways are then added to a higher video track so that the end result is one continuous scene, with insert shots of more detailed actions and reactions. This edit is revised into a second cut, and the process continues from first cut to an editor's cut, a director's cut, and a producer's (or "final") cut.

This model might not be imposed on you, depending on your industry but its logic still applies and can help you organize the sometimes monumental task of making hours upon hours of footage into presentable content that people will appreciate sitting through.

The Rough Assembly is often done as described in the previous article; add a clip to the Project Tree, load the clip into the Clip Monitor, mark an In and Out point, and then add the clip to the timeline. Rinse and repeat.

This same technique may be used for the first cut, but after that many people find it impractical to work out of the clip monitor and choose instead to refine their edits in the timeline directly.

Editing in the timeline

After your shots are all lined up in the timeline, you will find the need to adjust their in and out points. This can be done in three different ways:

The best way to refine an edit point of a clip in Kdenlive is to place your playhead on the frame you wish to cut in or out on. For instance, if a character is blinking in their close-up just as you cut away from them but the next shot has their eyes wide open, then you'll probably want to trim off a few frames before you cut. That is, you'll cut out earlier, such that their eyes are open before and after the cut. It's basic continuity.

Place your playhead on a frame where the characters eye's are open, and then make sure that Snapping is On (Timeline Menu > Snapping). Snapping, like in any graphic program, causes edges of objects to "magnetically" pull toward one another. Snapping is a feature that you'll find yourself turning on and off very frequently, so I generally assign it a handy keyboard shortcut. I use the completely arbitrary Control-D, simply because I find that my left hand is always on the keyboard as I edit with the mouse in my right hand. But you can choose anything (the n key seems a popular choice with graphic apps and other video editors, but that's never seemed convenient to me). Assign the shortcut by going to the Setting Menu > Configure Shortcuts.

With the Select Tool (s) roll over the nearest edge of the video region. It should highlight itself with a flashing green arrow. Click and drag this video region to the left, and you've just adjusted the out point of your edit with frame-precision. A more efficient variation on this is to place the playhead on a frame and then use Shift-R to place a splice in the region. Then select the excess footage and delete it as desired. And one more step toward maximum efficiency is doing the same action with two clicks and one keypress only: position the playhead on a frame, select the clip, and hit the "1" key on your keyboard and the in point of that clip will be sent to the position of the playhead. Alternately, you can hit "2" for the out point to be repoisitioned at the playhead. It's a very convenient and fast way to adjust the ends of your clips and is one of my favourite features in Kdenlive.

If it's not frame-precision that you need, you can opt to use the Razor Tool, which currently does not respect snapping. This makes the Razor Tool good for initial cutting, when you know that you like a shot but need it to be, more or less, half as long; grab the Razor Tool (x) and click on the video region at the point you wish to slice. A splice mark should appear and new thumbnails will be generated on the video region to demonstrate that it has been divided into two sections.

The final way of adjusting the length of a video region is precise but inelegant. If you double-click on a video region, you'll get a pop-up dialog box allowing you to modify the clip's position in the timeline, the clip's in and out points, and so on. Not only should you not require a dialog box for this action, there is also no way to quickly input the new values; you must select each portion of the SMPTE timecode, type in the new values, move to the next field, and so on. If you absolutely need to cut off, for instance, 6 frames from the beginning of a clip, then this might be a nice and exact way to do that, but aside from that it's impractical and clunky.

Keep in mind that the workspace resolution counts a lot when seeking frame precision. If you're zoomed out from your timeline so far that it is only able to account for every 10 frames or so, then any tool is going to snap to the nearest 10th frame. When you're so deep into your edit that every frame counts, zoom in on the region you're about to cut, and make sure you're cutting on the frames you think you're cutting on.

Audio splits and grouping clips

Since most modern video devices also incidentally capture sound, most of the video clips you import into a project will have an audio stream in them. By default, Kdenlive displays this audio stream as a part of the video stream; you'll see a video region with its thumbnails overlaid with thumbnail representations of the audio stream's soundwaves.

If you've recorded to a separate audio device, you can keep the audio embedded in the video as reference sound, and you can turn it off by clicking the Mute Track button in the track label on the left.

If this is your primary audio track, on the other hand, you might want to separate it from the video region so that you can manipulate it separately. To do this, you can do one of two things:

1. Right-click on the video region and select Split Audio.

2. Set this as a default action by clicking the "Separate Audio and Video Automatically" button on the lower right of the bottom timeline control panel.

After you split the audio from the video region, you have regions on two tracks now: a Video Track and an Audio Track. The two regions are grouped together (indicated by yellow clip colour with blue space spanning any extra tracks between them). This means that if you shorten or lengthen one, then the other will also be shortened or lengthened. If you move one, the other moves, and so on.

Sometimes that's exactly what you want. Other times, you want to manipulate them separately; a classic example would be when doing the classic over-the-shoulder conversation scene; a close-up on one character intercut with the close-up coverage of the other. One each character's close-up, you want to use the audio associated with that clip, but if at one point you want to do an insert shot of a character's silent reaction, then you wouldn't want to cut their audio track, but allow the other character to continue talking offscreen even though the focus is on the silent character.

For this to work, you'll need to ungroup the clips. You can do this by right-clicking on the clip and selecting Ungroup, or using the keyboard shortcut (Control-Shift-G). This removes the invisible link between the audio and video, allowing you to, for example, cut and remove a piece of the video without affecting the audio.

You can always group clips together by selecting clips (use the Select Tool while holding down the Control key to add to your seletion) and right-click on them or use Control-G to choose Group Clips.

Basic navigation in the timeline

If you're spending your weeks in the timeline, you'll want to know a more efficient way of navigating it. There are all the usual video editing conventions in Kdenlive, albeit with some variation in keyboard assignments.

The now classic and ubiquitous "jkl" keyboard sequence is also present in Kdenlive. To play your timeline, you may press "l" once for standard speed, "ll" for double speed, "lll" for triple speed. "K" stops playback. Press "j" for reverse playback, "jj" for double speed reverse, and "jjj" for triple speed reverse.

You can also move by frame or by second. The left or right arrow will advance or rewind by one frame; shift-leftArrow or shift-rightArrow will move forward or back by one second.

To move your playhead to the beginning of a video region, use the Home key; for the end of the region, use End.

To move along the timeline by splices, use Alt-leftArrow or Alt-rightArrow. And finally, you can jump to the beginning or end of the Timeline with control-Home or control-End.

By using these navigational tools, you'll find that for very long stretches of video editing, you won't need to bother with your mouse, which, as any Unix guru knows, is the real key to efficiency.

Notes on video formats

Video editing is a fairly intensive process, so for best results you will want to have a nice, powerful video editing computer with plenty of CPU cores, plenty of RAM, and a nice GPU with a robust and reliable video driver. That said, it is possible to edit on even a modest laptop, mostly depending on what kind of footage you're trying to edit.

Regardless of what you're editing, consider the format of the video you're using. If you've just imported a muxed video file then more than likely you'll want to transcode it for editing. My main workstation at the studio where I work can easily handle HD footage yet I continually run into stuttered playback when I import muxed footage. If i transcode it to a high-quality lossless matroska file or to something similar, I can edit it smoothly and quickly.

The opposite end of the spectrum sometimes has the same issues, in an odd way. Some phones and portable devices record video in such a highly compressed format that Kdenlive is forced to spends far too much energy decoding it to something that can be played back at a normal frame rate. I avoid this the same way; transcoding early in the project's life and leaving the compressed or muxed footage as backup source files.

To do this, go to the File Menu and select Transcode Clips. Select the clip you want to transcode, choose what profile you wish to transcode into (Lossless Matroska is quite nice although depending on the source footage it may be overkill). Make sure the "Add to Project" box is checked, and then commence with transcoding. Note that for the transcoding process, an ffmpeg command is provided; if you have hours and hours of transcoding to do, feel free to steal the ffmpeg command and do the transcoding as a BASH script in a terminal.

For example, to transcode a folder of .MTS muxed video to something more easily managed by Kdenlive, open a terminal and navigate to the folder containing the source files. You may issue your command as:

$ for i in *.MTS; do $(ffmpeg paste-the-kdenlive-command-here); done

This will cycle through each MTS file in the directory, run it through the ffmpeg command, and save it in the same directory without affecting the original file. To safeguard against even accidental file clobbering, you could establish a folder called "transcoded" and make sure that the final argument in the Kdenlive ffmpeg script is ./transcoded/%1.mov rather than its default of just %1.mov

What codec you use when transcoding will depend on the project and its intended destination. If you require full quality for maximum output potential, then you should probably transcode to Lossless Matroska. If you feel confident that the video is destined for a limited distribution at a fixed maximum resolution, you might choose to transcode to DNxHD 720p or whatever resolution would be appropriate for the destination. Never transcode to something that will lose information before you edit; leave that for the final render and compression.

To further reduce strain on the computer system, Kdenlive has a built-in proxy (or "offline" in traditional editing terminology) system but I have found it unreliable so far. In theory, you should be able to establish proxy clips by enabling proxies in the Project Settings, and then by right-clicking on the clip in the Project Tree and setting it to generate and use a proxy. Unforunately, the proxy generation has crashed every time I've tried it, so I've been unable to utilize this feature as yet.

Keep in mind that whatever footage you place in your timeline is occupying RAM. If you attempt to edit a one-track 30 minute project, then you'll find that your computer (provided it can handle the video format itself) will perform quite well. Start adding new tracks, compositing, two hours of footage in the timeline, and your computer will start to feel like it's working harder. Keep this in mind when constructing your projects. Don't hesitate to split a very complex project into separate Kdenlive project files, and edit on a scene by scene basis until you're ready to string your project together into a complete piece. This technique will be detailed in the final article of this series.

Conclusion

Kdenlive's editing tools provide functional and efficient editing options, as well as flexibility to suit your individual workstyle. Feel free to modify and customize your environment as much as you want, and try out the different tools to see what provides you with the most precise and satisfactory results.

Effects and Transitions

It is expected that even a modest video editor will feature a set of basic video transitions. The challenge is to offer critical effects without becoming bloated and unfocused in scope. Kdenlive manages to offer the most commonly required effects with all the standard options without sacrificing stability or quality.

The famous first words of every screenplay are FADE IN, and in a way, that is the most commonly used effect of all. The classic fade would normally be considered a transition but in Kdenlive a "transition" is a visual effect that requires two video regions to function, while an "effect" works on a single region. This is an important distinction to bear in mind, since the terms are laden with preconceived interpretation.

Layout mods

First, configure your layout (covered in the first article of this series) to have the Effect Stack and Transition panel readily accessible. To do this, go to the View menu and select Effect Stack and then Transition.

This introduces two new panels into your Kdenlive interface. If your interface now looks crowded, you can use tabs. Since effects and transitions are applied to clips in the Timeline, you'll never use your Clip Monitor (which views clips in the Project Tree) and the Effect Stack or Transition panel (which operate on clips in the Project Monitor / Timeline) at the same time. You can make the Effect Stack and Transition panel a tab of the clip monitor panel by dragging the effect stack panel on to the clip monitor; it is now available in a tabbed view (located at the bottom of the panel). Do the same for the Transition panel.

Fades

To apply a fade effect, right-click on the video region you wish to affect. Select Add Effect > Fade > Fade to Black, and the fade-to-black transition will be applied to the end of the clip. Scrub through the video (by clicking along the timelime's SMPTE ruler bar) or play (spacebar) to see the effect.

Once you've applied a fade, you can modify its duration by either using the Duration slider in the Effect Stack, or you can click and drag the corner of the red fade indicator that appears on the video region.

Note that "Fade In" and "Fade Out" (not "to Black") effects are Audio effects, not video effects. It's easy to get them mixed up, and you'll spend an hour wondering why your fades aren't working.

Armed with just these two simple effects, you most likely have all of the functionality expected from a typical video editing application. But for those peculiar clients and users who want more interesting visuals, Kdenlive features quite a bit more.

Dissolves

A dissolve is like a fade, except that they do not fade to black, but to another clip. This, then is a Transition and requires two clips in order to function.

To use it, place one clip on Video Track 3 (the bottommost Video Track on the default Kdenlive setup) and another on Video Track 2. Overlap the end Track 2 over the beginning of Track 3. The concept here, as with any transitional effect, is that in order to gradually move from 100% of one clip to 100% of another, there must be some material that overlaps so that the incremental transition can be built.

Once you've ensured the clips overlap for some duration, right-click on the region in Track 2 and select Add Transition > Dissolve.

You can adjust the duration of the dissolve by overlapping the video clips further, and stretching the yellow dissolve region to encompass more of the overlap.

Slides and wipes

Another way of getting from clip A to clip B is the Slide transition. Being a transition, it also must be added to not just one clip, but to two clips that overlap.

Place one clip on Video Track 3 and another on Track 2. Make sure they overlap by at least one second. Right click on the top video clip and select Add Transition > Slide. Play the video to see the result; notice that one clips "slides" into frame over the other. If you've added the transition in a round-about way, you might find that the wrong clip is sliding in; if that happens during your experimentation, select the Slide transition region in the timeline and, click to activate the Transition Tab, and click the Invert checkbox in the Transition options.

Different wipe effects can be seen with the Wipe transition, easily accessible now that you have a transition region by clicking the drop-down menu in the Transition Tab. Choose Wipe to change the transition, and notice the new options available. You can choose from multiple styles of wipes, and as with the slide you can invert them to control which clip supplants the other.

Chroma key, aka green screen

With so many effects and even entire sets being generated digitally now, there's been a huge demand for the "blue screen" or "green screen" effect, which is technically known simply as a Chroma Key. It is called a Chroma Key because you are selecting (or keying) a specific chroma (colour) value, which you can then discard entirely or use as a matte, or any number of operations.

The Chroma Key in Kdenlive is a two-step process: first, you must select the colour you want to use as your key, and secondly you must composite the image.

The first step can be done, obviously, with the effect called Blue Screen, but it can also be done with the Color Selection effect, which turns out to have more options including choking and throttling the selection.

To set up the effect, place some footage on Video Track 3; it could be anything from a shot of a grassy field to a digital Tron universe that you want your character to be transported to. This is called a plate shot.

Above this, on Track 2, place the shot of your character in front of the green or blue screen. Right click on this region and select Add Effect > Color Selection.

In the Effect Stack, use the color selector to choose the chroma level you wish to key. You can refine the selection with the Hue and Chroma sliders, the Edge mode, and other options.

The Blue Screen effect does exactly what's expected and replaces your selected chroma value with an alpha channel. If you're using the Color Selection tool, it will do the reverse of that; it retains the color selected rather than keys it out. However, there's a handy check box just under the color picker for "Invert Selection" which loses the color and retains everything else around it. Be sure to check this box if you're using Color Selection.

The less compressed the source video is, the higher the likelihood of getting a quick and easy chroma key, since you have more colour depth available for subtle keying. Should you need to apply multiple chroma keys or other effects, the Effect Stack is called a "stack" for that very reason; effects upon effects can be added to a single clip as required. If you had to, you wouldn't be the first composite artist to key one shade of blue or green only to add a second key for some other shade in that same spectrum, or to key out all blue in a scene and then add back in some element using a garbage matte.

Once you've successfully keyed out the color, you've essentially replaced that color with an alpha channel that is just waiting to become transparent. The second step, therefore, is to add a composite transition between the top and bottom video regions. Right click on the top region and select Add Transition > Composite.

The composite transition is added to only the first second or so of the video region by default, so extend it with your select tool to the duration of the clip. You should see in your Project Monitor that the top video is visible except where there used to be blue or green (or whatever colour you keyed), through which the plate shot is visible.

Now, ideally, the subject in the first clip will match the plate's color temperature and will have nice smooth edges and look integrated into the shot. If that is not the case, you'll want to either add effects like a Blue Screen effect to key out the last vestigals of a colored edge, or do color correction to better match the shots. In the next article, color correction will be reviewed in detail.

Overall, this is a powerful tool and provided me with surprisingly good results on even highly compressed video I'd shot with an Android phone. This is significant since other editing applications couldn't even ingest that footage, and even after trial-and-error transcoding to just get the footage into another editor, the chroma key was poor.

Composited images and titles

If the material you are importing for compositing is an image or an image sequence, such as an export of sequential png's from Blender or Synfig Studio, then they probably already have an alpha channel. In this case, all you need to do is use the Add Clip option to add the sequence to your Project Tree.

As long as you have checked the boxes at the bottom of the file chooser dialogue box ("Image Sequence" and "Transparent Background Images") then the images will be imported as a single video clip with built-in alpha, meaning no color selection or chroma key is required. Simply place the image sequence over a video clip, add the Composite transition, and move on.

Titling in Kdenlive works much the same way as images or animations. You can generate titles from within Kdenlive by right-clicking in your Project Tree and choosing "Add Title Clip". This will open a text creation interface, where you'll be able to choose fonts, styles, and even basic animations for the text. You can use the text in its default form (white text on a black background) or you can add a composite transition between the text and some video clip to have a text overlay.

I've never been a fan of doing anything but the most basic titling with the built-in text tools of a video editor. The editing apps I've used seem to agree with me, since all feature or are sure to integrate with external, dedicated titling programs. On free software, there is Synfig Studio, a traditional digital cel animation application, and Blender, the famous 3d modelling and animation application. There is a Youtube series dedicated to teaching video editors Blender for Motion Graphic Artists available here.

Conclusion

Kdenlive features all the standard tools a "prosumer" would ever need for video production, plus quite a lot more. Its stability and feature set places it firmly in the professional market, and it integrates easily into the workflow of a busy post production schedule. With a little experimentation with the different effects, Kdenlive will prove itself as a versatile editing application with all the features demanding clients and producers expect.

Color Correction

Good photography doesn't just happen. Careful attention to lens settings, depth-of-field charts, and lighting will produce quality images but even those, since the days of the earliest photography, have been taken into the darkroom and adjusted.

Kdenlive's color correction suite easily rivals any professional video editing application and in many ways surpasses the basic tools often found in the expensive industry application. Let's look at the typical workflow of color correction, and then the tools.

Workflow

color correction comes into play fairly late in the post production process for two reasons. First, you don't want to spend hours color correction footage only to find that later in the edit, the scene is cut entirely from the movie. Second, adding color effects to all of your footage is burdensome on your computer and logistically difficult for you to keep track of during intensive editing.

So you'll wait until picture lock to start color correction; frequently it's done at roughly the same time as the sound mix is being done. The workflow of post production itself will be discussed in further detail in the final article of this series.

Without exception, color correct your work scene by scene. Your eye treats color very subjectively; a shade of blue that looks "too bright" one moment starts to fall into place after the eye has stared at it long enough, so you want to emmerse yourself in one scene, and adjust the colors only within that scene so that your eye accepts the colors and character of that scene as normal. When the camera cuts to a different scene, both you as the colorist and the audience understand that the colors should be different; we're in a different location now, so of course the colors of our hero's skin tone can be drastically different and we'll understand why. Within the same scene, of course, that tends to not be the case.

The human element

The human eye naturally gravitates to other humans, so unless you're making a documentary about animals or plants, your audience mostly cares about the humans in your movie. Or at least, their eyes mostly care about the humans. For that reason, a good colorist first targets the human in the shot.

Luma values

Start with the Luma. "Luma" is the term used for the levels of your picture's brightness values; if you were to desaturate your picture so that it was black-and-white only, then you'd be looking, essentially, at the pure luma values of your image.

The reason this is significant is because celluloid has a wide tolerance for luma (according to the "response sensitivity" of the film stock film). Think of it as a resolution for the scale from darkest black to brightest white; first of all, celluloid can read darker shadows and brighter highlights, and second of all the gradiation between those two extremes is constant and even, so that even in the darkest shadows there is still great detail.

Video represents a relatively small inset within the celluloid sensitivity spectrum, with its darkest value being early in the shadow levels of celluloid, and its potential white level being quite early in celluloid highlights. Anything below this dark level or above the light level bottoms out quickly and actually causes distortion (which is precisely why your video camera has a "zebra stripes" function on it). Furthermore, the progress from dark to bright is not constant and features less variation than celluiloid.

In other words, your audience is accustomed to seeing a medium with a color range almost as rich as real life, and are instead being presented with a digital reproduction. Since most video is shot to capture reality (or suggest that it has captured some form of reality), and to the audience "reality" on film is "The Look Of Celluloid" (yes, the film industry has trained audiences that film grain and perfect cinematography equals Reality), the colorist's goal is to fake a more filmic look and feel for their video.

The most effective way to fake celluloid-like luma in your video is to "crush" the darks and "pop" the brights; in other words, increase the contrast. There are many ways to do this but my favourite is the Curves tool.

To add a curve to a clip, right-click the clip in the timeline and select Add Effect > color Correction > Curves. Activate the Effects Tab (see the previous article on how to modify your layout and add tabs to your interface). The curve adjustment interface defaults to the Red/Cyan channel, so use the drop-down menu in the top right to select Luma instead.

Bring the bright level up by clicking the top part of the curve and dragging it to the left. Bring the dark level down by clicking the bottom end of the curve and dragging it to the right. This makes the gradiation between the two extremes less constant, so the result is that the image now has more drastic dark levels and more drastic bright levels.

Note that this is actually lessening your video's luma variance, in other words it's making it even less like celluloid by further restricting the luma potential. However, to the audience's eyes, it now looks more like celluloid because the dark areas of the image are richer and the bright areas appear brighter. Like on film.

Levels

Another Luma modifcation tool is the Levels effect, accessed by right-clicking the clip > Add Effect > color Correction > Levels. It's a less graphical interface so might be less user-friendly but it's a powerful way to control the input and output levels of each value. Its controls are available in the Effect Stack as long as the clip is highlighted.

As with the Curves, the default channel is Red, so if you want to target the Luma values first then use the drop-down menu in the top right of the Effect Stack to choose Luma.

Colors

Next, you can manipulate the chroma values of your image. This is done in the exact same way as you would adjust for celluloid: use your human subject as your guide. Human skin, regardless of tone, loves amber. Increasing the red and yellow values in a shot with human flesh in it makes the subject look warmer and more alive and vibrant.

You can use the same toolset as you did for Luma adjustment, but be sure to add a new effect for each channel you adjust. You cannot use the same effect for different channels; you will simply be overwriting the luma adjustment if you switch an existing curve over to the Red channel.

The order of the effects matter. It's a stack, so anything at the top of the stack is effecting all effects below it. This is why I start with the Luma values; I find that if I adjust color first and then place a Luma curve on top of all these, I find that the colors are in danger of becoming posterized and need to be dialed down. So start with the Luma, and then move on to the colors.

If you're using curves for the color adjustment, then knowledge of basic complementary colors will help. As I've stated in an article on a different video editing application (written back in the dark ages, before I'd switched to a free software solution), there's a simple mnemonic that my cinematography teacher gave me to remember the relation of colors in the digital world; it comes in the form of some stock trade advice: "Buy General Motors and RC Cola".

Translated that's:

Buy = BY (Blue and Yellow) General Motors = GM (Green and Magenta) RC Cola = RC (Red and Cyan)

Ergo, if you add red to a shot you are necessarily reducing cyan. If you add green, then you reduce magenta, and so on, and vice versa. The Curves interface makes this abundantly clear, since one side of the curve will be, for instance, red, and the other cyan. You can target certain areas of the image according to which part of the curve you manipulate; you can add red primarily to the midtones (where human skin tone is) by moving the middle of the curve more into red. Constrain the darks and highlights to prevent their red levels from changing.

You can also use the Levels tool for color manipulation. Select the red channel to begin with, and adjust the different levels of red. I find this slightly less useful since it's not possible to target just the midtones, and yet sometimes it produces a rich result nevertheless, so try it out.

Yet another tool you can use for color adjustment is the RGB Adjustment effect. This is a straight-forward manipulation of the levels of the RGB values in the image. Again, there is no target just a specific range, ie, just the highlights or just the midtones so I tend to reserve it for overall adjustments. But combined with other filters, I've used it for primary skintone adjustment, depending largely on the lighting situation and color depth of the video.

Things that look broken

The tool that most video editors and colorists will default to when looking for quick color correction will be the 3 Point Balance effect, because in some professional applications that's the name of the go-to tool for color correction.

The 3 Point Balance tool in Kdenlive is nothing more than a dumbed-down curve frontend. When it is first applied, the image inexplicably turns cyan, and the color-select droppers are completely literal, such that if you select some area of the image as your white point, it assigns cyan as your white point, turning your image into a bad parody of a cartoon effect.

The correct way to use this tool is probably not to use it; use the more powerful curves tool instead. But if you like this simplified interface, then manually select shades of gray using the color picker (obtained by clicking on the color swatch by the Black Level, Gray Level, and White Level.

You'll also notice that there is no color wheel interface in Kdenlive. To any traditional colorist, this will probably be a deal-breaker. Luckily, I'm not a traditional colorist and neither should you be. The tools of the trade are changing and the color correction tools in Kdenlive have proven themselves to be powerful, flexible, and effective. They have easily matched the color tools in any other professional video editor used in the production facility I am a part of, and in many ways they are more efficient. The ability to manipulate colors on a curve, for instance, therefore having a built-in ability to immediately target the luma range that those colors are changing within, is an amazing time-saver.

Saturation

Finally, the saturation of the image can be adjusted; you can created a more vibrant look with very saturated colors, a dull and stark image with less saturated shades, go completely black and white with a saturation level of zero.

The tool for this is fairly staight-forward: Add Effect > color Correction > SOP/Saturation. Add this to a clip and use the controls in the Effect Stack to modify the Slope/Offset/Power of individual channels, or the levels of the overall saturation. A level of zero saturation will render a black and white image.

Copying values between clips

Obviously if you had to re-apply and re-do the color correction from one shot of your subject to the next, I wouldn't be recommending you do any color correction in Kdenlive. But it's easy to copy color settings between clips.

The first method is to right-click on the clip in the timeline containing the color effects. Move to the clip in need of the same (or similar, if you just want to start from approximately the same place) color adjustments and right-click on it. Choose Paste Effects.

Now tweak the color adjustments as needed.

You can also save your own effect settings such that they will be available in your effect menu. In the Effect Stack, click the Save icon under the effect you wish to save. Enter a new name for the effect. From now on, you can apply that effect with those settings onto any clip by right clicking on the clip > Add Effect > Custom.

Color effects

As a final note on stylizing your image's look and feel, remember that you have different compositing options available via the right-click > Add Transition menu. By layering one clip on top of itself and adding a multiply transition between them, and then adjusting the saturation or color values of the bottom clip, you can create a new composited image with some very interesting effects, such as the classic "bleach bypass" look.

Selective color correction and rotoscoping

If your subject is not moving, or if they are moving and you have a lot of time on your hands, you can rotoscope the subject to isolate it from the rest of the image. You're then able to affect only what is visible within your selection.

Rotoscoping and masking is something of an art and is often considered a relative to animation, especially when your subject is moving around and you need to create a rotoscope that moves accordingly. But the basics are simple; add a rotoscope to your video clip, select the area you wish to keep, and composite.

To try this, place a video on Track 2, right click on it and select Misc > Rotoscoping. In the Effect Stack, set the Mode to Alpha so that anything not selected is converted to an alpha channel and ensure that the Alpha Operation is set to Write on Clear. In the Project Monitor, click around the object that you wish to effect on that layer.

After you close your selection, only that object will be visible in that video track. Now add another clip on Track 3, just under than clip and right click on the top track to add a composite transition (see the previous article on Transitions and Effects for more information). In the context of color correction, I add the same clip under itself so that it appears that there has been no rotoscope at all. It looks like one complete image. But now add a new effect onto the top track, such as a curve, and adjust its color. You've successfully isolated adjustment on that object to only that object.

Obviously the use of rotoscoping goes far beyond color correction, but since it's usually touted as a "killer feature" of dedicated color correction applications, it's worth mentioning here.

Conclusion

This article shows that Kdenlive is not just a capable video editor, but also a color correction suite that matches some of the high end color applications available. Not only is it flexible, but it's efficient. Don't let its lack of some traditional conventions fool you; powerful color correction is easy with Kdenlive!

All About Audio

Traditionally, the film editing process was regimented and compartmentalized. The assistant editors helped organize footage, the editor cut the picture, a sound engineer mixed the sound tracks, and a music composer provided the score. In today's quickly evolving landscape of film production, these roles are becoming less clearly defined and many of these tasks are falling upon the editor alone. And in the independent world it's been this way for a very long time.

The results are that the video editor is responsible more and more for building the final film from its disparate pieces, and consolidating the tasks in this way tends to quicken the post-production process, and of course bring down costs. Unfortunately, since video editors have mostly been trained on video editing applications, they tend to try to perform all of those different tasks—clip organization, dialogue editing, audio cleaning, and soundtrack mixing—in the one application that they are familiar with: their video editor.

On GNU Linux, we have the principle of modularity, and the well-known idea that a tool should "do one thing and do it well." Kdenlive hardly does just one thing, but even if we broaden the idea of what "one thing" can mean, it would still be a difficult argument to make that you were ever meant to edit audio in a video editing application (open source or otherwise). In this article, we'll discuss the different sources of audio, how to prepare it for editing, how to export it, optimize it, and finally re-import it.

Audio recording and synchronization

Most cameras that you'll use will have some ability to capture sound, but very rarely are the microphones embedded in the camera of very good quality or at a reasonable distance from the actors to capture good sound. There are three scenarios that have become prominent in how to deal with this:

1. Ignore the on-board mic and set up an external recording system.

2. Ignore the on-board mic and use an external mic recording into the camera.

3. Use the on-board mic.

In the first case, you'll end up with separate audio files that you'll import from the external recording device, such as a Zoom H4, or similar. In the second case, you'll end up with audio "embedded" into the video file that you import from the camera.

And in the third case, you'll still have "embedded" sound in the video file, and you'll either use it as your only sound or you'll use it as reference sound while you sync your external audio file to your video. If you did record to an external device, then you'll need to synchronizing sound in your video editor. This is easier if you did get the reference sound via the on-board camera mic, and it is even easier if you actually bothered to slate each shot.

Slating is one of those often-overlooked parts of production that is probably the single most helpful thing you can do on set to aid in post production. A slate can be simple; I find that a legal notepad (like a tablet computer, but made of trees, believe it or not) and a Sharpie pen is perfect for the non-audible indication of what scene, shot, and take the clip is about to contain. To give something to sync sound to easily, make sure that both the camera and the sound recording are rolling, and then firmly clap your hands in clear view of the camera. This is a low-budget version of a clapboard and frankly it has the exact same results.

The only reason to not slate is because the shot is complex and there is literally no way to fit a slate in at the beginning of the shot. In this event, do a "tail slate," that is, the same thing only at the end of the shot.

It's customary to hold the notepad (or clapboard, or whatever) upside down just as a visual cue for the assistant editor or editor that this slate isn't indicating that a shot is just beginning, but that it's just ending. If you slate each shot, then synchronizing sound in your video editor is as simple as making sure that your audio files and video files have sane names (more on naming conventions in the final article of this series), dragging them both into the timeline, and lining up the loud sound of a clap in the audio track with the visual of that clap in the video track. Once it's synchronized, group the video and audio tracks together by selecting them both with your select tool (s), right-clicking on one track, and choosing Group Clips.

If your sound is starting out synchronized but is then falling out of sync (or just won't sync at all), then check the sample rate. If your Kdenlive project setting is 44.1khz or 48khz but your sound files were recorded at 32khz or 22050hz or worse, then you might find that the audio simply isn't playing at the correct speed. It will gradually fall out of sync, consistently, regardless of how you move it or slice it.

To fix this, a simple sox command will suffice:

$ sox inputfile.wav -r 44100 outputfile_44100.wav

Of course you can do this to an entire folder of audio files with a simple "for" loop:

for i in *.wav; do sox $i -r 44100 $(basename $i .wav)_44100.wav; done

Best practices for a basic mix

Even though you will be taking your audio out to an external application to for the final mix, the first draft of an audio mix happens within the video editor. The best way to make this happen is to stay organized with what tracks receive what kind of sound file.

You should plan on having at least two audio tracks for dialogue; the first will be your default landing track for audio, and the second you can use for overlapping dialogue, which sometimes happens in your typical over-the-shoulder (OTS) conversation scene. In addition to these, you'll probably realistically want a track or two for sound effects. While I don't want to do much mixing in my video editor, I have to admit that sometimes when editing a cafe scene, it just helps to have a bed of cafe background noise to provide a little environment. Freesound.org is an excellent resource for these kinds of effects, so I often download a few tracks and sound effects and drop them in on my effects and foley tracks. Even if I end up not using those particular sound effects, at least they serve as good reference during the actual audio mix as to when the "real" versions of those effects should come in and when they should end; think of it as a Click Track 2.0.

And finally you might want to designate a track for music or musical elements. Again, strictly speaking this isn't something you should really be doing in the video editor but then again we're not editing for Cecil B DeMille, either. Modern editors frequently edit to music, and if nothing else, as with the effects, it will serve as a good indication of when the real music is supposed to come in and when it should swell and when it should be soft, and so on.

Be sure not to mix different types of sound into the same tracks; dialogue must stay in dialogue tracks, effects in effect tracks, and music in music tracks. If you need to add a track and designate it as a third or fourth dialogue track, then do so. They're free, I promise.

At some point during your edit, you should separate the audio from the video tracks if you are using any of the embedded sound streams that belong to a video track. By doing so, you ensure that all of your audio is consolidated into the correct tracks, and it enables you to safely and securely mute all sound off of the video tracks, which you'll want to do if you are ignoring most of the embedded audio streams.

Exporting

The audio tracks for your project will not be exported for the final audio mix until you have declared "picture lock", meaning that you've resolved that no changes to the sequence of images will be made, or that if they are made then those changes will in no way require shortening the audio tracks (ie, you are swapping out one establishing shot for another, for the same duration, and will not require any change to audio). Once you are secure that your picture is locked, then you can do a simple export via the Render menu in Kdenlive. Access this via the big red button in the main toolbar, or via the Project menu > Render. The project menu For Destination, choose Audio Only. Select the format and sample rate you wish to export to; it's best to stay with your current sample rate. make sure your Output File is going to a logical directory and has a sensible name; I usually place my audio tracks into a directory call "mix."

You want to export each track as an individual file; so, in your timeline, mute all tracks but the first dialogue track. And then add it to the render queue by clicking the Render To File button on the lower left of the Render dialogue box. This starts processing in the background, so next you can mute the dialogue track and unmute your next track. Name the output file and add it to the render queue. Then mute that track and unmute the next one, and so on.

In the end you'll have 6 audio tracks (assuming two dialogues, two effects, and two music) that are each the full length of your project file. There will probably be a lot of dead space in each, since you make only have a sound effect every few minutes or so, or only one instance of music, and so on. The important thing is that each track is self-contained, independent of the others, and all of them are exactly the same length as one another and as the video project itself. You, or your sound mixer, can then import the audio files into an audio mixing application; I've used Audacity, Ardour, and Qtractor for the job, mostly depending on what the system I'm using happens to have installed or what the complexity of the project demands.

There's a little bit of an expectation now that an audio mixing application will have the ability to import a video track so that audio can be mixed exactly along with the video. This certainly does help with sound cues or subtle sonic touches like noticing a passing airplane outside a window and dropping in a faint airplane sound effect, and so on.

The de facto audio mixers for Linux do not yet feature this ability out-of-the-box. One solution is a click track. This is the time-honoured convention of having a spare audio track with either literal clicks or, in my personal version of the click track, temporary sound effects that indicate where an when some significant event is supposed to occur. This, combined with a lo-res temporary render of the movie that I can have open in Dragon or Mplayer, allows me to easily maneuver my audio mix and cross-reference the video as needed. So far I've not missed an audio cue yet, and I feel that the absence of a constant video track helps me immerse myself in the sound design.

The application Xjadeo allows you to bind a video file to the JACK transport, which is sort of a meta playhead that synchronizes various sound sources on a system. JACK is usually used by musicians so that, for instance, the drum machine playing in Hydrogen will come in at the right moment in a sequence being designed in Ardour or Qtractor. Xjadeo uses ffmpeg to play back a video in time (and, accordingly, stop or scrub) with your audio in any JACK-aware audio mixer. Re-importing the Mix Once your sound is mixed to your liking, you should export the sound as one complete mixdown. Obviously you will keep the audio project itself in the event that you need to re-mix or change the language or the dialogue (ie, for a dub track), but I see no reason to allow Kdenlive to do any of the mixing by keeping tracks separate.

Before importing the final mix into my project, I generally save a copy of the project as, for instance, project-name_mixed.kdenlive. This, I open in Kdenlive, and eliminate the unneeded audio tracks, mostly just to avoid silly mistakes but sometimes also to save system resources. Importing the final mix is as easy as adding a clip to the Project Tree, and then dragging the final mix to a new audio track in the timeline, starting at 00:00:00:00. You've now successfully made the round-trip with your audio mix.

Workflow and Conclusion

Post-production is a long and involved process. As these articles have demonstrated, Kdenlive is capable of handling every step with efficiency and flexibility. In this final article, we will discuss the final export of the full project from Kdenlive, as well as examine the over-all free software workflow of post-production.

At this point in the Kdenlive project, all editing has been completed, the picture lock has been declared, colour correction has finished, compositing has been perfected and titles inserted, and the audio mix has been finalized. The only step left is to export the movie from Kdenlive as a self-contained movie file.

The first export of your movie should be a full-quality, bit-for-bit copy of exactly what you see in Kdenlive. This serves a few different purposes:

1. Ensures that you have a full-quality backup "Gold Master" of your movie.

2. Ensures that everything you think you see in the small-ish windows and relatively chaotic interface of your video editor is actually true. Regardless of how good an editor you are, there is just something different about sitting back and watching a movie without the ability to stop it and make a quick adjustment or a quick edit. This isn't something you should reserve for the very end of your project, either; this is a step you'll want to do periodically throughout the edit. They're called "sanity" checks in the industry.

The Gold Master

To get a Gold Master from Kdenlive, click the Render button in the main toolbar, or access it via Project menu > Render.

As your Destination, choose Lossless/HQ. Name your output file as your gold master, or rc1 if it's merely a release candidate, or whatever notation you want to use.

The render menu and the gold master

Kdenlive, using ffmpeg as its render backend, offers FFV1 and HuffYUV as its full quality master formats. Choose one of these (both are good; HuffYUV will have a larger file size as it uses PCM for audio while the FFV1 preset uses FLAC), and click the Render To File button on the bottom left of the dialogue box. I tend to use HuffYUV as I have had good experiences with it.

Now that you have a full quality version of the movie, you can either use it as your transcoding source, if you wish to encode for distribution manually, or you can use Kdenlive's interface. I use ffmpeg directly, mostly out of habit but the Kdenlive frontend is, to date, the most sensible ffmpeg frontend I've used.

Encoding

Encoding video for distribution is subject to artistic preference and per-project requirements. There is not a single "best way" to encode your project; you must consider your desired format, your intended delivery method, and so on.

Kdenlive takes into account most of the usual delivery methods, offering presets for DVDs, mobile devices, web sites like Youtube and Vimeo, and much more.

From the user perspective, video codecs are mostly all created equal (a gross over-simplification that probably has ffmpeg and Kdenlive developers cringing). They take video and somehow compress it and ideally play it back on the desired device. So it's useless for a content creator to debate over which codec would be best for their film. Fact is, any codec will do. The deciding factor will be subtleties like bitrate, keyframing and GOP size, and frame size.

The bitrate of a video determines how much information each frame contains. This effects not just the visual quality of the video, but also the ability of the video to be streamed over a network or even a device (since the graphic chips of any device will have its limitation). A very high bitrate, like 35000 kbps (and higher, up to about 54000 kbps, or 54 Mbps) is common on a medium like Blu Ray. DVDs had a bitrate of about 8000kbps. Internet video, obviously, varies greatly, depending on just how much confidence the content provider has in the network connection of their audience.

Variable bitrates help lower the overall file size by throttling the bitrate during shots that don't actually require much information. A relatively still shot of a building, for example, is a lot less demanding on video playback than a high-speed car chase.

The best way to optimize this is to use the 2-pass option. This takes twice as long to encode, but the results are invariably better in both quality and file size. During the first pass, ffmpeg reviews the footage and plans out the optimal method of encoding. On the second pass, ffmpeg does the actual encode.

If you're using the Kdenlive Render dialogue box, the bitrate and number of passes are really all you can control, aside from choosing your video format and frame size. The free video formats, Xvid, MP4, Theora, and Webm are all excellent codecs, most of which are gaining widespread adoption. I would argue that 9 times out of 10 these codecs alone are sufficient for most distribution channels. That said, there are those devices that require special options, and for this you simply have no choice but to encode into a format that you don't really own or control.

Frame size has a very direct result on file size, so if you're targeting a specific file size then the bitrate and frame size are the attributes you can target to help you achieve your goal. The lower the bitrate, the smaller your file will be, and if you reduce your frame size by 50% you'll often see nearly a 50% drop in file size. Of course, the trade-off in both cases is quality.

If you want to try some custom ffmpeg commands to run against your uncompressed Gold Master, then you can choose all the options you want and then, rather than clicking the Render to File button, click the Generate Script instead. This dumps the ffmpeg command that Kdenlive has generated to a file on your harddrive. You can customize this script using your favourite text editor and then run from the Kdenlive Render Dialogue box via the Scripts tab.

Workflow

The bigger picture of post-production warrants some consideration since Kdenlive is only one piece of the puzzle in a diverse industry that is filled with developing technologies. These six articles have shown that Kdenlive is poised to easily be a drop-in solution for video editing, being able to ingest a variety of formats, combine all manner of visual effects, and be the final mix of all the different elements that go into a video production. The bigger question, then, is whether GNU Linux is ready to be a multimedia production solution.

The post production workflow

The general flow of post production revolves around the video editor, but requires a number of additional, specialized applications. Before the media even gets ingested by the video editing application, it must be organized and sorted in some useful way. Prorietary editing applications mostly encourage the editors to do this within their application. This often is very helpful as long as you're only accessing the media from within the application, which is rarely ever the case even when the proprietary application claims to be a turn-key solution.

Proper media management should be done in a file manager, such as Dolphin or Nautilus or the terminal of your choice. Here are some good principles that any good Assistant Assistant Editor knows:

1. Stay organized. Don't scatter your footage all over your computer and expect your project to retain its integrity for years to come. If your project is a quick one-off video that you're going to post to the internet or render out to a harddrive and then delete the source files from your computer, then you might not need to bother with proper organization. For a serious video project that is going to take more than an afternoon to edit, however, keep your files in one directory tree, keep them organized on your drive, and back them up.

2. Name your files so that they are useful. MVI00087.AVI and DCS_000101.MOV are not appropriate file names for video clips upon which your project relies. In a perfect world, we'd all be assigned an Assistant Assistant Editor to watch all of our footage and carefully summarize what's in the take, what take number it is, and then to name the clip accordingly. Until this happens, the responsibility falls upon you. So, watch your clips, give them logical names, such as

klaatuDrinksCoffee_21_MCU_2.mts

Where "klaatuDrinksCoffee" is the scripted action, 21 is the scene number, MCU is the type of shot (in this case, Medium Close-Up), and 2 is the take number. Stay with that convention and you'll never fail to know exactly what is in each shot and where in your project it should be used.

3. Don't edit off of a USB 2.0 drive. There are exceptions to this rule, but USB 2.0 really is too slow for serious high def editing and even, I find, for standard def editing once the project becomes very complex. Get an extra SATA controller if you have to, or a SATA external drive, or upgrade to USB 3.0, but try to avoid USB 2.0 for editing if possible.

Two exciting projects have been developing lately, both geared toward media management on a larger scale. dmedia, associated with the up-and-coming Novacut video editor, promises distributed workflows, and mis from Nido Media provides editors with comprehensive details about shared media in a central media library.

Once the media has been properly organized, it's safe to import it into the video editing application. Kdenlive allows you to create folders within the project tree; use this to manage your scenes. Also remember to make copies of each major cut of your work. Versioning is important!

Transcoding, if it needs to be done, is an area in which GNU Linux excels. Between Ffmpeg and Mencoder, you will usually have no trouble getting video into a format that is easily edited. In fact, at the production facility where I work, it's a Linux box, built at a fraction of the price of the computers around it and yet three times as powerful, that is the main conversion station when video comes in that nothing else will edit. (Eventually, of course, it will be Linux that is used to edit everything in the first place!)

After the project has been created in your editing application and the media is ready to be cut, the next step is, obviously, editing the film. As this article has shown, Kdenlive handles this with ease. A few things to keep in mind in any editing application, Kdenlive not excepted:

1. Whatever is in the timeline is in your RAM. In Emacs terms, the Timeline is your Buffer. If you are editing standard definition footage and have 4gb of RAM then you'll surely be able to edit about a half an hour of footage with numerous cuts and clips without noticing any burden on your system. High Def footage on 4gb RAM is quite another story. Keep this in mind. If you must, edit your project in two or three scene chunks, as convenient, and then marry it all together in the end.

2. I've edited on both my laptop and my main workstation. The laptop is, technically, able to edit, which is convenient when not in studio, but it's far more pleasant to edit on the workstation. Marketing ads showing professional editors cutting their film on a small laptop are doing just that: marketing. If you are about to embark on a serious video project, buy or build a computer appropriate to the job, with multiple CPU cores, plenty of RAM, and a healthy video card.

3. Unfortunately, my tests with the free video card drivers available for ATI and Nvidia have not yet proven to be capable of the same performance as the proprietary drivers. Intel cards are nice in this way, being both open source and, depending on the chip, capable, but if you are doing serious compositing you will most likely require Nvidia or ATI. Hopefully the free drivers will be able to develop quickly so that they can be used for heavy lifting, or Nvidia or ATI will come to their senses and open source their drivers.

Once the picture is locked, or nearly locked, effects, composites, and titles can be worked on. While Kdenlive could do basic versions of all of these things, there are better tools in the GNU Linux world for the job. In fact, we have two excellent tools that, again, equal or rival the tools available in the proprietary world: Blender and Synfig Studio.

In the FX world, it is typical to work with image sequences rather than video. To export just a scene from your movie to deliver to the composite artist, you can utilize in and out points in the timeline just as you would in the clip monitor. It is common to deliver the scene to the FX artist with "handles", that is, a second or so of the shot leading into the FX shot and a few seconds of the shot following.

In the Render dialogue box, choose Lossless/HQ as your Destination, de-select the Export Audio option, and save the clip to some location. Then in a terminal convert that shot to a series of images with ffmpeg:

$ ffmpeg -i short_for_compositing.avi ./scene21_fx/sc21_%03d.tif

Note that the output target %03d.tif will provide three digit numeration for each image; ie, sc21_000.tif, sc21_001.tif, and so on. If you are for some reason exporting a shot longer than 40 seconds or so that requires compositing, then you'll want to make sure you have enough digits in your numbering scheme to preserve correct order of images.

Both Synfig and Blender will import such an image sequence, and export an image sequence that you can then re-import into Kdenlive.

Titling can be done a few different ways; for animated title sequences, Blender or Synfig will probably be the best choice. If you are simply going to use static title cards then you can also design your titles in GIMP and import a single PNG or TIF image to your project. You might have to adjust for pixel aspect ratio (ie, design your titles in GIMP at 720x534 or so, such that when they import into 720x480 projects they will appear properly proportioned) but aside from that, it's straight-forward.

While compositing is under way, it is common for audio work to begin, since both processes rely on a locked picture. In the previous article, preparing for the audio mix was discussed in detail. Free software offers a number of excellent options for achieving a professional sound mix, whether you know just enough to use Audacity or prefer a full-featured digital audio workstation like Ardour or Qtractor. With over 100 plugins available from the LADSPA and Calf projects and a few others, you'll have everything you need and quite possibly a lot more than you'd normally have if you'd had to pay for all of those features separately.

When the audio and composites are ready, they are re-imported into Kdenlive and integrated with the project. More than likely, a few last-minute revisions will be made by a picky director or the all-knowing producer (they are always all-knowing), but more or less the project is finished. Export it as a lossless Gold Master and compress for your targeted distribution.

Conclusion

GNU Linux has refined its multimedia capabilities to being both user-friendly, flexible, efficient, and stable. It is a realistic platform for post production and content delivery. It is also flexible enough to integrate into an existing non-Linux environment, with many tools such as Blender and Audacity and ffmpeg being completely cross-platform. Start converting your post production process today, and discover true independent filmmaking!

About This Series

The Open Voices ebook series highlights ways open source tools and open source values can change the world. Read more at http://opensource.com/resources/ebooks.

Created with Writer2ePub

by Luca Calcinai