#10 MaskSub for VSFilter

open
nobody
None
5
2008-02-15
2008-02-15
VinyJones
No

Adding of a new function avisynth provide by VSFilter:

clip MaskSub(string filename, int width, int height, float fps, int length)

This will create a RGBA clip.

You can later burn it in video.

il usefull we you have to burn the same subfile on many video.

For exemple a karaoke in anime :

i have a ass of 3Mo for 1min30 of video.

burning ass will take 5h.

but if i create a Mask clip of ass. it will take 5h too. but afer buning will take 10min.
an the next it will take only 10min.

exemple Creation mask :
************ mask.avs **************
loadplugin("VSFilter.dll")

MaskSub("kara.ass",704,396,50.,3700)
# 50.fps allow 20ms marge for ajustement in burning

*********** burning.avs *************
import("VinyJonesEditLib.avsi")
AVISource("raw.avi")
layerMask(10.78,AVISource("mask.avi"))
ConvertToYV12()

*********** VinyJonesEditLib.avsi ***

function layerplus(clip,n,karaMask)
{
layerplus(clip,n,karaMask,0,0,255)
}
function layerplus(clip c ,n,karaMask,x,y,level)
{
c.Trim(n,-karaMask.Framecount())
ConvertToRGB()
Layer(karaMask,"add",level,x,y)
ConvertAs(c)
c.remplacer(n,last)
}

function layerMask(clip c,float time,clip cmask)
{
deb = int(time*c.Framerate()) + 1
pre = deb/c.Framerate()-time
cmask=cmask.trim(int(pre*cmask.Framerate()),0).ChangeFPS(c)
c.layerplus(deb,cmask)
}

function convertAS(clip ct , clip mod)
{

mod.IsYV12()?
\ ct.ConvertToYV12():
\ mod.IsRGB32()?
\ ct.ConvertToRGB32():
\ mod.IsYUY2()?
\ ct.ConvertToYUY2():
\ mod.IsRGB24()?
\ ct.ConvertToRGB24():
\ mod.IsRGB()?
\ ct.ConvertToRGB():
\ ct
}

Discussion

  • VinyJones

    VinyJones - 2008-02-15

    Patch file to add MaskSub

     
  • VinyJones

    VinyJones - 2008-02-15

    Logged In: YES
    user_id=2009825
    Originator: YES

    function remplacer(clip c,int noframe, clip replacement)
    {
    taille = replacement.Framecount()
    return c.Trim(0,noframe-1) + replacement+ c.Trim(noframe + taille, c.Framecount())
    }

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks