Blender is primarily known as a 3D modeling and animation application, but as you have seen throughout this book, in truth it is much more than that. In addition to all of its other functionality, Blender also quietly holds the distinction of being the only cross-platform open-source video-editing application worth its salt.
Although Blender is not gunning to replace high-end professional video-editing and compositing suites anytime soon in large studio pipelines, the Blender Video Sequence Editor (VSE) and the corresponding composite node system that you read about in Chapter 9, “Compositing with Nodes,” are more than adequate for many common video-editing and compositing tasks. When the Blender VSE tools are used together, they’re much more powerful than the majority of inexpensive consumer-grade video-editing tools. This chapter shows you how to use the VSE to put your animations, video, sound, and composited scenes together into a coherent whole.
In this chapter, you will learn to
The Blender VSE was originally created to meet the needs of 3D animators who needed a way to edit individual animated sequences together to create a completed whole. Previously, there had been no viable open-source alternative for this kind of work. As the development has progressed, the VSE has begun to come into its own as a viable alternative for many video-editing tasks. Among its advantages is a simple, easy-to-use interface that is fully integrated and consistent with other Blender environments, so it is especially intuitive to use for people who are accustomed to Blender’s hot keys and workflow.
Another very nice quality of the VSE is the ease with which it works with a wide variety of formats and codecs. Because it is not married to any specific proprietary format, it is equally comfortable with .avi files, .mov files, and most other video or image formats, provided you have the appropriate third-party codecs installed. Even high-end proprietary codecs can be easily used by Blender, enabling you to work with professional video formats. This flexibility makes Blender a terrific tool for file-format conversion. No other software makes it easier to output a video as a sequence of stills, or vice versa.
But this is not all there is to the VSE. The VSE is also a fully functional, nonlinear video editor capable of handling multiple video and audio channels and compositing them, both with and without the full backing of the Blender node system. A variety of built-in effects are included in the default installation of the VSE, and it can be expanded even further with external plug-ins, as you will see in this chapter. In addition to all this, the VSE has several powerful visualization tools built in that enable you to see detailed information about the color and luminance distributions of your video for precise adjustments and balancing.
Like all functionality in Blender, the VSE is accessed through a specific Video Sequence Editor window type, as shown in . As always, you can set up your Blender workspace in whatever way you like. The built-in Video Editing screen configuration can be accessed via the drop-down menu shown in . The default Video Editing screen configuration is shown in . Even if you don’t use this configuration exactly as is, it is a good basis from which to set up your own custom configuration.
The windows in this configuration are as follows:
After you have set up your video-editing environment, the first step in working with the VSE is to import a video or image sequence to work with. Do this by moving the mouse over the VSE window and pressing the spacebar to bring up the menu shown in . As you can see from the menu, there are several choices of strip types you can add. For importing new video or image sequences, you can choose the Image option or the Movie option.
If you choose to add an image sequence, a file browser will open, and you can navigate to the directory where your images are and select them all with the A key, as shown in . Image sequences rendered by Blender are automatically numbered, and the numbering is read by the VSE, so ordering is also automatic. Image sequences not created by Blender will also be ordered automatically if they are numbered. Numbering should include leading zeros and be the last part of the filename before the dot.
If you add only a single image, Blender will automatically create a 50-frame sequence from the image.
The process is exactly the same for importing a movie, which can be in any movie format for which you have an installed codec. Either left-clicking or right-clicking the filename and then clicking Select Movie will work. You can add multiple movie files by right-clicking multiple movie filenames to highlight them, as shown in , and then clicking Select Movie. In this case, the two movies will be added on the same channel, one directly after the other, as shown in .
Different kinds of sequence strips are color coded. The colors for the basic input sequences are as follows:
Each type of effect strip also has a distinct color, to make each easier to distinguish when the different types occur together in the editing area.
The frame rate of a video is the number of frames that make up a second of normal-speed play. The frame rate is expressed in frames per second (fps). The most commonly used frame rates are as follows:
Digital video files can come in any of these or other frame rates.
When you add a video to the Blender VSE, Blender calculates the video frame rate based on the frame rate value you have set in the Render properties area, shown in . After you have imported the video, the time spanned by that video strip is fixed. If you change the frame rate and re-render, the number of frames that make up the video will be altered to adjust for the difference.
This is important because it means that you must have the frame rate set correctly when you first import a video. shows the results of importing a movie file with audio at 29.97 fps when the original video was encoded at 25 fps. As you can see, the video and audio channels do not match. You cannot fix this from within the VSE. You must delete the strips and add them again with the correct frame rate.
If you are dealing with a file that you did not create yourself, you may not know what frame rate it was encoded at. You can often find this information by right-clicking the file in the Finder or Explorer, and clicking Info or Properties. You may need to import it more than once to find out which frame rate gives accurate results. You should first try the common frame rates listed previously.
After you have added a video, you can drag it, extend it, or edit it in a variety of ways.
When you add a video or audio strip (or both at once), the strip appears on an empty horizontal channel.
There are three places where a strip can be selected. You can select the entire strip by right-clicking on the middle of the strip. With the strip selected in this way, you can move the strip around the VSE editing area by pressing the G key and moving the strip with your mouse. By right- or left-clicking the arrows at the far-right or far-left ends of the strips, you select only those ends, as shown in . You can then move the ends independently by using the G key, either truncating the sequence or extending the sequence strip. If you extend the strip beyond the length of the original video clip, the extended portion will be composed entirely of frames showing the last frame (if the strip is extended to the right) or the first frame (if the strip is extended to the left). The extended portion will be colored gray, representing a duplicated still frame, as shown in . All three of these possible selections can also be made by pressing the B key and using a box selection method. If the middle of a strip falls within the box area, the whole strip will be selected. If only one end of the strip is within the box area, only that end will be selected.
When moving the full strip around the editing area, you can constrain the movement to a single channel by pressing the G key first and then the X key. Likewise, you can press the G key first and then the Y key to constrain the movement to “vertical” movement from one channel to the other, without allowing the strip to slide along the channels. These are analogous to the x-axis and y-axis constraint hot keys in the 3D space, except that they operate on the 2D axes of the VSE editing area.
You can snap a sequence strip to the current frame, represented by the vertical green bar, by pressing Shift+S.
Other important operations on video strips can be carried out in the Filter panel of the Properties shelf on the right side of the Sequence Editor window (you can toggle this shelf visible and invisible with the N key). In this panel, you can flip the image along the x- or y-axis, reverse the video in time, set a strobe value so that only every nth frame is displayed, run the strip backward, and set several other parameters related to the video strip.
Sequence strips in the VSE occupy numbered horizontal slots called channels. Channels are numbered from zero, with zero at the bottom and the channel numbers increasing upward. Although it appears empty, the 0 channel implicitly contains the final composited sequence, and so you cannot place sequences to be edited in this channel. The VSE Image Preview display mode enables you to select which channel to display, as shown in . Note that when no compositing is involved, the highest-numbered (topmost) channel is given precedence. For this reason, on frames where both sequence strips are present in the figure, the strip in channel 2 is displayed when the Chan value is set to 0 in the Image Preview header.
There are two main ways to cut a strip. The Shift+K key combination cuts the strip destructively at the current frame. This type of cut is destructive in the sense that both of the resulting cut parts are incomplete, exactly as if you cut actual video or film. The K key on its own, on the other hand, cuts the strip nondestructively, in that both of the resulting cut portions are not incomplete; they are merely truncated to the point where the cut was made. You can see the difference between destructive and nondestructive cuts, performed simultaneously on audio and video strips, in . Note that in the nondestructive case, a representation of the continued clip can be seen extending from each cut part to the point where the truncated clip actually extends. (A color version of this figure is included in the book’s color insert.) shows a nondestructively cut video strip with the two parts separated. You can see the continuations of the strips clearly here. Extending the strip by moving the strip end will reveal the original clip.
Strips can be duplicated with Shift+D and deleted with the X key.
Using the Sound entry in the Add menu enables you to import a variety of different types of sound files, including MP3s, WAV files, and the soundtracks of video files. In the Sound panel of the Sequence Properties shelf, you can set the sequence strip to display the audio waveform and adjust other qualities of the sound strip, as shown in . You can also pack the sound file here using the Pack button. When the sound data is packed into the file, it is no longer dependent on the external copy of the file. This panel also contains a numerical field for controlling the volume of the currently active audio strip and another field for controlling the left-right stereo panning of the sound. A 0.0 value in this field represents an even stereo sound, 1.0 causes the sound to come from the right speaker, and –1.0 sends the sound to the left speaker. The Volume, Pitch, and Pan attributes can be hover-keyframed like everything else in Blender.
In the Audio panel of the Scene properties area, shown in , you can control qualities of the complete scene sound and export a sound file of the complete audio mix by using the Mixdown button.
Controlling the volume of an audio sequence strip can be done by typing I over the volume field to enter keyframes, just as with all other animatable fields. When you do this, you automatically add an F-Curve that can be viewed in the F-Curve Editor window, as shown in . If there is no curve in the Graph Editor, you can create one directly in the editor by pressing Ctrl+LMB (left mouse button) to add a curve. If there is a curve already, Ctrl+LMB will add points to that curve.
You can add, delete, and edit markers in the VSE. To add a marker to the current frame, press Ctrl+Alt+M. To select a marker, right-click the marker; to select multiple markers, use Shift+RMB (right mouse button). To deselect a marker, also use Shift+RMB. To toggle between all markers and no markers selected, use Ctrl+A. To delete a marker, press Shift+X. To move selected markers, press Ctrl+G.
The most-used display modes for the VSE are the Sequence display mode and the Image Preview display mode. Three other display modes are available: Histogram, Chroma Vectorscope, and Luma Waveform. These can be accessed by the header buttons and are illustrated in , which is reproduced in color in the color insert of this book.
The Histogram view (lower right in ) enables you to see the correspondence between color channels and luminance levels. Low to high luminance levels are represented from the left side of the graph to the right side, and the number of pixels of each color at each luminance level is indicated by the height of the corresponding vertical bar. For example, a long red bar near the right of the graph indicates that the image has a large number of red pixels with high luminance.
The Chroma Vectorscope view (lower left in ) enables you to see the distribution of colors and saturation in your image. The points around the colored hexagon indicate the color, and the distance from the red dot in the center indicates saturation. Each pixel in the image is represented by a point in the graph. Points near the colored hexagon are the most-saturated pixels. The highly saturated colors in the character’s hair can be seen in a Chroma Vectorscope representation with many points distributed near the edges of the graph.
The Luma Waveform view (upper right of ) visualizes a separate curve representing the luminance (brightness) of each row of pixels in the image. By using View > Separate Colors, you can also see the Luma Waveforms of each of the three color channels, as shown in , which is also reproduced in the color insert of the book.
You can do much more than just cut and paste strips. You can combine and transfer between strips in a variety of ways.
One of the most important compositing features of the VSE is the ability to use alpha overlays. When an alpha overlay is used, the alpha value of the overlaid strip is used to determine the visibility of the strip under it. The alpha values of the overlaid strip range from 0 (transparent) to 1 (completely opaque).
To use an alpha overlay, select two strips in the VSE. The last selected strip is the active strip. With the two strips selected, press Shift+A and select one of the three alpha overlay options from the Add Strip menu. The three options are as follows:
Having these three options for alpha overlays gives you a great deal of flexibility in how you combine strips. Alpha overlays do not depend on the ordering of the channels that the input strips occupy, but only on the order in which the strips were selected.
In , you can see the results of overlaying a PNG image sequence with an alpha zero background over a movie clip. The Image Preview windows along the right of the figure show the contents of VSE channels 3, 2, and 1. The large Image Preview window above the VSE strips shows the final composited image in VSE channel 0.
Alpha overlaying directly in the VSE does not offer all of the control that compositing in the nodes compositor gives you. However, it is a quick and easy way to do basic compositing, and in many cases, it may be all you need.
Transitioning from one strip to the next is done in a similar way to alpha overlays: by creating a new strip for the transition type you want. A commonly used transition is the cross fade, which fades gradually from one sequence to the next.
To create a cross fade, first select the sequence that is being transitioned from, and then hold down the Shift key to select the sequence that is being transitioned to (that is, the order of selection should be the same as the chronological ordering of the sequences, for an ordinary cross fade). Press Shift+A and add a Cross sequence from the Add menu. The Cross strip will extend over the length of the overlapping portions of the two original sequences, as shown in . The transition will occur over the course of the Cross strip. In the Image Preview windows along the right of , you can see previews of VSE channels 3, 2, and 1. The main Image Preview window above the Sequence Strip Editor shows the fully composited image from channel 0.
Gamma Cross behaves like Cross, except that it also performs gamma correction on the output image, which can result in improved color and luminance balance.
Wipes are another way to transition from one sequence to another. Wipe strips are added in exactly the same way that Cross strips are added, as shown in . Wipes enable somewhat more complex transitions than fades. You can choose the type of wipe you want to use from the Effect Strip panel in the Properties shelf.
You can also set a level of blurring to soften the line where the two sequences meet and the angle of the wipe, where appropriate. The four types of wipes are as follows:
shows each of these wipe types with a blur value of 0.20.
A cross fade can be used to fade to black or another solid color. Add a color strip by pressing the spacebar and selecting Color from the Add Effect Strip menu. The strip is black by default. Change the color of the strip in the Effect Strip panel on the Properties shelf. Click on the color field to open a color picker, as shown in , and choose the color you want to fade to. Add a Cross strip as shown in to fade from the video sequence to the color strip.
You can transform the dimensions, offset, and rotation of the video and animate the transformations by means of a Transform strip. Select the video strip you want to transform and add a Transform strip to it from the Add Effect Strip menu. The transformation itself is controlled in the Edit Strip panel of the Properties shelf, as shown in .
In , you can see the results of animating the transform values. The F-Curve for the rotation is shown in the F-Curve Editor.
In addition to alpha overlay, there are other options for overlaying video. You can do an additive, multiplicative, or subtractive overlay by using the Add, Mult, and Sub options in the Add Sequence Strip menu. These overlay methods carry out the corresponding operations on the input strips.
The Glow effect adds a blur to highlights of the image with luminance levels above a particular threshold. The effect is shown in . The threshold, size of the glow, and other parameters of the glow can be set in the Effect panel, and the intensity of the glow can be animated.
In order to keep your editing area uncluttered, it is possible to combine multiple strips into single meta-strips. To do this, select the strips you want to combine and press Ctrl+G to create a meta-strip. You can unpack a meta-strip by selecting it and pressing Alt+G.
In addition to video and image sequences, you can create sequence strips directly from Blender scenes. This makes compositing 3D animations very easy. Moreover, in addition to ordinary 3D scenes, you can use scenes composited with the node system, enabling you to bring the full power of the node system to bear directly in the VSE.
A simple but useful method of adding captions or subtitles to a video is to use Blender’s 3D text and the flexibility of the 3D window to place the text and to composite it over the video in the VSE. To add a caption to the video file end_zone_clip.avi on the website in this way, follow these steps:
Using a scene composited with nodes as a sequence editor strip works exactly the same as using an ordinary 3D scene, except that the composited scene should have the Compositing option set in the Post Processing panel of the Render properties area. The content of the strip will be whatever is output in the Composite node of the node system.
To render a finished sequence, you must select the Sequencer option in the Post Processing panel in the Render properties area, as shown in . When this is selected, the final render will come from the VSE rather than the 3D view camera.
As is always the case when rendering animations, you have various choices in the format to render to. You can render to still frames or to video. When you select a video format to render to, a new Encoding panel appears in the Render properties window. From here you can select an audio codec to render with; the default, None, includes no audio, but changing it to something like MP3 or Flac will include audio. What is best for you depends on the codecs you have installed and other features specific to your operating system. I have found that selecting Xvid-encoded video and MP3-encoded audio with the Multiplex audio option does a very good job of outputting synced sound and video .avi files on both Mac and Windows. Do some experimenting to find out which combination works best for you.
You can also add text burn-ins to your video by checking the check box on the Stamp panel, as shown in . Selected information will be stamped automatically onto the upper-left corner of your video.
Rendering edited video with mixed sound is one of the last stages of creating movies, but there is much more to learn about Blender. In the next two parts of this book, you will learn how to automate tasks and build tools by using Python scripting and how to create interactive content by using the Blender Game Engine (BGE).