logo

hof.gimp.org (pre)

GIMP 2.2

GIMP Animation Plug-in: Video Editing

This tutorial shows a video editing example, using plug-ins provided by the GIMP-GAP package. The goal of this tutorial is selecting an object in one movie and mount the object to another movie. The tutorial shows advanced usage of the GIMP-GAP plug-in "Move Path", using object movements, scaling, selections and the bluebox effect. Some knowledge of TheGIMP is required.

The original is a short movie clip (by Carol Spears) that shows the mobile sculpture "Solar System IV". The destination background movie will be created from one single image. This image (by Wolfgang Hofer) shows a tree viewed against the autumn sky.

Step 1  Extract frames from the original movie

Use the GIMP menu: Xtns->Splt Video to Frames->Extract Videorange

a) Videofilename:
Select the animation file to be extracted (the button "..." opens a filebrowser dialog window)
b) From Frame: and To Frame:
Select a range of frames to extract. In this case, frame 97 through frame 219 are selected. Using the Video Range button will give you visual navigation through the file to help you make your selection.
c) Track Numbers
Videotrack:1, is the default. Audiotrack:0 will tell the videorange plug-in to ignore the audiotrack.
d) Basename:
This is the first few characters in the names of the images that make up the frame stack. The default is frame_ in this example, it has been changed to sol_
e) Digits:
Part of the names of the images in the frame stack; 6 is the default setting.
f) Extension:
xcf is the default and a good one. Saving as xcf gives you all of those gimp things if you need them including layers and layer masks, guides (which have always been in the free version of gimp) as well as text tool information and selections. Some of the encoders require different formats before they can work (to put an animation back together again); you can always get this format out of an xcf.
g) Framenr:
For "frame number part" in the filename for the first extracted frame. Setting this to 0 makes the original frame number the first number (in this case, 000097); setting it to 1 makes 000001 the first filename number in the stack.

Pressing the OK button will extract frames 97 up to frame 218 from the videofile and save them as a sequence of separate XCF image files with the names of sol_000001.xcf through sol_000122.xcf.

Click on the "Video Range" button tor a screenshot with visual range selection
duplicate_frames

Step 2  Create empty target frames

Now we create 122 target frames, in the same size (320x240 pixels) as the 122 extracted movie frames. Use the GIMP menu >File->New and >File->Save As and call this new image filename:sol_blu_000001.xcf

Then we invoke the gap dialog: Video->Duplicate Frames from the image sol_blu_000001.xcf, and request that 121 duplicate frames be made.

Pressing the OK button duplicates that frame 121 times. All of these frames have now only one white layer with the name "Background"

Step 3  Render the backround frames

Now open the source image autumn_sky.jpg. At this point there are 3 images opened in your GIMP session. Here you can see a snapshot of my desktop at the point before I started to work with the GAP plug-in MovePath.

To get more life into the scene, we do not show the background as static image. We use some scroll and zoom effects to present that image as moving background. Some people call this technique "Ken Burns" animation style.

In this step we copy the big autumn_sky layer to all the target frames (image sol_blu_000001.xcf upto image sol_blu_000122.xcf). The copies of the autumn_sky layer will be done with varying postion (scroll effect) and varying size (zoom effect). To avoid an immense waste of memory, the copies are clipped to destination frame size.

We will use a simple path that has 2 controlpoints and describes only one horizontal line.

start
move_path_BG_01

Invoke Video->Move Path from the image sol_blu_000001.xcf (this is the first of the target frame images)

In the Move Path dialog window set the Parameters:

a) Source Image/Layer:
autumn_sky.jpg/autumn_sky (from the menu)
b) Stepmode:
None
c) Clip To Frame:
Set to Checked state
d) Click the refresh button
to update the preview

button_add_point Now click the button "Add Point" to create a 2.nd controlpoint.

The Current Point information will change
from "[1] [1]" to "[2] [2]" indicating that the 2.nd control point out of 2 total control points is now the active control point.

e) X:
Set the spinbutton X: to value -800. This defines a simple path with one horizontal line from controlpoint [1] coordinates 0,0 to controlpoint [2] coordinates -800,0.
f) Y:
Now change the Width and Height spinbutton from 100 to 70. (by default both spinbuttons are linked and the other value will follow automatically) This will scale the inserted copy of the autumn_sky layer down to 70% size at contolpoint 2. Since we have 2 controlpoints the controlpoint [1] will affect the copy of the autumn_sky layer  in the first handled frame (100% in frame 000001) and the controlpoint [2] will affect the copy of the autumn_sky layer in the last handled frame (70% in frame 000122). For all the frames inbetween a linear interpolated value will be used.

button_refresh Once again click the refresh button to show the expected results of the current controlpoint [2] in the preview.

button_ok Now MovePath is ready to go, we can engage the OK button to start rendering.

move_path_BG_01
initial_selection

Step 4  Prepare selection in mobile sculpture frame 1

All the frames of the mobile sculpture (sol_000001.xcf upto sol_000122.xcf) show the spinning mobile at center, and other objects that should not appear in the final video, in the outer regions.

Step 5  Render the mobile sculpture in the foreground

In this step we use the initial selection and the blubox effect to isolate the spinning mobile. We need just one controlpoint because all copies are done at the same position and all effects will be applied with fixed controlpoint settings on all handled copies. One more thing to notice that the source image is a sequence of frames this time. Therefore the Stepmode optionmenu is set to value "Frame Loop" to tell the Move Path plug-in that the source objects are treated as composite views of a sequence of source frames (rather than stepping the layers in one multilayer source image)

Again invoke Video->Move Path from the image sol_blu_000001.xcf. In the MovePath dialog window set the Parameters:

a) Source Image/Layer:
sol_000001.xcf/Frame00097 (select this layer in the option menu)
b) Stepmode:
Frame Loop
c) Tab: Selection Handling
set the parameters:
  • Use selection (from initial source image)
  • Select Feather Radius: 10.0
d) Clip To Frame:
Set to Checked state
e) click the refresh
button to get a first preview
move_path_SELECTION

Now click the "Advanced Settings" tab to adjust the settings of the bluebox effect. The bluebox effect makes the keycolor and similar colors transparent by modifying the alpha channel of the handled layer. Similar colors are defined via threshold values.

Set the Bluebox checkbox active and press the Keycolor colorbutton. This will open the Bluebox dialog window. In the Bluebox dialog select a Keycolor that matches the blue sky. You can use the color picker Tool in the GIMP main window to selct the foreground color, and then RIGHT-click the Keycolor colorbutton. That way you can copy the foreground (or background) color as Keycolor into the colorbutton. Then adjust the threshold values for Hue, Saturation and Value. If you activate the Automatic Preview checkbutton, the blubox plug-in creates a BlueboxPreview image for instant feedback. Press the OK button in the Bluebox dialog to pass the settings to the calling MovePath dialog window.

invoke_bluebox
bluebox_Settings bluebox_preview

The bluebox plug-in creates  a new image named "BlueboxPreview.xcf" just for preview purpose. You may close that image when done or whenever you want.

Once again press the refresh button in the MovePath dialog window to show the expected results.

button_refresh

The MovePath preview now shows the selcted part of the mobile in front of the autumn_sky background. The original (darker) blue sky is filtered out by the blubox effect.

Below you can see the preview how the mobile looks over the last frame122.

move_path_preview
move_path_BLUEBOX

Now we have made all the required settings and can press the OK button to copy the spinnig mobile from all 122 source frames to all 122 destination frames, respection both the initial selection and the bluebox effect.

The resulting frames can be re-encoded as videofile with the menu Video->Encode->Master Videoencoder.