digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: I need Anime encoding script (http://www.digitalfaq.com/archives/avisynth/6033-avisynth-anime-encoding.html)

BloodAngel 10-10-2003 04:43 PM

Avisynth: I need Anime encoding script
 
I want to make KSVCDs with anime. But when I use the script I have everything gets green. When you see something of the anime it stays like that. The whole ep long. Plz help me with this.

CheronAph 10-11-2003 12:18 AM

Use the MA script from here, http://www.kvcd.net/forum/viewtopic.php?t=3483
For Anime/Cartoon material:
Same as DVD clean material, but shorten the GOP to 12 frames (PAL) or 15 (NTSC)

BloodAngel 10-11-2003 03:16 AM

I'm using TMPGEnc and don't know where to set this rating.

CheronAph 10-11-2003 06:26 AM

Open TMPGEng, go to setting, choose GOP structure and there change the MAX number of frames in a GOP to 12 or 15

BloodAngel 10-11-2003 09:41 AM

So I need to use that Clear DVD code, I've installed AviSynth 2.5 and what do I do with the code then? I've found the GOP setting thank you, but it still doesn't work.

CheronAph 10-12-2003 12:31 AM

Hereīs my script, just change the roots to your own files,

LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\MPEG2Dec3.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\GripFit_YV12.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\STMedianFilter.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\asharp.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\unfilter.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\undot.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\VSFilter.dll")

MaxTreshold = 1.50
nf = 0

Mpeg2Source("D:\DVDtoKVCD\vts_01.d2v")

undot()
Limiter()
asharp(1, 4)
GripCrop(352, 576, overscan=3)
TextSub("D:\DVDtoKVCD\vts_01.srt")
GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(MaxTreshold))
MergeLuma(blur(0,1))
GripBorders()

SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= SwitchThreshold ? \
unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1) ")

Limiter()

function fmin( int f1, int f2) {
return ( f1<f2 ) ? f1 : f2
}

Latexxx 10-12-2003 01:55 AM

Quote:

Originally Posted by CheronAph
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\MPEG2Dec3.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\GripFit_YV12.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\STMedianFilter.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\asharp.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\unfilter.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\undot.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\VSFilter.dll")

Isn't that l33t. :) :) :) :)

Dialhot 10-12-2003 05:43 AM

That's the same for this that I see in every scripts with noone seeing that is completly useless :

Quote:

MaxTreshold = 1.50
...
MergeChroma(blur(MaxTreshold))
That's make me laughting every time.

CheronAph 10-12-2003 07:18 AM

Quote:

Originally Posted by Dialhot
That's the same for this that I see in every scripts with noone seeing that is completly useless :

Quote:

MaxTreshold = 1.50
...
MergeChroma(blur(MaxTreshold))
That's make me laughting every time.

Whatīs making you laugh? A script that Kwaq made? How is it useless?

CheronAph 10-12-2003 07:19 AM

Quote:

Originally Posted by Latexxx
Quote:

Originally Posted by CheronAph
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\MPEG2Dec3.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\GripFit_YV12.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\STMedianFilter.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\asharp.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\unfilter.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\undot.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\VSFilter.dll")

Isn't that l33t. :) :) :) :)

What is l33t?

Dialhot 10-12-2003 07:44 AM

Quote:

Originally Posted by CheronAph
Whatīs making you laugh? A script that Kwaq made? How is it useless?

Where is the need to define a variable that is used only in ONE place in the script ?
The definition of MaxThreshold was done in the very first MA script because we used it in TWO places (the blur and the first scripclip lines, because first MA scripts used 2 scripclip instruction). There were a lot of modification in the script since this time, and Maxthreshold is now use only in the blur command.

And it makes me laughing (or more accuratly, smiling, because I do not want to laught abotu anyone) because people just copy/paste the script whithout trying to understand what it does, and it's always weird for me (that's surely the results of 20 years of programming experience :-))

Trust me, you can securely change the top of the script by dropping the line "MaxThreshold=1.50" and put directly "MergeChroma(Blur(1.50))"

(note: by the way, blur can go till 1.58. that makes you gain a little more bytes).

BloodAngel 10-12-2003 09:01 AM

Damn I still don't get it. CheronAph, so I need to change the roots to my files. What files :S, I can't find them in the Avisynth directory. Can't someone mail me a script or something, so that I don't have to do it myself. :roll:

CheronAph 10-13-2003 01:18 AM

If I put the line, MergeChroma(Blur(1.50)) doesnīt that use the blurring throughout the movie?
The line, MergeChroma(blur(MaxTreshold)) means that it changes the chroma blur from 0.0 to 1.50 depending on the scene!
And yes, not everyone is a genius like you Dialhot! :roll:

Dialhot 10-13-2003 02:46 AM

You know, if not everyone is a genius, avisynth isn't either :-). And when it sees "Blur(MaxThreshold)" with MaxThreshold = 1.50, it understand "Blur(1.50)'. Nothing more, nothing else.

Your reply is a perfect hint that this line is very confusing ! If other people like you thought the blur will be from 0 to 1.50, for sure, there is a problem.

Didn't you even ask yourself " changes the chroma blur from 0.0 to 1.50 depending on the scene" but according to what ? How can avisynth decide wich value to use ?

Do not take yourself as a dumb CheronAph, you're not; Your computer is a lot dumber than you :-). Comparing to it, you are a perfect genius ;-)

CheronAph 10-13-2003 02:52 AM

I was referring to this post, http://www.kvcd.net/forum/viewtopic.php?t=6389

Dialhot 10-13-2003 03:29 AM

Yes but in this (very old :-)) time, MaxThreshold was modified in the MA part of the script and was not a constant like it is in the current version of the script. In this time your question was correct, and so the answer of Kwag.

That what I was refered in the begin of the tread : the modification of MaxTreshold in the MA part of the script was removed but the line "MaxTreshold = 1.50" is still there while it became completly useless.

That gives the impression that MaxThreshold is a variable where it is actually a constant.

incredible 10-13-2003 03:53 AM

I'll go further..:

undot()
Limiter()
asharp(1, 4)
GripCrop(352, 576, overscan=3)
GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(MaxTreshold))
MergeLuma(blur(0,1))
GripBorders()

Why Asharpen when blurring again afterwards? And even with an A(daptive)sharpen image StMedianFilter has to work harder. Even when the sharpen advantage from Asharp() is also softened by directly performing a bicubic resize afterwards.
I stuck with this modificated Part of the MA Skript and it gave me perfect Outputs:

undot()
Limiter()
GripCrop(480, 576, overscan=2)
GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0 )
GripBorders()

The sharpness was almost the same and if I want to receive MORE CQ I just add the MergeLuma etc. Blurring Lines afterwards as it was (without the integration of Asharp() before. This gives me about 5-10% CQ more.

undot()
Limiter()
GripCrop(480, 576, overscan=2)
GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(1.50))
MergeLuma(blur(0,1))
GripBorders()

But this is only my opinion ... I feel free for everyones statement, especially from Dialhot :wink:

Dialhot 10-13-2003 05:03 AM

Effectively, as I told some times, I NEVER use any sharpening filters in my scripts (asharp or unfilter with negative values)
(I even never used the optimal MA script as it is given on the site except when I tested it when it was released).

Kwag explained why there is this "sharpening then bluring" operation in the script but I never stuck with the explanation and, like you, I prefer to remove it (and use Lanczosresize to obtain an sharper image than with bicubic).

CheronAph 10-13-2003 05:15 AM

Can you give the the MA script that you use if itīs better? Iīd like to try that.

incredible 10-13-2003 06:24 AM

@ CheronAph

As shown above ... just remove the asharp line and if CQ Value is high enough (or movie gots short length or less action) even remove the Merge/Blur Lines (before prediction!).
In Case of low CQ just add the Merge/Blur lines and do a prediction again cause mergeLuma/Chroma-Blur "breaks" the edges which is very useful to obtain higher predictionned CQ Values and to avoid "mosquito"-Artefakts even at low CQ values ;-)
A little effect you see as a little, little blurred movie on Tv but a very big step to obtain more CQ, .. thats it.

This is one m1v Result by using even a non-MA script. Asharp() removed, bicubic resized followed by mergeLuma/chroma-blur lines in the script. The result was a CQ of about 55.
Media: One CD-R 80
Lenght: 180min !
Size: 480x576, 25fps PAL @ mpeg1
Audio: 128kbit audio
Source: orig. DVD

http://www.digitalfaq.com/archives/error.gif

http://www.digitalfaq.com/archives/error.gif

@ Dialhot

I testet a lot using Lanczos but as I said in another Thread it seems that this resize option sharpens the picture as a whole. 8O
So this would mean a bigger senseless job for temp. or spat. cleaners by processing the surfaces

If I still want a sharper Picture (processing short movies / or less action etc.) I often use this modified part of the MA Script (if MA Script is really used)

undot()
Limiter()
GripCrop(480, 576, overscan=2)
GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0 )
Asharp(1, 2) # second value 2 to maintain the surfaces untouched as already handled by spat. Values of StMedian
GripBorders()

... following the MA routine

:wink:

Dialhot 10-13-2003 06:46 AM

@ CheronAph
I'll post it tonight because I'm at the office right now.

@incredible

A resizer sharpen only the edges of the pictures, not the plan area. IN fact, we should say that Bicubicresize soften the edges that are normally sharpened by bicubic interpolation, where Lanczos doesn't (I guess, not sure). Because it's a mathematical reality that applying bicubic equations leads to sharpening the edges.

If you want you have a version of unfiltered bicubicresize (that means, a bicubic that do not do this softening) in the library bicublinresize there :

http://ziquash.chez.tiscali.fr/

incredible 10-13-2003 06:57 AM

Well, I know the "bicubic" algorithms from Photoshop. There its explained that a bicubic algorithm will do an precise "interpolated" resize in comparison to a just "pixel cropped/moved/doubled" resize.

Or does Avisynth got its own definitions :?:

And "Lanczos" .... hmmmm
I did a lot of tests (also with the resizers in the link you posted, thanks :) ) and by using lanczos instead of bicubic I had to set the values of the following cleaners higher (to handle the plain parts in the movie!) and if not set higher the picture got still noise, cause of the paradoxing-Effect ;-)

But I'll test again

Hey Phil, doing Forum Jobs at Work like me? :)

Dialhot 10-13-2003 07:15 AM

No no, avisynth have the same definition. But "interpolating" means "introducing an error'". After this, all depend on what you decide to do with this error : drop it completly, or try to counterbalance it with the next pixel you have to interpolate (kind of "error diffusion" for make it short). When you arrive on an edge, the algorithm do not have "next pixel" to use to counterbalance the error acumulated from the previous ones. That is where the problems occur.

This are old memories of my studies, so I'm not very sure of anything :-)

For your last point, that sure that Lanczos introduces some artefacts, but my point is "Lanczos > Asharp+Bicubic".
In your case, as you do not use Asharp, that is a different situation. I agree with you.

The problem now : what are you doing if you find the picture too soft :?:

incredible 10-13-2003 07:36 AM

In my last post I meant the option "bicubicresize & Asharp(1,2)", sorry for my english. :wink:

First bicubic then asharp gave me a well adaptive sharpened, cleaned and still detailed (espec. in hairs, skins etc.) image on tv in comparison to Lanczos.

The pics above are in deed handled by using only bicubic in combination with mergeLuma/Chroma-blur without asharp(). Ok, its looks a little softer but so this 180 minutes movie @ 480x576 fits on one CD-R80 and it appears a very very lot more sharper in comparison to a 352x288 encode, even sharper as a 352x576.
If I got an 120-140min, I remove the Merge... Lines ;-) cause of more CQ and shure by doing this it looks even sharper

But testing continues .... as there will release new filters and techniques :D

Dialhot 10-13-2003 08:13 AM

Ok, if I understand well your point :

- Bicubic then asharp = nice image, nice details
- Asharp then Bicubic = image with noises

I do not really see where can be the difference (except if you put some filters between the two lines). But I never tested the first order.

jorel 10-13-2003 08:42 AM

Quote:

Originally Posted by Dialhot
Ok, if I understand well your point :

- Bicubic then asharp = nice image, nice details
- Asharp then Bicubic = image with noises

I do not really see where can be the difference (except if you put some filters between the two lines). But I never tested the first order.

i did (thousands times)

- Bicubic then asharp = more size, less details!

- Asharp then Bicubic = less size, more details and
:arrow: more contrast !

- Bicubic without Asharp = less size, loss details!

- Lanczos without Asharp = more size(big), more details and
:arrow: strange artefacts in the edges!

:!:

<edited>
oops...i forgot:
my taste...
encrease the resolution to 702x480,
then you don't need asharp or lanczos.
use only bicubic!
:wink:

Dialhot 10-13-2003 09:01 AM

Quote:

Originally Posted by jorel
- Asharp then Bicubic = less size, more details and
:arrow: more contrast !

And more noise because you sharpen a noisy picture and asharp doesn't do any difference between a "good" and a "bad" pixel.

Quote:

Lanczos without Asharp = more size(big), more details and
:arrow: strange artefacts in the edges!
If someone can do me a sample of mpeg where these artefacts are really annoying, I take it.

jorel 10-13-2003 09:20 AM

Phil,

"and more noise because you sharpen a noisy picture..."
yeah,can be but my sources are clean dvds,then i don't got this problems.


the "strange artefacts" using lanczos seems "moving ants"
in the edges on low resolutions like 480x480 or less.

do you want pictures or little samples with and without lanczos?
:wink:

incredible 10-13-2003 12:25 PM

Wow it seems that this thread is getting a little confused .... but even mor interesting.

Quote:

Originally Posted by Dialhot
And more noise because you sharpen a noisy picture and asharp doesn't do any difference between a "good" and a "bad" pixel.

Well not definitely, that depends upon the threshold-value in Aharp() I think.

Quote:

Originally Posted by Dialhot
- Bicubic then asharp = nice image, nice details
- Asharp then Bicubic = image with noises

You forgot to mention the cleaner/denoiser ;-)
I meat that if you first use Lanczos (which sharpens the movie and in my opinion it also sharpens to much other things than only the edges) and if after a laczos there will be a temporal or spatial cleaner the work will be a little paradox.

So I meant:

- "bicubic" then "cleaner" then "a little asharp (if really needed and with threshold set only to handle the edges)" = nice image, nice details, sharp

- "lanczos" then cleaner = almost the same noise when using the same values in the cleaner-filter, so we have to rise up the values = maybe less quality in hairs & skins cause of more agressive cleaning values.

- "bicubic" then "cleaner" = nice image, enough details on Tv AND more CQ!

- "bicubic" then "cleaner" then a bit "mergel-uma/chroma-blur" to break the edges = nice image, still enough details on full vertical sizes like 576px (as seen in my pics above) just a touch softer on Tv but a rised CQ when predictioning for example long movies like my 180min sample above

On the other hand, if we use a sharpening with values of asharp(1,4) before resizing, the sharpen advantage can be killed again by the following downscaling.
Ok, maybe we will receive in relation an image condition as before resizing?!
Like a compensation? I don't know, cause every source is different.

Quote:

Originally Posted by Jorel
Lanczos without Asharp = more size(big), more details and
strange artefacts in the edges!

I can proof this, well artefacts or not but the picture looks a bit overtreated when watching on TV 8O .
I mean if a picture is sharpened to much it will look very good on a pc, well amazing, but a Tv and its interlacing can produce "flickering" when used to much sharpened streams.

And I think we should keep in mind that if our source is for example an 720x576 anamorph DVD/m2v stream we resize "down" to our desired resolution, so its not really necessary to do a sharpen before or after resizing cause we will preserve enough sharpeness when scaling down from a bigger detailed source. The case will be different if we have to "scale up" like Dvix/Xvid sources.

Well IMHO everything depends upon the quality of the source, of someones taste and so on. All this all is only my opinion based upon my experiences and testings but shurely even for me not definitive ;-) and thats what I like in here.. the discussion

Dialhot 10-13-2003 12:30 PM

Quote:

Originally Posted by jorel
yeah,can be but my sources are clean dvds,then i don't got this problems.

Yeah ! I forgot this essential point and was thinking only "theorically" :-). But you're right :-D

Quote:

do you want pictures or little samples with and without lanczos?
:wink:
Yes I do, if you can capture that !

Dialhot 10-13-2003 12:41 PM

Quote:

Originally Posted by incredible
You forgot to mention the cleaner/denoiser ;-)

I do not forgot, and you can see that I was wondering about that point :-)

Quote:

which sharpens the movie and in my opinion it also sharpens to much other things than only the edges
It is not Lanczos that sharpens, but Bicubic that softens ! :banghead:

I often mention a clip I have where the hero has a 2-day beard. Lanczos is the only resizer that does not litteraly shave the actor.
Bicubic isn't only a resizer, it's a Mach 3 razor :-)

Quote:

and if after a laczos there will be a temporal or spatial cleaner the work will be a little paradox.
Less paradoxal than doing that after an asharp, itself done after a softening bicubic. But we can discuss it all the night :-)

Quote:

- "bicubic" then "cleaner" = nice image, enough details on Tv AND more CQ!
Not enought details for me in fact. So I had to use a sharpening trick. That is my goal in using Lanczos. Teh best will be to find the image produced by bicubic sharpen enought. Because Lanczos makes my CQ drop by several points. I know that.

Quote:

On the other hand, if we use a sharpening with values of asharp(1,4) before resizing, the sharpen advantage can be killed again by the following downscaling.
You're right. That's an other reason to not making it this way.

Quote:

Tv and its interlacing can produce "flickering" when used to much sharpened streams.
Find the brakes and stop the train ! I found were is your/mine problem : I have a 100 Hz (the double of the normal PAL frequency) TV set. No flickering at all, like a PC monitor using high refresh frequency.

That perhaps were all is our difference :!:

Quote:

The case will be different if we have to "scale up" like Dvix/Xvid sources.
I never do upscaling.

jorel 10-13-2003 12:55 PM

yes friends,you are very clear in your explanations...thanks!
or we have eagles eyes or it depend of the source, don't?
:lol:
in the end is just a little differences!

.." that depends upon the threshold-value in Aharp() I think."
.."It is not Lanczos that sharpens, but Bicubic that softens ! "
..."I never do upscaling."
yeah!
:wink:

"... litteraly shave the actor. "
:rotf:

incredible 10-13-2003 02:47 PM

@ Dialhot

Quote:

Find the brakes and stop the train ! I found were is your/mine problem : I have a 100 Hz (the double of the normal PAL frequency) TV set. No flickering at all, like a PC monitor using high refresh frequency.
That perhaps were all is our difference
You lucky one, exact thats the point! :D That will be my next investment a 100Hz living room goal! Maybe Christmas :idea:

@ Jorel
Quote:

"... litteraly shave the actor. "
:rotf:
:facelick: right!
:D

BloodAngel 10-14-2003 08:49 AM

You guys are going way off topic :x , I still haven's solved that stupid problem. Can't i download the right script for the job somewhere? 8O

Dialhot 10-14-2003 09:06 AM

The answer to your question was in the second post of this tread :evil:
It seems that your problem isn't to DL the script, but to know what to do with it. For that you can go on the home page of KVCD.net and find guides on the right panel. They'll give you all informations needed to do a KVCD.

CheronAph 10-21-2003 12:06 AM

Quote:

Originally Posted by Dialhot
@ CheronAph
I'll post it tonight because I'm at the office right now.

Well, where is it?

CheronAph 10-21-2003 12:18 AM

@ incredible

I donīt get it, I used your script,
480x576 mpeg1
bitrates 64 ~ 3000
lenght 98 minutes
audio 128
CQ 63,160
http://www.digitalfaq.com/archives/error.gif

CheronAph 10-21-2003 12:24 AM

Hereīs the script I used, have I done it wrong,

LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\MPEG2Dec3.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\GripFit_YV12.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\STMedianFilter.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\undot.dll")
LoadPlugin("E:\-=[ KVCD ]=-\Filters\Avisynth_2.5\VSFilter.dll")

Mpeg2Source("D:\DVDtoKVCD\vts_01.d2v")

undot()
Limiter()
GripCrop(480, 576, overscan=3)
TextSub("D:\DVDtoKVCD\vts_01.srt")
GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(1.50))
MergeLuma(blur(0.1))
GripBorders()

rendalunit 10-21-2003 12:31 AM

I'm not sure what the topic is here but one little tip is to put the dll's into the PLUGINS directory where Avisynth is installed and then you don't need the 'LoadPlugin' lines in your script

CheronAph 10-21-2003 01:03 AM

Iīll do that!


All times are GMT -5. The time now is 04:50 AM  —  vBulletin Đ Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.