View Single Post
Old 2007-06-03, 15:22   Link #3
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 39
Quote:
Originally Posted by TheFluff View Post
Is there a way to filter only part of a frame?
Yes, it's possible, but probably not worth it. If you insist on doing it anyway, here's how:
Code:
avisource("X:/stuff/example.avi") # let's assume 640x480
top = crop(0, 0, 0, -400) # top 80 lines
middle = crop(0, 80, 0, -100) # middle 300 lines
bottom = crop(0, 380, 0, 0) # bottom 100 lines (I'm probably off by 1 somewhere here, but I can't be assed to correct it)

middle = middle.crazy_evil_filter()

stackvertical(top, middle, bottom)
For more advanced operations you will simply need to split the frame into more parts, and do something like
Code:
stackvertical(stackhorizontal(a, b, c), stackhorizontal(d, e, f), stackhorizontal(g, h, i))
but the exact details are left as an exercise to the reader.
Another way of doing this, though I haven't tested it, would be to crop out the part to be filtered (or crop out from a filtered copy) and use the Overlay function to put it back in. This is probably easier for non-simple cases.
You can also load an alpha mask image with ImageReader and use that mask for the Overlay, if you want non-rectangular areas filtered.


Quote:
Originally Posted by TheFluff View Post
How do I insert a logo/picture before the actual video starts?
Simplest way to do it, if the video isn't VFR:
Code:
avisource("X:/stuff/episode.avi")
logo = imagesource("X:/stuff/logo.png", end=200).converttoyv12().assumefps(last)

logo = audiodub(logo, blankclip(last, length=200)

logo ++ last
I think this can be simplified:
Code:
avisource("X:/stuff/episode.avi")
logo = imagesource("X:/stuff/logo.png", end=200).converttoyv12().assumefps(last)

logo + last
Exploiting that AlignedSplice (single +) will insert silence as needed.


As for Starks's question, there shouldn't be anything preventing you from just:
Code:
partA=AviSource("encode.avi").AssumeFPS(23.976)                                                                
partB=ImageSource("image.png", end=72, pixel_type="RGB32", fps=23.976).ConvertToYV12()
fin=partA++partB
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's
jfs is offline   Reply With Quote