Basic introduction on how to make Picture-in-Picture (PiP) video.
Posted by Sigma on May 28th, 2009 digg this super bookmark
Page 2 of 3
Intermediate Other.
First we will be loading a movie and play it, I do have to say that I'm no expert myself but I dug in enough to solve problems on my own when they occur, but lets roll. I have put all the parts (main clip and pip clip) in C:\Movie, you will be typing paths, so a short path is handy. Generally the syntax of the filters (basically build-in functions in AviSynth) is as following.
There are some exception, like for loading where you don't need to supply the name of the parameter, but you will see later on.
First you should start up VDM and go to Tools > Script Editor (Ctrl+E). The reason VDM is a good choice together with AviSynth is that the scripts can be edited and be executed from there (video goes directly into VDM). First you should set the script type to AviSynth, this can be done with Edit > Script Handling > AviSynth. This will also provide you with auto-completion when you press ctrl+space.
A word of warning tough. The script editor has only 1 way of error reporting: crashing. When you mistype something, point to a non existing file, put ') instead of (),... it just crashes, VDM sometimes crashes on its own to, you can tell which one of the 2 crashed first by means of the type of error (they both completely crash VDM tough):
The VDM errors are sometimes random, so just try the action again. When you get a AviSynth error, then it means you have a error in your script and should check it. You will probably come across this quite often, but don't let it get to you, its kinda normal for AviSynth I guess. I will provide some alternative editors at the end of this article but I still prefer the VDM one, since you can directly load the movie in VDM by pressing F7.
There are 2 ways of opening clips: AviSource or DirectShowSource AviSource should be tried first. The syntax is as follows (# = comments):
This loads a clip directly. When you need to enter a path to a file in AviSynth, you are required to include the extension of the file, ALWAYS. There are some parameters but I will only give the most important audio: This is a bool (true/false), if set to false, then AviSynth will discard all audio information. This can be useful for dubbing.
NOTE!: There is a limit on how many calls to AviSource you can make, this is usually around 50 but fluctuates sometimes.
I do have to say, using AviSource usually doesn't work for me, but its faster, if it doesn't work then you can try DirectShowSource with the following syntax:
This loads the clip by using DirectShow. With DirectShowSource you have the advantage that if you can play it in windows media player (or any other video player that uses DirectShow to display the movie) then it can be loaded into AviSynth. This is slower then AviSource tough, so always try AviSource first, the results are the same in the end. DirectShowSource has some parameters to:
So by using either one of the 2 methods, load your main movie clip:
Now press F7 or go to File > Save & Open as AVI. You will first have to save the file. VDM looks like it doesn't respond any more, this is normal, AviSynth is processing your script and is sending the data to VDM. After VDM responds again (or if you get an error, in which case you need to recheck your script) you can play the movie (I'm not going into VDM operation at this point, maybe later, if you need this, post it in the comments).
Now this is enough to know how AviSynth works, lets go on.
Only registered members can share their thoughts. So come on! Join the community today (totally free) and do things you never thought possible.
Great! :D
This is an interesting tutorial as sometimes I have wondered how to make those picture-in-picture videos or how some picture-in-picture video was made.