Dirk Bertels

The greatest malfunction of spirit
is to believe things (Louis Pasteur)

Video Editing using free software

Index

Introduction
Video Basics and Terminology
Free Video Software
How to edit a DVD and burn back to DVD
More advanced Video Editing - Method 1
More advanced Video Editing - Method 2
More avisynth scripts
Supplementary Notes

Introduction

Though not a great video buff, I have come accross the necessity of editing video several times. My first experience with video was in producing the Bach videos. These videos were recorded with a simple web camera using MS window's 'Amcap' program for capture. I also had to purchase different, affordable, software for editing and DVD burning, and ended up using Video Edit Magic and Blaze Media Pro, which did the job quite well.

Soon after I needed to create a demonstration video for work to illustrate the use of our Retinal camera. Since it was for the web, the video recording was done using a standard digital camera in 'video mode' and direct video capture of the retinal camera's video screen. Using Avisynth (more on that later) I managed to overlay one video over the other, apply fades, scroll text, create header text and image overlay. Since then I have edited a few videos.

By then I had come across the powerful combination of Virtualdub and AviSynth: the first one being a video editor, the latter a 'frame server', which is a script writer that stands between the programmer and the actual clips. It allocates functions to the clips rather than actually altering the clips themselves. This greatly increases efficiency. In other words, if you can handle some basic script programming, this is a much more powerful way of editing videos...

Video Basics and Terminology

Understanding the various concepts and technologies on video is an art in itself. I found a valuable resource at Anime Music Videos. Absorbing as much as you can from there will greatly enhance your understanding and help you in following the procedures I will outline later on. For now, here are the most fundamental concepts used in video:

Compression

The compression process uses algorithms that enables one to use less memory to store video. Some compression schemes are:
  • MPEG1
  • MPEG2 (DVD quality)
  • MPEG4 (DivX3.11, DivX4/5, XVD, Quicktime Mpeg)
  • DV (DVCAM, DVPRO50, DVCPRO, DigitalS)
  • WAV, RealVideo, Sorens, Indeo,Cinepak

Decompression

Algorithm that can convert the compressed video back to its original state.

Codec

The combination of Compression and DEcompression.

Format

Describes how information is stored. E.g. AVI, Quicktime

General Notes

  1. Some Codecs are also formats: MPEG, ASF
  2. The limitations of a format must be adhered to in a Codec. E.g. MPeg4 implementation for AVI is incomplete.
  3. Some CODECS are good for distrubution (AVI, MPEG1)
  4. back to index

Free Video Software

Manipulating video is quite a complex issue. There's no 'one' software that can handle all the various stages from capture to production. There are mainly three stages in the video process:

  1. Video Capture SW - comes with the video camera or capture.
  2. Video editing - DGIndex, Avisynth, VirtualDubMod.
  3. Video conversion for production - FAVC
The following is a list of the software I used. They're all free, widely used and as a consequence the software gets updated regularly as technology advances.

DGIndex

DGIndex, part of the DGMPGDec package, is primarily designed to create an index of an MPEG video stream, containing the location of each frame in the input stream, and some additional information about each frame. This index, or project file, is used by the companion Avisynth filter DGDecode to provide frame-accurate serving of the video via an Avisynth script. DGIndex is able to decode and index most MPEG1/2 streams including elementary streams, program streams, VOBs, VCDs, SVCDs, PVA files, and transport streams. Additional features include: video demuxing (m1v/m2v), audio demuxing (ac3, dts, aac, mpa, and lpcm), optimized iDCTs, luminance filtering, cropping, and more.

Avisynth

AviSynth is a powerful tool for video post-production. It provides ways of editing and processing videos. AviSynth works as a frameserver, providing instant editing without the need for temporary files. AviSynth itself does not provide a graphical user interface (GUI), but instead relies on a script system that allows advanced non-linear editing. While this may at first seem tedious and unintuitive, it is remarkably powerful and is a very good way to manage projects in a precise, consistent, and reproducible manner. Because text-based scripts are human readable, projects are inherently self-documenting. The scripting language is simple yet powerful, and complex filters can be created from basic operations to develop a sophisticated palette of useful and unique effects.

VirtualDubMod

VirtualDub is a video capture/processing utility for 32-bit Windows platforms (95/98/ME/NT4/2000/XP), licensed under the GNU General Public License (GPL). It lacks the editing power of a general-purpose editor such as Adobe Premiere, but is streamlined for fast linear operations over video. It has batch-processing capabilities for processing large numbers of files and can be extended with third-party video filters. VirtualDub is mainly geared toward processing AVI files, although it can read (not write) MPEG-1 and also handle sets of BMP images. VirtualDubMod is based on the famous video editing software VirtualDub by Avery Lee. Born as a unification of several existing modifications, a lot of new features have been added, including support for the matroska container format. Some pitfalls: Often need to restart the SW.

FAVC (includes ImgBurn)

FAVC is a video to DVD authoring tool. You can feed it various video formats asf, avi, avs, mkv, mov, mp4, ogm, vdr and wmv) and it will convert them to a DVD folder or image, ready for burning. It gives you the option to use QuEnc or HC as the MPEG-2 encoder, and will even create a simple menu for you that you can customize. Is really a suite of SW, including ImgBurn, Subtitle creator SW, etc.

back to index

How to edit a DVD and burn back to DVD

This is possibly the most popular question in the field of video. Luckily you can do all of this using the free software mentioned above. Following is a detailed outline of the procedures:

Step 1: Preparation

Look at your DVD files on your PC (don't 'play' the video, but 'open' it). A good free SW that can play DVDs on your computer is VLC. You can just open the VOB files with it.

VOB:
When opening up a DVD file, you often see the file extension VOB (Video OBject). This is a so-called container format which is based on MP2. So much that you simply can change the file extension to .mpg and still play it.
The VOB file uses MPeg2 but with additional limitations and specifications. It contains the actual Video, Audio, Subtitle, and Menu contents in stream form.

Create a folder in which you will put all your files. To start with copy your DVD's VOB file(s) in it.

Step 2: Open DGIndex

In short: DGIndex does what it says, it indexes the video file, like creating a file that has pointers to the actual video file. This makes editing much more efficient.

See this article if you want a more detailed overview of the following procedure or investigate all the different options available.

Step 3: Load VOB files into DGIndex

Load all the VOB files (File -> Open), and sort them into the proper order using the up/down buttons. Pres F5 to play the video as well as see the information.
Record the important data.
The following settings suit most situations:

  • Audio->output Method->decode AC3 track to wave
  • Video->field operation->honor pulldown flags

Step 4: Save the project

File -> save Project

Save in the same folder as your VOB file.
Now you have 2 additional files, a WAV audio file and a DV2 video index file

Step 5: Edit with Avisynth

Now we will use Avisynth to use these files for editing. You will need to get familiar with avisynth in order to edit your video. Good sources are the Videohelp Forum and the Avisynth Website.

Having installed avisynth, look at the following script. This one simply selects a particular range, applies fade -in and -out, and synchronises the audio with the video (which was 0.3 seconds out).
It loads the MPEG2 decoder, the audio and video and does some operations to it, such as only selecting a particular range, and synchronizing the audio with the video and fading. Create a similar script for your video. Depending on what information you gathered from DGIndex, your video may not be interlaced, etc. Interlacing is an important issue when it comes to editing and you should understand why this is so.

# Replace directory with the path to DGDecode's MPeg2 decoder
LoadPlugin("C:\Program Files\DGDecode\DGDecode.dll")		
# Replace directory with the path to your video file
video = MPEG2Source("PATH TO YOUR SOURCE\VTS_01_1.d2v")
# Replace directory with the path to your audio file
audio = wavsource("PATH TO YOUR SOURCE\VTS_01_1 T80 2_0ch 256Kbps 48KHz.wav")
# Combine your video and audio
audiodub(video,audio)
# Adjust synchronisation if necessary
DelayAudio(-0.3)
ConvertToRGB32(interlaced=true)
#Select the particular range you want to keep
Trim(0, 8865)
FadeOut(80)
Reverse.FadeOut(50).Reverse 

My script was called 'Stateline Documentary.avs'.
Right click on the avs file and open with VirtualDubMod. If the script is ok, there should be no problems. If not, VDM may not bother to let you know and simply won't start up.

Step 6: Burn to DVD

This uses the FAVC software. A good link can be found at Digital Digest.

The FAVC GUI is self-explanatory. As a general rule, don't touch any settings you don't understand. The main considerations are:

1 - If you want a DVD menu (for navigation to chapters). You can supply the path to the image you want as a background for this menu.

DVD Options -> Background Menu Image

2 - Whether you want an ISO file or burn to DVD directly.

Click 'Generate DVD' (this will take a while) - A new window HCenc will start up and show information as well as the progress status.

Notes:

  1. Make sure to give it the right paths etc, for example, if you have the wrong path to the BG image for the menu, it will go through all the hassle of encoding the video and bom out just before it finishes.
  2. Burn to a R/W DVD to check the quality.
  3. None of the files added to the folders are big! All editing is done by applying functions to the original video - no local copies need to be generated in order to do so. You can envisage this by imagining that in playing the video, avisynth uses the index file created with DGIndex to access each frame in turn and apply the range of functions to it outlined in the avisynth script (the avs file).
    FAVC in turn uses the avs file to convert to the MPEG2 format necessary for DVD and burn it to disc. It is easy to see that this is a very efficient way of editing. Altering single lines can greatly alter the edited video without the necessity for large amounts of memory.

back to index

More advanced Video Editing - Method 1

The editing we have done so far has been very rudimentary. This chapter gives a more detailed account of Video editing. It focuses on converting video from tape into separate audio and video files, mixes them back together, selects relevant passages from the clips, splices them, and finaly adds intro and outro images with background audio.

1 - Preparation

Here's a simple video edit procedure that illustrates the stages you need to go through. I have some video material (very badly recorded) from which I want to make a little demo video.

There were initially about 12 files (about an hour's worth) from which I needed to take samples for a total of about 4 minutes.

The files were saved to a PC from a camcorder tape using the SW that came with it. I ended up with about 12 files (one for each song) with a .DAT extension. I could see and hear the video using VirtualDub. I used this to check which songs I wanted to take excerpts from - I decided on songs 1, 3, and 6. I also took note of which frames I wanted from each song - and came up with this list:

  • #1 - Frames 270 to 1371
  • #3 - Frames 453 to 3470
  • #6 - Frames 1468 to 3300

2 - Split files into Video and Audio with DGIndex

I want to split these video files into separate video and audio files. This enables me to edit the audio with Audacity (in case it's needed). We will not do this, but it's good to have the option in case I want to edit the audio later on.

I took the first file and opened it in DGIndex. After pressing F5 I could see the video and file information but couldn't hear the audio. But after saving it (File -> Save Project) I ended up with 2 files, one being a video index file (with a d2v extension), the other one being the audio file (with a .mpa extension). I checked this audio file with Audacity - and it proved to be all there ...

I did the same for the other 2 songs. Resulting in a total of 6 files (there were some extra ones but these are not relevant to us). I stuck these in a folder called 'DGDecode'.

3 - Create a movie from the 3 excerpts sliced together with Avisynth

Time to write an avisynth script that plays the 3 excerpts one after the other using the alignedSplice function. Here is the code with added comments to make it self-explanatory.

 # ---------------------------------------------------
 # Load DGIndex's plugin for Avisynth 
 # (make sure path is correct)
 # ---------------------------------------------------
 LoadPlugin("C:\Program Files\DGDecode\DGDecode.dll")

 # ---------------------------------------------------
 # Open DGIndex files
 # ---------------------------------------------------
 # Song 1: Abuklualo
 video_01 = MPEG2Source(".\DGDecode\AVSEQ01.d2v")		
 audio_01 = MPASource(".\DGDecode\AVSEQ01 T01 DELAY -6ms.mpa")
 
 # Song 3: Nyiir Akvo
 video_03 = MPEG2Source(".\DGDecode\AVSEQ03.d2v")		
 audio_03 = MPASource(".\DGDecode\AVSEQ03 T01 DELAY -6ms.mpa")
  
 # Song 6: Tita
 video_06 = MPEG2Source(".\DGDecode\AVSEQ06.d2v")		
 audio_06 = MPASource(".\DGDecode\AVSEQ06 T01 DELAY -6ms.mpa")
  
 # ---------------------------------------------------
 # combine video with audio
 # ---------------------------------------------------
 clip1 = audiodub(video_01,audio_01)
 clip2 = audiodub(video_03,audio_03)
 clip3 = audiodub(video_06,audio_06)
 
 # ---------------------------------------------------
 # Trim the clips to its proper sections
 # ---------------------------------------------------
 clip1 = clip1.Trim(270, 1371)
 clip2 = clip2.Trim(453, 3470)
 clip3 = clip3.Trim(1468, 3300)

 movie = alignedSplice(clip1, clip2, clip3)
 return movie

This script should be self-explanatory. Go to the Avisynth help file to find more detailed explanations of each function.

Save this file with an .avs extension and open with VirtualDub. It will play the video excerpts one after the other. How's that for a start ... note that no new files are created, the script applies functions to the original video (via DGIndex's index) on the fly - this is invaluable especially where large files of quality video are concerned (using up more than 1GB per minute).

From now on we can simply go to Tools -> Script Editor to edit the files further. After each change, simply press F5 and the script will be saved and virtualDub updated so you can view the changes in real-time. This is the power of avisynth scripts, no extra memory is needed. Avisynth applies these changes on the fly!

4 - Change size and audio sample rate

While you are inspecting this script in VirtualDub, go to File -> File Information and note the important information. My video has the following info:

  • Size: 352 x 288
  • FPS: 25 fps (frames per second). This is the PAL format.
  • Audio: 16 bit, 44.1 KHz (sampling rate, i.e. 44 thousand samples per second)

That tells me that the audio is very high quality considering the small video size. This will use up a lot of memory in the final video. I also would like to make the frame size bigger - even though it will affect the resolution.

Before the line that combines all the clips,
movie = alignedSplice(clip1, clip2, clip3),
add

 # ---------------------------------------------------
 # Change frame size and audio sample rate
 # ---------------------------------------------------
 clip1 = clip1.BicubicResize(640,450).convertToRGB32().ResampleAudio(16000)
 clip2 = clip2.BicubicResize(640,450).convertToRGB32().ResampleAudio(16000)
 clip3 = clip3.BicubicResize(640,450).convertToRGB32().ResampleAudio(16000)

The convertToRGB is necessary for us to be able to use some functions later on. Check the result again (as always after making changes). The screen should be twice as big and you probably won't hear much difference in sound quality (as the sound was bad to start with anyway).

As an aside, My VirtualDub tends to play up sometimes, but closing the program and starting it up again fixes it.

5 - Add Intro and Outro Video Image clips

Now I would like to add 2 images, one before the start and one at the end:

introImage = ImageSource(".\Images\smoke.jpg", start = 0, end = 200, use_DevIL = false, fps = 25)
outroImage = ImageSource(".\Images\smoke.jpg", start = 0, end = 800, use_DevIL = false, fps = 25)

Note that ImageSource() actually converts the image to a video clip with a particular framerate and of a particular length.

Next you need to add audio to these clips. Avisynth will require audio (even if it is silence) to be compatible with the video clips proper:


# Ensure audio has the same sampling rate as the video clip
introAudio = WAVSource("Audio\InTas.wav").ResampleAudio(16000)
outroAudio = WAVSource("Audio\OutTas.wav").ResampleAudio(16000)

introClip = AudioDub(introImage, introAudio).convertToRGB32()
outroClip = AudioDub(outroImage, outroAudio).convertToRGB32()

So now we have proper intro and outro clips, we can add them to our movie:

movie = alignedSplice(introClip, clip1, clip2, clip3, outroClip)

At this stage we have a script that shows us an intro image with background music, then plays the 3 clips one after the other, and finishes with an image with background music. To recapitulate, the avs source for all this is

 # ---------------------------------------------------
 # Load DGIndex's plugin for Avisynth 
 # (make sure path is correct)
 # ---------------------------------------------------
 LoadPlugin("C:\Program Files\DGDecode\DGDecode.dll")

 # ---------------------------------------------------
 # Open DGIndex files
 # ---------------------------------------------------
 # Song 1: Abuklualo
 video_01 = MPEG2Source(".\DGDecode\AVSEQ01.d2v")		
 audio_01 = MPASource(".\DGDecode\AVSEQ01 T01 DELAY -6ms.mpa")
 
 # Song 3: Nyiir Akvo
 video_03 = MPEG2Source(".\DGDecode\AVSEQ03.d2v")		
 audio_03 = MPASource(".\DGDecode\AVSEQ03 T01 DELAY -6ms.mpa")
  
 # Song 6: Tita
 video_06 = MPEG2Source(".\DGDecode\AVSEQ06.d2v")		
 audio_06 = MPASource(".\DGDecode\AVSEQ06 T01 DELAY -6ms.mpa")
  
 # ---------------------------------------------------
 # combine video with audio
 # ---------------------------------------------------
 clip1 = audiodub(video_01,audio_01)
 clip2 = audiodub(video_03,audio_03)
 clip3 = audiodub(video_06,audio_06)
 
 # ---------------------------------------------------
 # Trim the clips to its proper sections
 # ---------------------------------------------------
 clip1 = clip1.Trim(270, 1371)
 clip2 = clip2.Trim(453, 3470)
 clip3 = clip3.Trim(1468, 3300)

 # ---------------------------------------------------
 # Change frame size and audio sample rate
 # ---------------------------------------------------
 clip1 = clip1.BicubicResize(640,450).convertToRGB32().ResampleAudio(16000)
 clip2 = clip2.BicubicResize(640,450).convertToRGB32().ResampleAudio(16000)
 clip3 = clip3.BicubicResize(640,450).convertToRGB32().ResampleAudio(16000)
 
 # ---------------------------------------------------
 # Create intro and outro image clips
 # ---------------------------------------------------
 introImage = ImageSource(".\Images\smoke.jpg", start = 0, end = 200, use_DevIL = false, fps = 25)
 outroImage = ImageSource(".\Images\smoke.jpg", start = 0, end = 800, use_DevIL = false, fps = 25)
 
 # Ensure audio has the same sampling rate as the video clip
 introAudio = WAVSource("Audio\InTas.wav").ResampleAudio(16000)
 outroAudio = WAVSource("Audio\OutTas.wav").ResampleAudio(16000)
 
 introClip = AudioDub(introImage, introAudio).convertToRGB32()
 outroClip = AudioDub(outroImage, outroAudio).convertToRGB32()

 # ---------------------------------------------------
 # Final construction and display
 # ---------------------------------------------------
 movie = alignedSplice(introClip, clip1, clip2, clip3, outroClip)
 return movie
 
 

The final result is still pretty rough - all the changes are abrupt (no fades), and no titles are given.

back to index

More advanced Video Editing - Method 2

This section will concentrate on some more advanced editing such as text scrolling and fades. It also will depart from the above and use a different approach - though what we have discussed so far is still relevant to this method.

Avisynth is particularly strong in handling, yes, avi files. Therefore it is easier to create avi files from our selected clips and edit those

The way to do this is create little scripts that play the required excerpts and use virtualDub to save them as avi files. This script will be based on the above example. E.g. for clip 1:


LoadPlugin("C:\Program Files\DGDecode\DGDecode.dll")
video_01 = MPEG2Source(".\DGDecode\AVSEQ01.d2v")		
audio_01 = MPASource(".\DGDecode\AVSEQ01 T01 DELAY -6ms.mpa")	
clip1 = audiodub(video_01,audio_01)
clip1 = clip1.Trim(270, 1371) 
return clip1

Open this avs file in virtualDub and save as avi. Avi files, by the way are very large, since it doesn't use compression, so you need a fair amount of storage space.
Once you have done this for the 3 clips, we can start doing some serious editing. By that I mean, we're going to add fade-in and -out and scrolling text.

In this script, we will use some standard avs functions such as ApplyRange(), fadeOut() and Reverse.Fadeout(), i.e. fadeIn. These are self-explanatory and well documented on the avisynth site. There is one function that is very important, the Animate() function:

Add scrolling text effect to the intro Video Image clip

Now we've reached the point were you can start exploring the power of avisynth scripts. There's tons of information on any kind of function you want to implement ... or write your own. For example, avisynth has a powerful function called "Animate" which is a meta-filter which evaluates its parameter 'filter' with continuously varying arguments. We will use animate in a homemade function called VScrollTitle().

function VScrollTitle(clip Clop, int StartFrame, string Title, 
					  string Font, int FontSize, int Colour, int Time ) 
{
    ef = StartFrame + int( Time * Clop.FrameRate)
	return Animate( 
		Clop, StartFrame, ef, "subtitle", Title, Clop.width/2, 
		int(Clop.Height*1.2), StartFrame, ef, Font, FontSize, Colour, 0, 5, 0, 
		Title, Clop.width/2, 0, StartFrame, ef, Font, FontSize, Colour, 0, 5, 0
    )
}

To animate text we need to call this function with something like

introImage = VScrollTitle(introImage, 0, "AJAK KWAI", "Uncial", 48, $ffffff, credits_time)

which can be shortened to

introImage.VScrollTitle( 0, "AJAK KWAI", "Uncial", 48, $ffffff, credits_time)

VScrollTitle is called for each line of text.

Final script using method 2

Here is the full code of our script. Again, it should be self-explanatory. The final result looks professional. It starts with an intro scrolling text over a background image with background audio. It then fades into the 3 videoclips, each of which fades into the other, and finaly fades into an outro background image with background music and static text:


#***********************************************************************#
# FUNCTIONS                                                             #
#***********************************************************************#
function VScrollTitle(clip Clop, int StartFrame, string Title, 
					  string Font, int FontSize, int Colour, int Time ) 
{
    ef = StartFrame + int( Time * Clop.FrameRate)
	return Animate( 
		Clop, StartFrame, ef, "subtitle", Title, Clop.width/2, 
		int(Clop.Height*1.2), StartFrame, ef, Font, FontSize, Colour, 0, 5, 0, 
		Title, Clop.width/2, 0, StartFrame, ef, Font, FontSize, Colour, 0, 5, 0
    )
}

#***********************************************************************#
# VARIABLES                                                             #
#***********************************************************************#
credits_interval = 15
credits_time = 5 
textColor = $ffffff
textFont = "Verdana"
textSize = 24

#***********************************************************************#
# CREATE CLIPS                                                          #
#***********************************************************************#
clip01 = AviSource(".\Clips\clip01.avi").BicubicResize(640,450).convertToRGB32().ResampleAudio(16000)
clip02 = AviSource(".\Clips\clip02.avi").BicubicResize(640,450).convertToRGB32().ResampleAudio(16000)
clip03 = AviSource(".\Clips\clip03.avi").BicubicResize(640,450).convertToRGB32().ResampleAudio(16000)

#lengthClip01 = 1108
#lengthClip02 = 3022
#lengthClip03 = 1828

#***********************************************************************#
# WRAP IMAGES                                                           #
#***********************************************************************#
introImage = ImageSource(".\Images\smoke.jpg", start = 0, end = 200, use_DevIL = false, fps = 25)
outroImage = ImageSource(".\Images\smoke.jpg", start = 0, end = 800, use_DevIL = false, fps = 25)

#***********************************************************************#
# FADE INTO INTRO IMAGE                                                 #
#***********************************************************************#			             					 
introImage = introImage.fadein(20)

#***********************************************************************#
# ADD SCROLLTITLE TO INTRO IMAGE                                        #
#***********************************************************************#
introImage = introImage.VScrollTitle( 0, "AJAK KWAI", "Uncial", 48, $ffffff, credits_time)
introImage = introImage.VScrollTitle( credits_interval, "and BAND", "Arial", 32, $ffffff, credits_time )
introImage = introImage.VScrollTitle( credits_interval*2, "LIVE", "Arial", 32, $FF0000, credits_time)
introImage = introImage.VScrollTitle( credits_interval*3, "At the Crystal Palace", "Arial", 32, $ffffff, credits_time)
introImage = introImage.VScrollTitle( credits_interval*4, "Hobart 2006", "Arial", 24, $ffffff, credits_time )

#***********************************************************************#
# ADD SUBTITLES TO OUTRO IMAGE                                          #
#***********************************************************************#
outroImage = outroImage.ApplyRange(0, 800, "Subtitle", "Ajak Kwai", 30, 40, 0, 99999, textFont, textSize, textColor)
outroImage = outroImage.ApplyRange(0, 800, "Subtitle", "http://www.ajakkwai.com",30, 40 + 55, 0, 99999, textFont, textSize, textColor)
outroImage = outroImage.ApplyRange(0, 800, "Subtitle", "Hobart 2008", 30, 40 + 55 * 2, 0, 99999, textFont, textSize, textColor)

#***********************************************************************#
# WRAP AUDIO FOR INTRO AND OUTRO IMAGES                                 #
#***********************************************************************#
# Ensure audio has the same sampling rate as the video clip
introAudio = WAVSource("Audio\InTas.wav").ResampleAudio(16000)
outroAudio = WAVSource("Audio\OutTas.wav").ResampleAudio(16000)

#***********************************************************************#
# MIX AUDIO WITH VIDEO                                                  #
#***********************************************************************#
introClip = AudioDub(introImage, introAudio).convertToRGB32()
outroClip = AudioDub(outroImage, outroAudio).convertToRGB32()

#***********************************************************************#
# CREATE ALL FADE-INS AND FADE-OUTS                                     #
#***********************************************************************#
introClip = introClip.Reverse.FadeOut(40).Reverse 
introClip = introClip.fadeout(40)

clip01 = clip01.Reverse.FadeOut(40).Reverse 
clip01 = clip01.fadeout(40)

clip02 = clip02.Reverse.FadeOut(40).Reverse 
clip02 =  clip02.fadeout(40)

clip03 = clip03.Reverse.FadeOut(40).Reverse 
clip03 =  clip03.fadeout(40)

outroClip = outroClip.Reverse.FadeOut(40).Reverse 
outroClip = outroClip.fadeout(100)

#***********************************************************************#
# SPLICE ALL THE CLIPS AND ADD BORDER                                   #
#***********************************************************************#
movie = alignedSplice(introClip, clip01, clip02, clip03, outroClip)
movie = movie.addBorders(3,3,3,3,$FFFFFF)

#***********************************************************************#
# APPLY TITLES TO SONGS. Uses fading                                    #
#***********************************************************************#
movie = movie.SubtitleEx("Abuklualo",40, 40, 201, 600, textFont, "f(40, 40)", textSize,textColor)
movie = movie.SubtitleEx("Nyiir Akvo",500, 40, 1309, 1700, textFont, "f(40, 40)", textSize,textColor)
movie = movie.SubtitleEx("Tita",40, 40, 4332, 4700, textFont, "f(40, 40)", textSize,textColor)

#***********************************************************************#
# RETURN THE FINISHED MOVIE                                 			#
#***********************************************************************#
return movie

back to index

More avisynth scripts

The following scripts are added for reference

Loading Mov files

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\QTSource.dll")
a = QTinput("C:\Documents and Settings\Dirk\Desktop\VIDEO\VI_Final\finalVideos\camera.MOV").BicubicResize(640,450)
a = a.convertFPS(30)
a = a.trim(206, 1849)
return a

Load MPEG

loadPlugin("C:\Program Files\AviSynth 2.5\Extra_Plugins\MPEGDecoder.dll")
a = MPEGSource("C:\Documents and Settings\Dirk\Desktop\VIDEO\VI_Final\finalVideos\screen.mpg")
a = a.trim(0,1804)
return a

Show one clip inside another clip

# Calculate coordinates for putting b (inside clip) in the lower right corner with a 4px offset
xpos = Width(cameraClip) - Width(screenClip)-0
ypos = Height(cameraClip) - Height(screenClip)-0
# Overlay screenclip onto cameraclip
d = overlay(cameraClip,screenClip, mode="blend", mask=showalpha(screenClip), x = xpos, y = ypos)

back to index

Supplementary Notes

Following notes are added for reference.

Additional tools

  • Audacity - To edit / convert audio files
  • ExpressRip - for ripping CDs

Filters

Check out the available filters at avisynth.org to get some idea as to the capabilities of this SW. Once you downloaded a filter (in dll format), just stick it in the Plugins folder of avisynth. Read the usage doc on how to apply the plugin to your script.

On DV and HDVD

  • Current preferred format for consumer video
  • fixed to 720X480 at 29.97 fps or 720 x 576 at 25 fps, 25 MBits/sec throughput (5 minutes / GByte!)
  • Developed by consortium of companies.
  • Associated with Firewire.
  • Defines how video is compressed, decompressed, stored on video tape.
  • Stores colour in 4:1:1 sample rate.
  • Cross-platform.
  • FDVD is Hi resolution, cinema quality DVD

How to edit a VCD recorded movie

  • In the MPEGAV folder there is the .dat file containing the video
  • Open with DGIndex (use 'all files')
  • Press F6 or F5 to see the data.
  • record the data. In my case:
    • MPEG1
    • Frame Size: 352x288
    • Aspect Ratio: 4:3.625
    • 20 FPS
    • Progressive
  • Settings for DGDecode:
    • Audio->output Method->demux all tracks
    • Video->field operation->honor pulldown flags

Various

  • The audio sample bit rate needs to be the same in all clips.
  • Using an audio bitrate of 41 KHz uses a lot of disc space!
  • Xvid (Mpeg4) compression is best - use
  • VirtualDub crashes when I change the frame size to 320 X 225
  • Often need to restart virtualDubMod -> try VirtualDub: may update better
  • Determine the format of your video file. Extensions aren't always explanatory. I had .DAT files which after opening with DGIndex revealed they were in MPEG1 format.

back to index