Natron Nodes

Natron Nodes

Article from Issue 219/2019
Author(s):

Natron gives you the power to apply sophisticated effects to your videos, but its node-based interface can be a bit confusing. This tutorial will help you get a grasp on the basics.

Below is the video associated with this article.

Let's get this out of the way: Natron <a href="#article_i1" class="info">[1]</a> is not a video editor. The creators' website says it is "open source compositing software for VFX and motion graphics." This is one of those instances where saying what something is doesn't help understand what it does.

I'm guessing you are okay with the "open source" and the "motion graphics" (aka video clips) part of the definition, right? It is the "compositing software for VFX" that probably needs more explaining. VFX stands for "video effects." As for "compositing", it is just a fancy way of saying "mushing two or more things from different sources onto the same video frame".

Say you have a clip of your kitty, and you want to manipulate it so that it shows her shooting laser beams from her cute little eyes (Figure 1). Waiting for this to happen spontaneously would probably take some genetic or cyborg engineering. Instead, you would be better advised to use some movie-making magic. You could take the clip of your cat (source number one) and then create an animated clip of laser beams, maybe using 3D design software such as Blender [2] (source number two). With both of your sources, you then would use a compositing application to merge them together. That is what Natron does … among many other things.

Figure 1: Of course, kitties shooting laser beams from their eyes is a thing on the Internet.

To recap: In Natron you work with individual clips, merge them, apply effects, and so on. You then paste the clips together to make full scenes in a video editor like Kdenlive [3]. Your workflow takes the following steps:

  1. Raw footage
  2. Compositing
  3. Scene editing
  4. Full movie editing

Getting Started

You'll find Natron in most repositories of popular Linux distributions: if not in the main repos, in specialized or user-maintained ones (think Ubuntu's PPAs or Arch's AURs). Or, you could just use Natron's own installer or Flatpak from the project's page.

Either way, once you boot it up, you'll be presented with a screen similar to what you can see in Figure 2 (see also the "Natron's Interface" box), except you will only see one node, the Viewer1 node, in the Node Graph tab (bottom left).

Natron's Interface

Natron's default interface is laid out broadly into three areas:

1. At the top left is the Preview pane. This is not a static area just for checking on your progress. As you will see later, tools and widgets appear here depending on which node you have selected at any given time. Scroll with the middle button on your mouse to zoom in, or click and hold it to zoom around.

2. Directly underneath the Preview pane is the Node Graph, where a lot of the action happens; you open your nodes here and chain them together to create the effects you need. As with the Preview area, you can zoom in on your nodes by scrolling with your mouse wheel or pan around by clicking and dragging with the middle button. Click on a node to select it; click and drag to move it. Click on an arrow's shaft and drag it to a node to connect the two. Click and drag on the shaft again to disconnect an arrow.

3. On the right, you have the node Properties pane, which is where you adjust parameters, tweak your nodes, and create keyframes. The boxes are piled one on top of the other in no particular order. Scroll up or down to find the one you are looking for, or double-click on a node in the Node Graph area to bring its property box to the top of the Properties stack.

You can move all these elements around to better suit your working style, but regardless of how you end up configuring your layout, I would advise using a big monitor. You are going to need the screen real estate.

Figure 2: Natron with a clip already loaded.

To load your first clip, you need to add an Image | Read node, because everything in Natron is done with nodes. To add the Read node, right-click on Node Graph and pick Image and then Read from the pop-up menu. Or, you could go to the vertical menubar running down the left side of the Preview pane (top left). Either way, once you pick the Read node, Natron will open a file navigation window that will allow you to choose a clip, image, or sequence of images as a source.

To open a video file or static image, just navigate to it, select the one you want, and click on the Open button. To open a sequence of frames, make sure your files are numbered (e.g., frame001.png, frame002.png, frame003.png, etc.). Under the pane that lists your directories in the file navigator, you'll see a drop-down menu with the File option selected. Click that and you'll also see the Sequence option (Figure 3). Click on that, and your list of frames will show up as frame###.png numbered from 1 to 500 (if you have 500 of them). Selecting and clicking Open will bring them in as a single file.

Figure 3: Choose Sequence In the file explorer to load a sequence of frames.

The Read node will appear showing a tiny thumbnail of your clip. Usually, if this is your first clip, it will connect automatically to the Viewer node, and the first frame will appear in the Preview area in the upper half of the window (Figure 2).

Once you have your source and viewer connected, you can start applying effects. Right-click on and try Filter | GodRays, for example. Apart from the node popping up in the Node Graph tab, a bullseye will appear in the center of the Preview area and a new property box shows up for the node in the Properties stack. You can drag and push the bullseye around on the Preview or pull on the handles and radii to make a frame look like it is exploding out from the bullseye's center. You can also use the values in the property box. Try changing the Scale value to 1.2, for example.

The cool thing is that most of what you see in the node's property box is keyframeable. Use the arrows in the Preview player to move to the first frame of the clip. Locate the Scale parameter in the GodRays' property box. Set it to 1 and right-click on the value. A menu will pop up. Select Set Key and the parameter's background will turn dark blue. Congratulations: You have just set your first keyframe (see the "Keyframes" box if you are unfamiliar with what these are).

Keyframes

A keyframe is used to control key moments in a digital animation. You set values for an effect or draw a character in a certain position in one frame and make it a keyframe. If you change the values or draw the same character in a different position in another frame further along in the timeline and make it a keyframe, your animation software will interpolate all the intermediate frames to make the animation look smooth.

Move to frame 50. You will notice that the parameter's background in the property box is a lighter blue. That means it is not a keyframe … yet. Modify the value so it is 1.5, and the background will go to a darker blue indicating that, just by modifying the value, you have created another keyframe.

Play your clip back from frame 1 to frame 50, and you will see how GodRays progressively gets stronger as the video progresses (see Figure 4).

Figure 4: All effects are keyframeable. The Curve Editor shows how you can edit keyframes and tweak how they are connected.

Figure 4 shows another cool feature: the Curve Editor. The next tab to the right of the Node Graph, the Curve Editor tab allows you to adjust the degree an effect is applied to keyframes (represented by a dot on the curve) by dragging them. You can also add more keyframes by double-clicking on empty space on the curve. The new keyframe will give you handles that allow you to adjust the curve.

Also notice how the GodRays' Scale component has two components in the Curve Editor: the x scale and the y scale. You can select and work separately with each – just click on the component you want; it will appear highlighted in orange and, the other components will disappear.

All of these features give you an OCD-worthy level of control over how you want each effect to look at every point of your clip. Being able to highlight the exact effect you want to change is also very useful when you have a lot of them interacting in a complex way (Figure 5).

Figure 5: Click on the components on the left to fine-tune individual aspects of each effect.

Rendering

At some point, you will want to convert your clip into something you will be able to use elsewhere. For that, you use a Write node. Right-click in the Node Graph tab, and choose Image | Write. A file-navigator window will pop up and you can pick the folder and the name of the file you want save in the File text box (Figure 6).

Figure 6: When you add a Write node, Natron asks you how and where you want to save your sequence.

Of course, once the Write node is in place (Figure 7), you can modify things to your heart's content changing the parameters in the node's box in the Properties pane. That said, the safest thing to do here is go with the default configuration. This will create a sequence of JPEG images in the folder of your choice. To make sure Natron doesn't complain, choose a name like frames###.jpg. The ### part of the name will allow Natron to create a sequence of images with names like frame001.jpg, frame002.jpg, frame003.jpg, and so on.

Figure 7: Link the Write node to the last node before the Viewer node.

You should go with the default configuration for two reasons: One is that not all combinations that show up in the Write node property box will work well together. If you change something like the file type, colorspace, and Layer(s), it is quite likely you will end up with empty frames. The second reason is that you don't want to render to an MP4, OGV, WebM, or anything like that, because all these formats use lossy compression codecs. Remember that your output from Natron will usually be going into Kdenlive for the final edit, so the less information you lose from your clips, the better.

Besides, Kdenlive works just fine with image sequences. When you want to load in a new sequence as a clip to Kdenlive, just remember to tick the Import image sequence checkbox in the lower left-hand corner of the file navigator.

If you do want to preview your clip in a video player, FFmpeg makes a short job of converting the sequence with:

ffmpeg -i frames%03d.jpg -r 25 my_clip.mp4

Audio

Once you start exploring Natron, you might wonder where all the audio controls are. Simply put: There aren't any. Natron is exclusively designed for working with video. To synchronize your audio tracks and apply filters, again, you are better served by Kdenlive.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Tutorials – Natron

    Natron allows you to create eye-catching effects and combine different video clips in surprising ways, letting you build up your clips like a pro.

  • Embed Elements into Your Clips Using Natron

    Tracking is good for stabilizing video clips, and it helps you put stuff in scenes that wasn't there in the first place.

  • Slideshows with Kdenlive

    Kdenlive plays to its strengths when editing larger video projects and also helps users create appealing slideshows with impressive effects.

  • Gobbling Up

    Most video editors supply you with a generic catalog of transitions, usually in the shape of tired wipes and fades. But what if you wanted something a little more special? FFmpeg to the rescue.

  • FOSSPicks

    Graham reviews the best free software, including OBS Studio 20, Green Recorder 3.0, gtop, Bitcoin Core v0.14.2, Natron, Solarus, and more!

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News