Note
This tutorial is for video created by the Pentax Optio W10, W20 or W30.
It will have to be modified for the Optio W60, that generates differemt types of video files.
This page explains step by step how to stabilize and rotate a video shot with a KiteCam system. 3 methods of different levels of complexity are proposed. Choose the one that fits your skills, time and resources you are willing to spend on making your kitesurfing videos look good.
Many Video Editing programs exist out there, Final Cut Pro (Mac only) is excellent, Adobe Premiere (Mac, PC) is really good too. Feel free to use them if you have access to them and are comfortable using them.
In this tutorial though, we will focus on a very basic one, affordable and easy to learn and use for everyone : QuickTime Pro (US$30 for the upgrade, PC and Mac).
We can also use QuickTime Pro (version 7.2 and up) to do basic 180 degree rotation of the video, whenever the ocean gets upside down.
For video stabilization, we will use the free program VirtualDub and free plug-in DeShaker (PC only. Sorry for Mac users, they can try to use iStabilize but I have no experience with it).
Note
In this tutorial, what is refereed to as the 4Gb video file is the original movie, usually named something like IMGP1835.MOV, untouched and coming straight from your SD card after shooting with the Pentax camera. If your original file is smaller because you shot for less than 1 hour or your SD card is only 1 or 2 Gb big, the process is the same.
Feedback
If you have comments or correction to suggest about this tutorial, please let me know.
Trimming down these huge 4Gb movie files
After having shot a few 1 hour movies with your KiteCam system, you might be wondering what to do with these huge 4GB files taking so much space on your hard-drive, barely watchable, and with often only a few minutes or seconds of interesting action here and there.
If you are not comfortable with video editing and not equipped for it, I would recommend getting QuickTime Pro ($30 for the upgrade).
This tool is great for basic digital video manipulation, conversion and editing with one single track. Powerful, yet intuitive and simple to use.
When you upgrade the basic free Quicktime to the Pro version, you get many extra features, including 2 additional cursors in the timeline to define range of your video clip.
Shortening your 1 hour movie down to its most interesting minutes or seconds becomes easy and quicker than with many other editing programs.
Select a continuous portion of unwanted video (hit [i] for the in point, [o] for the out point)
Cut it out. (Ctrl + X)
As the length of your movie reduces, the positioning of the cursors on the timeline becomes easier and more precise.
Tip1: When you start with a large file (1 hour long), you can already get more precision in the timeline by maximizing your QuickTime window. ( hit [Ctrl + 2] to double its size)
Tip2: You can mark the in and out points from the main cursor by hitting the Hotkeys [i] and [o]. Then, [Ctrl+X] to delete. (Check QuickTime Help page)
Tip3: Use the right and left arrow keys on your keyboard to go to the next or previous frame.
Tip4: This work can take a while, so when you want to take a break, Save as a referenced movie (small file and fast to save) your work-in-progress, close QuickTime, and re-open the referenced movie next time you go back to it.
When you are done trimming down your movie to the duration you want, only keeping its best moments, save it (Save As.. a self contained movie).
Combining movies together
If you want to insert another movie file in your current one, position the cursor where you want the other movie to start, drag and drop it from a Windows browser into your QuickTime Pro window.
Saving your file
Several ways to save your file:
Save as a referenced movie if you want to save work-in-progress. It's a small file (less than 1mb usually) and get saved instantly. Next time you'll open it, you will need to have the original video file still available.
Save as a self-contained movie, might take a little longer and the file size will depends on its duration (a few 100s of mb for a few minutes..)
Export as a QuickTime .mov file if you want to select a specific codec (Example : Sorenson3, or H.264, as used by your Pentax camera).
Export a .avi movie file, (Windows Media Player format) needed for VirtualDub.
A codec available by default on any Windows PC and settings that will preserve a decent quality are :
Indeo Video 5.1, Best quality, no key frame and no Limit data rate.
Of course, if you have access to other editing programs, feel free to use whatever you are comfortable with.
Quicktime Pro (version 7.2 and up) has a feature to rotate the video by +90, -90 or 180 degrees.
In QuickTime Player, choose Window > Show Movie Properties.
In the Properties window, select a video track
click Visual Settings.
To rotate the movie to 180 deg, click twice one of the rotate buttons.
Unfortunately you can only apply this rotation to the whole movie loaded in your QuickTime window, and not a selection.
In order to apply this rotation only where it is needed, you will have to :
create a first trimmed down clip with all the good parts from the original 4Gb video that are upside down, rotate it by 180 degrees, and save it as a referenced movie.
load again the 4Gb video into QuickTime, trim it down to all the good parts that are not upside down,
import the upside-down referenced movie by dragging from a Window's browser and dropping it over the QuickTime window,
you might have to adjust the offset to 0 x 0 for all video tracks in the Show Movie Properties window,
For the intermediate and advanced methods, we will use CamRig scripts with VirtualDub and deShaker to stabilize the image (this does not totally correct the rotation, but smooth the camera shaking very efficiently).
The whole software package can be downloaded here for free :
For Windows XP, 2000, (Please let me know if someone tries it successfully on Vista).
Not available on Mac, sorry.
Installation
Create a folder (named stabilization for instance) in which you unzip the content of the stabilization zip file.
You will get 2 sub folders :
a folder named VirtualDub-1.7.6 in which you have among other other files, VirtualDub.exe that you will launch each time you want to stabilize a movie. Feel free to create a shortcut for this application.
FYI, in the sub folder named plugins, you have the version 1.8 of deShaker.
a folder named CamRig, with 3 camrig scripts (.jobs) and an example of movie file (input.avi)
Upgrading New versions of VirtualDub and deShaker get released every now and then.
Still,
the purpose of this package is to avoid having to download too many files from different location and figuring out how to make them work together. These camrig scripts work fine with the versions of VirtualDub and deShaker provided in the stabilization.zip file. and should get you starting quickly.
Feel free to upgrade with more recent versions when they come out but you might have to modify yourself the camrig scripts accordingly.
Disclaimer
These programs and scripts are provided for free and as is.
Use at your own risk.
No support is guaranteed at this time.
Usage VirtualDub only accept .avi movie files. So you will use QuickTime Pro to generate an .avi version of your video.
After having trimmed your 4Gb movie file down to a few minutes/seconds, save it as a referenced movie and keep the original 4Gb file for a while in case you need to go back to it.
Export it also as a .avi file, name it input.avi.
A codec available by default on any Windows PC and settings that will preserve a decent quality are :
Indeo Video 5.1, Best quality, no key frame and no Limit data rate.
Place your input.avi file in the CamRig folder. (When you first unzip your package, a small input.avi file is there as an example. Feel free to overwrite it or use it for testing).
Open VirtualDub.exe, go to the File > Run script... and select one of the CamRig .jobs scripts. (See below which script to use for which method).
VirtualDub will look for a file named input.avi in the CamRig folder, load it and compute for a while by itself. It can take several hours, depending on the speed of your PC and the length of your .avi file.
This process goes through 2 phases. The first one does not display much (display is turned off to save computing time and disk space). The second one shows your stabilized movie being generated.
You can display a progress window during each phase. Go to View > Show status window.
When it's finished, you can close VirtualDub.
You will find in the CamRig folder a dummy.avi file that you can delete or ignore, and your stabilized movie file named output.avi.
This output.avi movie will start with 1 second (30 frames) of black frames with the white text "Deshaker, Output is delayed 30 frames, blablabla....". You will have to remove these 30 frames in QuickTime Pro.
Also, the last 30 frames of the input .avi are lost in the output .avi, so add 1 second of extra video at the end of you input.avi when you edit it with QuickTime Pro.
Intermediate method : Stabilization and 180 rotation (deShaker and QuickTime Pro)
This method is the combination of Stabilization with deShaker and the Basic method (180 rotation with QuickTime Pro).
Trim your 4Gb file with QuickTime Pro, (add 1 extra second of video at the end of your editing)
Export an input.avi file and run the script camrig640_1.0.jobs with VirtualDub, as explained above in Stabilization.
Open the stabilized output.avi file into QuickTime Pro, and correct the rotation where needed, as explained in the Basic method,
Save as a self-contained movie or Export as a QuickTime .mov file.
The script camrig640_180rot_1.0.jobs is available in case you can not do the 180 degree rotation with QuickTime Pro. (Here again the whole movie only is rotated by 180 degree.)
Advanced method : Stabilization and any rotation (deShaker and After Effects)
This method combines as usual QuickTime Pro to trim down your 4Gb file, deShaker to stabilize and finally After Effects to animate the rotation "by hand".
Trim down your movie with QuickTime Pro (no need to sort what is upside down or do any 180 degree rotation at this point).
Export an input.avi file and run the script camrig1000_1.0.jobs with VirtualDub, as explained above in Stabilization.
You will get a stabilized output.avi movie file at the resolution 1000 x 1000.
The reason for this oversized video is to make sure no borders of the 640x480 input avi are getting cropped out as deShaker is moving it around.
Import your stabilized file output.avi into After Effects,
create a Composition for it, same length (minus the 30 frames/1 second of black frame at the beginning), but resolution 640 x 480,
Create keyframes for the output.avi layer at each frame where the vertical/horizontal needs to be adjusted (rotation) and where the kitesurfer needs to be re centered (translation).
Depending on the kitesurfing action, you can have to create as much as 1 key every 20 frames or even more if you get very picky and into it.
It gets specially intensive for wave surfing actions, where the kite keeps going left and right on each turn.
Work flow with After Effects 7.0
a) Import output.avi into After Effects
(drag and drop from a Window's browser, or choose File > Import )
b) Drag it onto the "Create New Composition" icon
c) A new composition named Timeline output appears with the same length and resolution as output.avi, and output.avi is created as a layer.
d) Open the composition settings window and set its resolution to 640 x 480 (instead of 1000 x 1000)
e) Set the in point to -00:30 to get rid of the 30 black frames at the beginning of output.avi
f) Use the Time Controls window to play forward, backward, frame by frame or in real time (which launches a local rendering before)
g) Move the time line cursor to a frame where the image needs to be repositioned
h) Rotate the image if needed
i) Translate the image if needed
j) The edges of output.avi is displayed and moves as you translate and rotate it
k) Try to recenter the image to hide the black borders due to the stabilization
l) Create/add keyframes for rotation and translation
m) Adjust the display of the time range, by zooming in and out into the duration of the clip
n) Move your keys in time if needed.
Render out your composition. (here again, you can save as a QuickTime .mov file, Sorenson3 or H.264 codec for instance)
Note
This tutorial does not explain in details how to use After Effects.
For more information, please refer to its user manual and help pages.
You can also find After Effects tutorials for beginners on youtube.com.
Adding music to your video (QuickTime Pro)
Another cool feature of QuickTime Pro will let you add music over the video.
Open your "final" edited/stabilized/rotated movie file into a first QuickTime window. Let's assume it is 2 minutes long (02:00),
Open the audio file into another QuickTime window. Let's assume it is 3 minutes long (03:00).
Set the input cursor to 00:00 and the output cursor to 02:00 on the audio window,
Hit Ctrl + C (or go to Edit > Copy ) in the audio window,
Set the time cursor where you want the music to start on your video QuickTime window. Let's say at the beginning (00:00)
Go to Edit > Add to Movie . You should now be able to play the movie and hear the music.
If your video still had the original sound from the 4Gb file (wind blowing in the kite), you might want to turn off the Sound Track 1 in the Properties window. (go to Window > Show Movies Properties )
Save as a self-contained movie or Export as a QuickTime .mov file.
Note
If you post your movie on youtube.com, they have a selection of music available, free of copyright, that you can use to replace whatever audio you might have on your movie. You can do this replacement directly on their web site, instead of doing it in QuickTime Pro.