VideoHelp Forum
+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. Hello friends.
    I am trying to merge two videos, one old with uncensored scenes and the other new, but censored. Both videos have the same resolution, number of frames and fps.
    Well, my test worked well until I got to moving scenes.
    Script:

    Code:
    video1 =FFvideoSource()
    video2 =FFvideoSource()
    #
    MASK1=CoronaSequence(file="C:\code\01.png").ConvertToYV12(matrix="pc.601")
    MASK2=CoronaSequence(file="C:\code\02.png").ConvertToYV12(matrix="pc.601")
    #
    CLIP_MASK1=Overlay(video2, video1, mask=MASK1).Subtitle("merge+mask > test")
    CLIP_MASK2=Overlay(video2, video1, mask=MASK2).Subtitle("merge+mask > test")
    #
    R1=ReplaceFramesSimple(video2, CLIP_MASK1, mappings="[9565 9627]")
    R2=ReplaceFramesSimple(R1, CLIP_MASK2, mappings="[10588 10604]")
    
    return R2
    Mask:
    Image
    [Attachment 57038 - Click to enlarge]


    In this test, the mask goes from 9565 to 9627, but the scene moves, I would like to know if there is any way to move the white part to avoid making multiple duplicates of the filters, as I already have many lines of them, aside from the fact that it would make the process easier, as I have other masquerade models to add.

    Thank you in advance for any ideas.
    Quote Quote  
  2. Stack your videos side-by-side and see if the frames really match.

    Code:
    video1 =FFvideoSource()
    video2 =FFvideoSource()
    return(StackHorizontal(video1, video2))
    I you mean you need to have the mask track some moving object, that object doesn't change size/shape, and te movement is linear, you can easily use Animate() along with Overlay() to move your white blob.
    Quote Quote  
  3. Yes, I need to make this white area go from top to bottom in a straight line, it does not increase. I had looked at Animate yesterday, but I couldn't fit it into this script.
    I will try again.
    Thanks.
    Quote Quote  
  4. I don't know exactly what your requirements are but here's an example of moving your mask over frames 100 to 199:

    Code:
    function MoveBlob(clip c, int xpos, int ypos)
    {
        BlankClip(c, color=$000000)
        Overlay(last, c, x=xpos, y=ypos)
    }
    
    video1 = BlankClip(width=720, height=576, color=$ff0000) # a red video, just so we can see the results
    video2 = BlankClip(width=720, height=576, color=$00ff00) # a green video, just so we can see the results
    
    blob = ImageSource("blob.png").BilinearResize(video1.width, video1.height)
    blob = Animate(100,199, "MoveBlob", blob,0,-300, blob,0,50) # move the blob over frames 100 to 199
    
    Overlay(video1, video2, mask=blob)
    Quote Quote  
  5. Thanks for the help, Jagabo.
    I was able to do it by your method and I also got another one even more practical using blackness() and motion with Mocha pro.
    Unfortunately the color is very different and makes the project unfeasible, it is difficult to mix DVDPAL with NTSC.

    Thank you
    Quote Quote  
  6. You can probably adjust the colors with Tweak(), ColorYUV(), etc. to get them close before the overlay. There's also a filter called ColourLike() that is designed for this.

    http://avisynth.nl/index.php?title=ColourLike
    Quote Quote  



Similar Threads

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