Tuesday, September 14, 2010

Video Editing - Picture in a Picture (PIP)

Here is a fun new project. With all the different cameras and angles we have when out on adventures, it is fun to combine two different videos into a single display - picture in a picture.

Its pretty simple with VirtualDub and AVIsynth (both of them free and easy to use).

Here is a video showing the balloon-cam and also a handheld video of us on the ground.




The other cool thing is that with a simple AVIsynth script, we can add subtitles from GPS feeds, etc.

Here is video of a boy pulling on a 25lbs chinook salmon, from two different angles. Note the GPS and other details added up in the left corner.



The only problem we are having is the colorization is messed up between the script and VirtualDub.

This is the color the videos should have, but they obviously are being converted into "Martian" colors...




The nice thing about the "Overlay" function in AVIsynth is that we can fade in and fade out the smaller video.
It is really easy to "stack" many videos onto a single display - like the Brady Bunch intro...
Maybe someday we'll have so many different cameras going we'll have to resort to that, but until then, Picture-in-a-picture (PIP) should be a nice new trick.
Here is the simple text script for AVIsynth to run - this feeds the frames (PIP'ed) into VirtualDub.
main = AviSource("C:\big.avi")
pip = AviSource("C:\little.avi")
pip = pip.ReduceBy2() #makes the 2nd video smaller
#set the location for the pip window
xpos = Width(main) - Width(pip) - 10
ypos = Height(main) - Height(pip) -10
Overlay(main, pip, mode="blend", x=xpos, y=ypos)
Subtitle("nwpodcast.blogspot.com", lsp=0)