Menu

#1 MaskSub for Avisynth in VSFilter.dll

closed-accepted
nobody
None
5
2008-03-06
2008-02-16
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
}

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

Discussion

  • VinyJones

    VinyJones - 2008-02-16

    pach to add MaskSub function in VSFilter.dll for Avisynth

     
  • clsid

    clsid - 2008-03-06

    Logged In: YES
    user_id=1576375
    Originator: NO

    Patch has been applied.

     
  • clsid

    clsid - 2008-03-06
    • status: open --> open-accepted
     
  • clsid

    clsid - 2008-03-06
    • status: open-accepted --> closed-accepted
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.