VideoHelp Forum




+ Reply to Thread
Results 1 to 7 of 7
  1. Member
    Join Date
    Jun 2006
    Location
    Europe
    Search Comp PM
    Hi,
    I have 2 videos and 1 images that I want to combine into one video. I have a video of a curtain I want to use as a background:
    [
    On it I want to put an image of a screen:


    On this screen I want to put another layer of video.

    How can it be done? (actually I somewhat managed to put the image on the first video, tryed to play with the blue screen in unleadmediastudio to put the second video but I got confused with it)

    Thanks in advance =)
    Quote Quote  
  2. Member gadgetguy's Avatar
    Join Date
    Feb 2002
    Location
    West Mitten, USA
    Search Comp PM
    It can be done using AviSynth.
    I don't know what your source videos are so I experimented with your pictures and what I had on hand. The first thing I did was convert the picture of the screen to bmp, pull it into paint and fill everything outside of the screen with green. Then I used the following script.

    Vid = DirectShowSource("superman_1941.mpeg").converttoyv 12()
    Aud = Vid #Save the Audio
    Screen = Imagesource("23061486nj3_4.bmp", End = Framecount(Vid)).converttoyv12()
    Curtain = Imagesource("89667023go5.jpg", End = Framecount(Vid)).converttoYV12()
    #Curtain = avisource("CurtainVideo.avi").Lanczos4Resize(320,2 56)
    Vid = lanczos4resize(Vid, 200, 154) #Resize to fit on screen)
    A = greenkey(Screen, Curtain, 1,1,1,interlaced=false)
    B = Overlay(A, Vid, x=48, y=32, opacity=1).assumefps(29.97)
    B = Audiodub(B, Aud)
    return(B)

    function greenkey(clip fore, clip back, int "low", int "high", float "gamma", bool "interlaced", bool "show")
    {
    interlaced=default(interlaced,true)
    low=default(low,96)
    gamma=default(gamma,1)
    high=default(high,212)
    show=default(show,false)

    fore = (interlaced==true)? fore.separatefields() : fore
    back = (interlaced==true)? back.separatefields() : back

    green1 = overlay(fore.vtoy(),fore.utoy(),mode="multiply").c oloryuv(autogain=true)
    green = green1.levels(low,gamma,high,0,255,coring=false).b icubicresize(fore.width,fore.height,0,.5)
    overlay(back,fore,mask=green)

    interlaced==true? last.weave() : last

    show==true? green1 : last

    }
    There may be easier or better methods, but this worked for me. It was a little crude because I didn't spend much time painting the unwanted parts of the screen picture green, I just did a simple 'fill' in Paint. The Greenkey function comes from MugFunky at doom9 in this thread.


    Edit: By cleaning up the screen picture a little bit and adjusting the Greenkey parameters it now looks like this:
    "Shut up Wesley!" -- Captain Jean-Luc Picard
    Buy My Books
    Quote Quote  
  3. Member racer-x's Avatar
    Join Date
    Mar 2003
    Location
    3rd Rock from the Sun
    Search Comp PM
    It's just your basic "Track Mask Editing" and can be done fairly easy with any good NLE. Premiere, Vegas, even Wax2 can do this.

    I did a video tutorial a while back on Track Masks with Vegas. It's in english only though, and it's a lot more complex than your project. Here it is:
    http://www.fortvir.net/gallery/d/2173-1/trackmasks_tut.mov
    Got my retirement plans all set. Looks like I only have to work another 5 years after I die........
    Quote Quote  
  4. Member
    Join Date
    Feb 2004
    Location
    Australia
    Search Comp PM
    reacer-x I just stumbled in here and watched your clip....very helpful, good work and thanks for posting helpful vids.
    Quote Quote  
  5. Member racer-x's Avatar
    Join Date
    Mar 2003
    Location
    3rd Rock from the Sun
    Search Comp PM
    gadgetguy
    I love and use Avisynth all the time. It always amazes me what it can do. For video overlays and chroma keying, it's a bit over my limit. I prefere to work in an NLE enviroment where I can see and adjust changes instantly. Avisynth is an invaluable tool non the less.

    Rudyard
    I just submited my Track Masks Tutotial to the Guides section. Don't know if there is one in there allready on Vegas, but maybe someone else will find it usefull.
    Got my retirement plans all set. Looks like I only have to work another 5 years after I die........
    Quote Quote  
  6. Member
    Join Date
    May 2001
    Location
    United States
    Search Comp PM
    I would prefer to use a separate mask, instead of greenscreening, because it allows you to feather the edges so that the transitions between the two videos isn't so harsh.

    Basically, you have two videos that you load. The mask (only $FFFFFF black and $000000 white) tells the overlay function where to place what video - ie, video 1 appears only in the white part of the mask and video 2 appears only in the black part of the mask. By feathering the edges of the mask, the transition is a lot smoother.

    All this is using AVISynth, of course.
    ICBM target coordinates:
    26° 14' 10.16"N -- 80° 16' 0.91"W
    Quote Quote  
  7. Member gadgetguy's Avatar
    Join Date
    Feb 2002
    Location
    West Mitten, USA
    Search Comp PM
    Originally Posted by racer-x
    gadgetguy
    I love and use Avisynth all the time. It always amazes me what it can do. For video overlays and chroma keying, it's a bit over my limit. I prefere to work in an NLE enviroment where I can see and adjust changes instantly. Avisynth is an invaluable tool non the less.
    As I said, it's not the only method of accomplishing what the OP wants, just one way.

    SLK001
    I'm not sure I follow what you're saying. I used the Greenkey only to put the picture of the screen in front of the video of the curtain.(Although, I used the picture of the curtain in the example it works equally well in front of a video). Then to put the target video on the screen it's a simple overlay, picture in picture style. Where would you use the mask and how would creating a mask be simpler than altering the picture of the screen for use with greenkey?
    "Shut up Wesley!" -- Captain Jean-Luc Picard
    Buy My Books
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!