AnimeSuki Forums

Register Forum Rules FAQ Members List Social Groups Search Today's Posts Mark Forums Read

Go Back   AnimeSuki Forum > Anime Related Topics > Fansub Groups

Reply
 
Thread Tools
Old 2007-09-26, 12:04   Link #41
kubus
learning~
 
 
Join Date: Sep 2007
Location: Netherlands
... D'oh!

I feel so stupid now XD. Thank you!

Argh I really need to start using my head from now on haha
kubus is offline   Reply With Quote
Old 2007-09-26, 13:41   Link #42
TheFluff
Excessively jovial fellow
 
 
Join Date: Dec 2005
Location: ISDB-T
Age: 27
Well, the overlay() function DOES have x and y offset parameters, so you could do something like this:
Code:
function insertsign(clip mainclip, clip overlayclip, int startframe, int endframe, int xoffset, int yoffset) {
	endframe = default(endframe,startframe+overlayclip.framecount-1)

	xoffset = default(xoffset,0)
	yoffset = default(yoffset,0)

	begin	= (startframe == 1) ? mainclip.trim(0,-1) : mainclip.trim(0,startframe-1)
	middle	= mainclip.trim(startframe,endframe)
	end	= mainclip.trim(endframe+1,0) # BUG: setting endframe=0 doesn't do what you think it does.
	
	middleoverlay = Overlay(middle, overlayclip, mask=overlayclip.showalpha(), x=xoffset, y=yoffset)

	final = (startframe == 0) ? middleoverlay ++ end : begin ++ middleoverlay ++ end
	return final
}
But really, as jfs says it's much easier to just make the image the same size as the video frame.
__________________
| ffmpegsource
17:43:13 <~deculture> Also, TheFluff, you are so fucking slowpoke.jpg that people think we dropped the DVD's.
17:43:16 <~deculture> nice job, fag!

01:04:41 < Plorkyeran> it was annoying to typeset so it should be annoying to read
TheFluff is offline   Reply With Quote
Old 2007-09-26, 13:42   Link #43
Onniguru
 
Join Date: Feb 2006
[QUOTE=TheFluff;976257]Since several people have asked me about how to do various things with Avisynth over the last few weeks, I think it's time we had a thread like this. Post your favorite tricks, utility functions, smart ways to do common things, etc.

I'll start off with the absolutely most common question I get:
How do I overlay an AFX clip or a picture on top of a video?
As usual with Avisynth, there's more than one way to do it, but one particularly convenient way is to write a custom function to do it. I did this once and Devastator had his own variant (that I'll let him post himself), but both are hidden deep in the AFX questions thread, so I'll post my version here:
Code:
function insertsign(clip mainclip, clip overlayclip, int startframe, int endframe) {
	endframe = default(endframe,startframe+overlayclip.framecount-1)

	begin	= (startframe == 1) ? mainclip.trim(0,-1) : mainclip.trim(0,startframe-1)
	middle	= mainclip.trim(startframe,endframe)
	end	= mainclip.trim(endframe+1,0) # BUG: setting endframe=0 doesn't do what you think it does.
	
	middleoverlay = Overlay(middle, overlayclip, mask=overlayclip.showalpha())

	final = (startframe == 0) ? middleoverlay ++ end : begin ++ middleoverlay ++ end
	return final
}
How I used to do the same thing:

LoadVirtualDubPlugin("C:\Program Files\AviSynth 2.5\Logo.vdf","Logo",0)
ConvertToRGB()
Logo(5, 5, 100, 2, 0, 0, 0, 5, "D:\somelogo.bmp", 0, 25, 75, 0, 0, 0, 0)
ConvertToYV12()

The only weakness being that it needs RGB colorspace to work...hence the conversion to RGB, then BACK to YV12. Edit: Actually, a pretty big weakness, unless the video I'm working with starts in RGB colorspace (such as a d2v). For something like a SHARE source that is already yuv12, this would be changing the colorspace 3 times. Better to do it TheFluff's way.

This allows me to use the wonderful Donald Graft Logo filter(tm), which allows one to easily set the duration, location, transparancy background channel to look for, foreground alpha % (separate from the transparancy portion), and even enbed animation in the logo. Fluff's approach also does duration, location, and alpha percent, but not the animation part

That being said, you want to learn TheFluff's way of doing it eventually, if you plan of ever doing more than just logos, such as expanding into doing subtitles and the like.

Last edited by Onniguru; 2007-10-30 at 10:57. Reason: one sentance I wrote didn't make sense...
Onniguru is offline   Reply With Quote
Old 2007-09-26, 14:06   Link #44
Onniguru
 
Join Date: Feb 2006
Quote:
Originally Posted by kubus View Post

But now here's the question. The PNG appears, but it's positioned in the upper left corner! Is there any way to center it, or use zoom or something? I'm still pretty new to avisynth, and I've looked in the Wiki and all, but so far no result T_T.

If anyone would be able to help me with this, I'd really appreciate it! Thanks in advance.
The Donald Graft filter allows easy movement of the initial position, as well as the duration, transparancy of the forground color, and more.

I'll break apart my example from two posts back:
Logo(5, 5, 100, 2, 0, 0, 0, 5, "X:\somepath\yourlogo.bmp", 0, 25, 75, 0, 0, 0, 0)

5,5 --> This is the upper left corner where the logo is positioned. If you want it in the center of, say, a 704x396, change this to something like: 300, 180 or some such, depending on how big your logo is

100 --> This is the amount of transparancy of the forground color. I like to use 128 so that it is dim, but still clearly visible.

2 --> I don't remember

0,0,0 --> This is the color that we be treated as through it were transparent. Thus in my logo, any black that appears is treated as transparent, and not as black. This is important, because the Donald Graft filter only takes bmps, which do not have a built in alpha channel.

"X:\somepath\yourlogo.bmp" --> the path to your logo, of course

0 --> start frame for fade-ins, I think
25 --> frame that your logo first appears, or if your logo "fades in", the frame that it reaches it's maximum alpha.
75 --> the duration, in frames, that logo stays on the screen.

0,0,0,0 --> used in animating the logo and other special effects. I don't know how to use these last four values.
Onniguru is offline   Reply With Quote
Old 2007-09-26, 15:11   Link #45
martino
makes no files now
 
 
Join Date: May 2006
Quote:
Originally Posted by Onniguru View Post
How I do the same thing:

LoadVirtualDubPlugin("C:\Program Files\AviSynth 2.5\Logo.vdf","Logo",0)
ConvertToRGB()
Logo(5, 5, 100, 2, 0, 0, 0, 5, "D:\somelogo.bmp", 0, 25, 75, 0, 0, 0, 0)
ConvertToYV12()

The only weakness being that it needs RGB colorspace to work...hence the conversion to RGB, then BACK to YV12.

This allows me to use the wonderful Donald Graft Logo filter(tm), which allows one to easily set the duration, location, transparancy background channel to look for, foreground alpha % (separate from the transparancy portion), and even enbed animation in the logo. Fluff's approach also does duration, location, and alpha percent, but not the animation part
It sure doesn't seem like a bad way of doing it, but AFAIK colorspace conversions are not lossless (or at least not all, though not sure to which ones this applies though).

From what you described, it seems like that Logo plugin does have certain arguments which overlay doesn't, but then if the person who created the logo knew what he/she was doing then you shouldn't really need them either way...

Just seems like a somewhat longer (more complicated?) way of doing things to me if you don't need "kick-ass-tweak-style" features.


EDIT: You do realize by the way that you can edit your own posts after posting? -_^
__________________
"Light and shadow don't battle each other, because they're two sides of the same coin"
martino is offline   Reply With Quote
Old 2007-10-30, 05:04   Link #46
shyrin
Junior Member
 
Join Date: Jun 2007
encode from a pal dvd looks bad

Hi there,

I'm not really an experienced encoder so I could need a little bit help here:

I'm trying to get a raw from a PAL DVD source, but it seems that it has badly blended NTSC into PAL. In avisnyth I tried a lot of filters and settings and it seems to deliver the best result with this combi:

Code:
Telecide(order=1,guide=2,hints=true,post=0,blend=false)    
Decimate(cycle=5,mode=2,quality=3)
TDeint(1,1,mtnmode=3)
RemoveGrain(mode=1)
Crop(6,6,-6,-4)
LanczosResize(720,576)
deen("a3d",2,7,9)
vmtoon()
tweak(sat=1.5,bright=-10,cont=1.1)
The problem is the result is still looking bad.
I get something like this:
http://img98.imageshack.us/img98/2954/snapshot1tf1.jpg
and whats even worse:
http://img136.imageshack.us/img136/6...apshot2vg6.jpg
and it also seems to judder.

BTW: I wanted to use restore24 but I tried a whole day to get this thing running without success.

I hope someone can help me this drives me mad

Greetings
Shy
shyrin is offline   Reply With Quote
Old 2007-10-30, 10:20   Link #47
Onniguru
 
Join Date: Feb 2006
Quote:
Originally Posted by TheFluff View Post
Is there a way to apply a filter to only a part of a video?
Yes, that's pretty simple, but if you want to do this seriously you'd be best off with using YATTA for it. Anyway, here's how you do it (exactly like YATTA does it, but manually):
Code:
avisource("X:/stuff/example.avi")

function filterchain1(clip c) {
    c
    # do some filtering here
    return last
}

function filterchain2(clip c) {
    c
    # NASTY EVIL BLUR OR SOMETHING HERE
    return last
}

trim(0,500).filterchain1()+trim(501,550).filterchain2()+trim(551,0).filterchain1()
I already know a video where this is a useful technique
In Higurashi no naku koro ni kai Episode 1, there is a sequence in the middle, during the "spooky UFO scenes", where the animators deliberately pixilated the video...the blocks are supposed to be there. Any deblocking filters will churn this sequence into a blurry mess. However, any other parts of the video that has blocking in it needs to have the blocking removed...so the video could be divided into three parts using this technique, with the first and third parts having deblocking filters, but the middle section (about 1 minute long) having no deblocking

Quote:

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
Your missing closing parantheses here, it seems to me ...
logo = audiodub(logo, blankclip(last, length=200))
Onniguru is offline   Reply With Quote
Old 2007-10-30, 17:11   Link #48
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 29
Quote:
Originally Posted by shyrin View Post
I'm trying to get a raw from a PAL DVD source
Stop right there.
1. Yes, anime PAL DVD sources are known to be horrible. Don't use them. Ever. Actually, just take the DVD to the closest garbage bin, it's probably not worth any better.
2. What kind of unlicensed anime gets released on PAL DVD? Japan is NTSC land. (Aka. "consider the forum you're posting on before posting.")
__________________

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
Old 2007-10-31, 15:55   Link #49
TheFluff
Excessively jovial fellow
 
 
Join Date: Dec 2005
Location: ISDB-T
Age: 27
Quote:
Originally Posted by shyrin View Post
PAL DVD source
STOP
HAMMER TIME

If it's not a rather high-budget cinematic movie, when it comes to anime the classic answer to this question is, as jfs mentions:
1. Locate trashcan
2. Place DVD in said trashcan
3. Find NTSC equivalent

PAL anime DVD's are, in the overwhelming majority of the cases (read "every PAL anime DVD ever that isn't a Ghibli movie, and even some of those") horribly shitty fieldblended NTSC->PAL conversions that you can't do anything useful with ever. Never buy PAL anime DVD's ever unless you're 100% sure it's a clean progressive 24fps film -> 25fps PAL conversion.
__________________
| ffmpegsource
17:43:13 <~deculture> Also, TheFluff, you are so fucking slowpoke.jpg that people think we dropped the DVD's.
17:43:16 <~deculture> nice job, fag!

01:04:41 < Plorkyeran> it was annoying to typeset so it should be annoying to read
TheFluff is offline   Reply With Quote
Old 2007-10-31, 16:26   Link #50
shyrin
Junior Member
 
Join Date: Jun 2007
I had no other choice
In japan its out of stock, in the us it was never released and I only have these crappy french DVD's.
There's also a bad bootleg shop that sells it on ebay in ntsc, but I think this might be even worse....
Hm, for now I used just tomsmocomp and kicked everything else for deinterlacing. Its not beautiful but at least it doesn't stutter so much.
And be sure I'll never buy PAL DVD again (even though I live in a Pal Zone^^)
shyrin is offline   Reply With Quote
Old 2007-11-01, 01:28   Link #51
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 29
A bit off-topic, don't be afraid of buying PAL DVD's of most cinematic movies, especially non-anime productions, as they'll usually be more sensible transfers. Often (well, I hope) they'll actually be in the higher resolution that PAL offers over NTSC and not just upscales from the 480 line transfer.
(Example: Some Pixar films have been produced/rendered in both 16:9 and 4:3 format with actual changes to the frame compositions etc. to make a good version in both formats. Since they can do that, they can probably also render it in different resolutions and framerates for different TV systems.)
__________________

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
Old 2007-11-14, 23:00   Link #52
Koroku
formerly JKaizer
*Fansubber
*AnimeSuki Site Staff
 
 
Join Date: Dec 2005
Age: 25
Send a message via AIM to Koroku Send a message via MSN to Koroku Send a message via Yahoo to Koroku Send a message via Skype™ to Koroku
Okay, so I have a set of images that produce a moving logo. The code I have works fine when the images start from the initial frame, but when I try to move the initial frame inwards, it doesn't work.
Quote:
title = imagesource( "C:\Documents and Settings\Greg\My Documents\VirtualDub\grev-logo\beyblade-logo%04d.png", start = 0001, end = 0123, use_devil=true, pixel_type="rgb32").assumefps(last)
applyrange( 153, 276, "overlay", title, 0, 0, showalpha(title) )
If the applyrange is set to 1, 123, it works just fine. Too bad I need it to start at 153.

Is there a solution other than creating 152 blank images, and renaming all 276?
__________________
.~.
Koroku is offline   Reply With Quote
Old 2007-11-15, 18:11   Link #53
TheFluff
Excessively jovial fellow
 
 
Join Date: Dec 2005
Location: ISDB-T
Age: 27
Don't use ApplyRange(), it has all sorts of funky limitations and is really tricky to get right.
Use Trim() and +/++ instead. Like this:
Code:
title = imagesource( "C:\Documents and Settings\Greg\My Documents\VirtualDub\grev-logo\beyblade-logo%04d.png", start = 0001, end = 0123, use_devil=true, pixel_type="rgb32").assumefps(last)

# the "last" is actually not needed here, I'm being explicit for clarity's sake
pre = last.trim(0,152)
post = last.trim(277,0)
last.trim(153,276) # overwriting the old last here for convenience

# abusing last as implicit argument here
overlay(title, mask=showalpha())

# put it together (overwriting last again)
pre + last + post
Or you could just be really lazy and steal the AFX sign overlay helper function (see the Avisynth help thread for details):
Code:
function insertsign(clip mainclip, clip overlayclip, int startframe, int endframe) {
	# make the endframe parameter optional (defaulting to where the overlay clip ends)
	endframe = default(endframe,startframe+overlayclip.framecount-1)

	# make sure the special case startframe=1 is dealt with correctly
	# (needed because trim(0,0) returns the entire clip, which is obviously not what we want)
	# note that the first frame of the clip is ZER0, _not_ one!
	begin	= (startframe == 1) ? mainclip.trim(0,-1) : mainclip.trim(0,startframe-1)
	middle	= mainclip.trim(startframe,endframe)
	end	= mainclip.trim(endframe+1,0) # BUG: setting endframe=0 doesn't do what you think it does.
	
	middleoverlay = Overlay(middle, overlayclip, mask=overlayclip.showalpha())

	# deal with the special case startframe=0 (in which case we don't have anything before the overlay)
	# note that trim(-1,0) does nothing (it returns the same as trim(0,0)...)
	final = (startframe == 0) ? middleoverlay ++ end : begin ++ middleoverlay ++ end
	return final
}
And thereby reduce your script to:
Code:
title = imagesource( "C:\Documents and Settings\Greg\My Documents\VirtualDub\grev-logo\beyblade-logo%04d.png", start = 0001, end = 0123, use_devil=true, pixel_type="rgb32").assumefps(last)
insertsign(last, title, 153, 276)
__________________
| ffmpegsource
17:43:13 <~deculture> Also, TheFluff, you are so fucking slowpoke.jpg that people think we dropped the DVD's.
17:43:16 <~deculture> nice job, fag!

01:04:41 < Plorkyeran> it was annoying to typeset so it should be annoying to read
TheFluff is offline   Reply With Quote
Old 2007-12-03, 08:35   Link #54
comatose
Senior Member
 
 
Join Date: Dec 2007
Hi!

I'm rather new to anime encoding and avisynth, and I've encountered a weird problem.

I'm trying to use DFMDeRainbow() or Derainbow(), both of which require MSharpen.dll. This error happens with both of them.
The thing is that MSharpen seems to cause errors look distorted (and also seems to be the cause of the error itself).

(Reminder: DeRainbow() has two requirements: MSharpen and mt_masktools)
Say I try to use DeRainbow() with MSharpen not loaded and masktools loaded, I get an error saying that MSharpen is missing (the text is readable, of course).

However, if masktools is not loaded and MSharpen is (or, if both are loaded), I get this unreadable error:



This is after a clean AviSynth install, with only MSharpen.dll, mt_masktools.dll and DeRainbow.avsi (and the basic stuff that come with AVS - DirectShowSource.dll, TCPDeliver.dll and colors_rgb.avsi) in the plugins folder.

Please help =\

edit: It's not just MSharpen, it's something else. This happens with just mt_masktools.dll and vmtoon().

Code:
directshowsource("nosound.mkv")
vmtoon()
Does the same thing. This really sucks. (before anybody asks, commenting the vmtoon() line makes the video play fine.)

Last edited by comatose; 2007-12-03 at 08:50.
comatose is offline   Reply With Quote
Old 2007-12-03, 09:05   Link #55
martino
makes no files now
 
 
Join Date: May 2006
Try loading all of your plugins manually, apart from the ones that are installed automatically by AviSynth in its plugins folder. Some WarpSharp (might not be related to your problem at all though) versions apparently cause problems when being autoloaded, but I never came across any problems where autoloading would screw up (either way I manually load them myself apart from a few scripts) so my help is a bit limited. Also have you tried different versions of AviSynth, and what version are you using right now? (The best way of troubleshooting is of course loading one plugin at a time and testing its function. If it works you move on the next and/or combine them, etc...)

My MSharpen gives me a CRC of BC5448D2 and is version 1.10 (should be beta 2 since it works with YV12). Check it against yours and see if you get the same.

Also if you want to de-rainbow, try something like:
Code:
FFT3DFilter(sigma=6,plane=3,bw=32,bh=32,bt=3,ow=16,oh=16,interlaced=true)
__________________
"Light and shadow don't battle each other, because they're two sides of the same coin"

Last edited by martino; 2007-12-03 at 09:12. Reason: typo
martino is offline   Reply With Quote
Old 2007-12-03, 09:15   Link #56
comatose
Senior Member
 
 
Join Date: Dec 2007
Same MSharpen CRC.


Loading mt_masktools manually doesn't do any good.

My version of AviSynth is 2.5.7 ><
Anyway, I've got to go right now, but I'll test older versions of AviSynth later.

I'll also try loading plugins manually later, but it could actually be that the problem is with masktools, because just masktools and vmtoon (with no other plugins/scripts) cause this error.

PS, how do I manually load external scripts, other than ending the filename with .avsi and putting them in the plugin folder?

Thanks for your help!
comatose is offline   Reply With Quote
Old 2007-12-03, 09:50   Link #57
comatose
Senior Member
 
 
Join Date: Dec 2007
Hey martino, which version of masktools do you have? Do you by any chance use Vista?

edit: Regarding masktools: v2.0a7 and a8 makes MPC never get past "Opening...", but it's not frozen. v2.0a6 (and below) gives this readable error (probably because this version of masktools is too old). v2.0a9 and higher versions give the unreadable error.

edit2: WTF... a slightly different "blargh" error appears with just vmtoon() (and the vmtoon script loaded), without any masktools DLL loaded.

Could this be happening due to some codec?
...now I get this error no matter what I do or whatever I have loaded. -_____-

Last edited by comatose; 2007-12-03 at 10:36.
comatose is offline   Reply With Quote
Old 2007-12-03, 10:45   Link #58
martino
makes no files now
 
 
Join Date: May 2006
Code:
LoadPlugin("C:\Program Files\AviSynth 2.5\filters\mt_masktools.dll")
Import("C:\Program Files\AviSynth 2.5\filters\vmToon-v0.74.avsi") #loads avs(i) scripts
LoadPlugin("C:\Program Files\AviSynth 2.5\filters\WarpSharp.dll")

DirectShowSource("C:\downloads\[Conclave-Mendoi]_Mobile_Suit_Gundam_00_-_06_[480x272_H.264_AAC][135FBCAF].mp4")
vmToon()
mt_masktools - v2.09a
warpsharp - beta 0.2 (B79393FB)

This works just fine here. And no, I'm not using Vista (*shrugs*). And my \plugins autoload folder contains only DGDecode.dll, DirectShowSource.dll, FFMpegSource.dll, MT.dll, TCPDeliver.dll and TDeint.dll.

What if you try it on a clean install (ie making a double boot for simplicity) with just AviSynth, CCCP and the required filters?

(I think that asking on doom9 might be a better place though.)
__________________
"Light and shadow don't battle each other, because they're two sides of the same coin"
martino is offline   Reply With Quote
Old 2007-12-03, 10:50   Link #59
comatose
Senior Member
 
 
Join Date: Dec 2007
Yeah, I know I should go to doom9, but they have a requirement saying you must be registered for at least 5 days before you can post, and I only have 3 :s

Anyway, I just did a System Restore. The Subtitle() error (I used it just to see what would happen) that was jibberish before is readable now. I fear it might be the Pro Tools LE 7.4 install that failed a few days ago.

Let's pray it works now!

edit: Problem solved. It was all the unnecessary drivers that program installed. Thanks martino

Last edited by comatose; 2007-12-03 at 11:01.
comatose is offline   Reply With Quote
Old 2007-12-03, 11:00   Link #60
Sylf
翻訳家わなびぃ
*Fansubber
 
 
Join Date: Nov 2003
Age: 40
Send a message via MSN to Sylf Send a message via Yahoo to Sylf
mipsmooth is one of filters widely available. Download it from the regular spot.
Sylf is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 17:26.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
We use Silk.