digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: MA script for a one-movie DVD ? (http://www.digitalfaq.com/archives/avisynth/8294-avisynth-ma-script.html)

Boulder 09-01-2004 11:17 AM

Just load your d2v file in FitCD and input the crop values. Don't allow FitCD to crop any extra pixels. The program will give you the correct values - I've never bothered calculating them on my own :wink:

nicksteel 09-01-2004 11:52 AM

Quote:

Originally Posted by Dialhot
I already told you to read the manual !

http://www.avisynth.org/Crop
http://www.avisynth.org/AddBorders

Don't you think that using A LITTLE of your time to read it will prevent everyone here to spent some of their to answer to such "simple" questions ?

(note : your values are strange : DVD2AVI should cut on values divisible by 16 or 32).

These values are from DVD2AVI Clip & Resize. They are obviously not multiples of 16. Hence, my question.

Sorry to annoy you Phil. I'll not be asking any more "simple" or other questions. :D I have really appreciated your advice and obvious expertise in the past, but 8O I actually have begun to cringe at your answers. (And I did read the documentation, but had a problem understanding usage and with the multiples of 16).

Boulder 09-01-2004 11:57 AM

Crop doesn't need mod-16 values, and neither does resizing. Besides, DVD2AVI doesn't give you any values for resizing, it just subtracts the number of pixels cropped from the original frame size. 480 - 58 - 62 = 360 and 720 - 8 - 0 = 712.

nicksteel 09-01-2004 12:13 PM

Thanks, Boulder.

I'm a bit thick with this, but will continue to try to get it to work. I haven't been able to successfully plug the values into the Crop and AddBorders lines without getting a DCTFilter multiple of 16 error. The documentation for Crop is a bit vague to me. I know this is a failure due to my lack of understanding.

Boulder 09-01-2004 12:20 PM

It's simply Crop(left,top,-right,-bottom). Notice the minus sign in front of right and bottom.

If you resize normally, you should get a mod-16 width and height. Better yet, place DCTFilter after the borders have been added.

nicksteel 09-02-2004 05:33 AM

I finally did it as below. Found clip data with TMPGEnc clip and used values from MovieStacker. DCTFilter worked at end of script.

The source was about 2 1/2 hours and ended up with CQ of 88.5. Am running now.

:D Thanks, Boulder.

Mpeg2Source("H:\source.d2v")
BicubicResize(688, 350, 0, 0.6, 8, 57, 704, 360)
Fluxsmooth()
TemporalCleaner(5,10)
Undot()
AddBorders(16, 65, 16, 65)
DCTFilter(1,1,1,1,1,1,0.5,0)

Boulder 09-02-2004 05:49 AM

You still have weird borders and cropping, you should never ever add or remove an even number of pixels - you are only asking for trouble with those values. This is a MovieStacker anomaly, you should really use FitCD.

And you're also cropping 8 pixels off left and right and 57 pixels off the top and bottom, but you have yourself verified these values:

Left 0
Right 8
Top 58
Bottom 62

I'll do it this time for you, next time you're on your own :wink:

Code:

Mpeg2Source("H:\source.d2v")
Crop(0,58,-8,-62)
BicubicResize(688, 352, 0, 0.6)
Fluxsmooth()
TemporalCleaner(5,10)
Undot()
AddBorders(16, 64, 16, 64)
DCTFilter(1,1,1,1,1,1,0.5,0)

I simply fed the values you stated in FitCD and ta-da, there's the correct resizing and borders.

Besides you're killing the movie by overfiltering if you ask me :?

Also if you have an anamorphic source, I think you should keep it as anamorphic. Two and a half hours is not that much when you're talking about NTSC material.

EDIT: I'd also go for 704x480, there's a quality gain there. Resizing would be BicubicResize(672,336,0,0.6) and borders AddBorders(16,72,16,72).

Dialhot 09-02-2004 08:41 AM

Quote:

Originally Posted by Boulder
You still have weird borders and cropping, you should never ever add or remove an even number of pixels

(hum... even mean divisible by two. You meant odd... no ?)
Actually you can remove the number of pixels you want. BlindPP is the only filter I know that prevent to crop with arbitrary values (because it need to works on the original borders of the 8x8 blocks so you must crop pixels 8 by 8). But you just have to use blindPP before the crop line.

But the addborder should always be with even numbers. The best is to have mod8 ones.

Boulder 09-02-2004 08:52 AM

Quote:

Originally Posted by Dialhot
(hum... even mean divisible by two. You meant odd... no ?)

Exactly, I had a brain fart :lol:

Quote:

Actually you can remove the number of pixels you want. BlindPP is the only filter I know that prevent to crop with arbitrary values (because it need to works on the original borders of the 8x8 blocks so you must crop pixels 8 by 8). But you just have to use blindPP before the crop line.
From the Avisynth docs:

--
In order to preserve the data structure of the different colorspaces, the following mods should be used. You will not get an error message if they are not obeyed, but it may create strange artifacts.

In RGB:
width no restriction
height no restriction if video is progressive
height mod-2 if video is interlaced

In YUY2:
width mod-2
height no restriction if video is progressive
height mod-2 if video is interlaced

In YV12:
width mod-2
height mod-2 if video is progressive
height mod-4 if video is interlaced
--

Hence we should crop mod-2 pixels as we're usually dealing with progressive video and YV12 data. To be safe, crop in mod-4.

Dialhot 09-02-2004 09:11 AM

Quote:

Originally Posted by Boulder
Hence we should crop mod-2 pixels as we're usually dealing with progressive video and YV12 data. To be safe, crop in mod-4.

Oh, you're right. I was forgotten limit of Crop itself. I have to check if I always respect that in my jobs, but I'm not sure :-(

nicksteel 09-02-2004 09:53 AM

Boulder,

My problem was an old version of FitCD. New version is clear and, with your examples, I understand the values now. Will use FitCD in the future!

Using Phil's method, my script looks like this. Am making anamorphic.

Mpeg2Source("H:\source.d2v")
LanczosResize(672,336,0,58,720,360)
Undot()
Deen()
AddBorders(16,72,16,72)


Thanks for your patience, Guys :D :D :D

nicksteel 09-03-2004 04:01 AM

Another question
 
In the script:

Mpeg2Source("H:\source.d2v")
LanczosResize(672,336,0,58,720,360)
Undot()
Deen()
AddBorders(16,72,16,72)

I need to use Inverse Telecine to raise CQ (NTSC Film Source). :?: Should it look like:

Mpeg2Source("H:\source.d2v")
Undot()
Limiter()
Telecide(order=1, guide=0, gthresh=10, post=2, vthresh=50, dthresh=7, blend=false, show=false)
Decimate(cycle=5, mode=0, threshold=0, threshold2=3, quality=2, show=false)
LanczosResize(672,336,0,58,720,360)
Deen()
AddBorders(16,72,16,72)
Limiter()

Boulder 09-03-2004 04:34 AM

Yes, although you should use guide=1 in Telecide.

But if you really have a film source, i.e. 95% or more FILM content shown in DVD2AVI after saving a project file without Force FILM enabled, you should redo the project with Force FILM enabled.

muaddib 09-03-2004 09:53 PM

Quote:

Originally Posted by Dialhot
Currently : Undot().Deen()
That's all !

Hi Phil,

I think that even only “undot().deen()” will smooth the picture more than the MA script on low motion frames. Here are two screen shots I take:
1- nemo_ma_1179.png – optimal MA script
2- nemo_deen_1179.png – just “undot().deen()”
obs: no resize was used, just the filters

If you check them you will see that the DEEN one is more smoothed than the MA one.
Of course that on high motion frames the smoothness is much more with the MA script, but that is supposed to happen as in high motion we do not notice the smoothness as we do in low motion.

Thinking about this why not use MA script even with KDVD?

Now, please, I would like to know from you all what are your experiences with the MA script.
Is it perfectly working the way it was proposed?
Or there are flaws, miss calculation of the motion?
What about scene change, is it a problem or the script handle it good?

I’m asking it because I have some mixed feelings about MA script.
There were movies that I had some amazing results with it, but there are times that the results were not as good as I expected.

Please check the screenshots and tell me what you think.
Here is also a screenshot with just “Undot().RemoveGrain()” - nemo_removegrain_1179.png

Boulder 09-04-2004 02:21 AM

Hey, you shouldn't use UnDot().RemoveGrain() as RemoveGrain has similar capabilities to UnDot. Better try RemoveGrain().RemoveDirt() :idea: To avoid blockiness during high motion, try to lower the mthreshold value in RemoveDirt. I use mainly mthreshold=100.

muaddib 09-04-2004 02:36 AM

Quote:

Originally Posted by Boulder
Hey, you shouldn't use UnDot().RemoveGrain() as RemoveGrain has similar capabilities to UnDot. Better try RemoveGrain().RemoveDirt() :idea: To avoid blockiness during high motion, try to lower the mthreshold value in RemoveDirt. I use mainly mthreshold=100.

My fault... I missed you in your comment.
You said that you'd ditch all the noise reducing filters except UnDot(), and just after that you said, though you would replace it with RemoveGrain(mode=2). The "replace" word is what I missed. :oops: :mrgreen:

I was doing it just for testing, and I'll now try your advice about RemoveDirt.
Thanks!

jorel 09-04-2004 09:05 AM

Quote:

Originally Posted by muaddib
If you check them you will see that the DEEN one is more smoothed than the MA one.
Of course that on high motion frames the smoothness is much more with the MA script, but that is supposed to happen as in high motion we do not notice the smoothness as we do in low motion.

:arrow: TRUE :!:

Quote:

Originally Posted by muaddib
Thinking about this why not use MA script even with KDVD?

Yeah, why not :?:
...no more comments ?

muaddib can you use:
undot()
asharp(1,2)
deen()
to get the same picture and post for comparisons?

Dialhot 09-04-2004 06:43 PM

Quote:

Originally Posted by jorel
Quote:

Originally Posted by muaddib
Thinking about this why not use MA script even with KDVD?

Yeah, why not :?:
...no more comments ?

I never used MA script for any of my works(KVCD or KDVD). Is is enougth to describe how I like it ?

But I agree that the couple Undot/Deen has to be discussed/enhanced.

jorel 09-04-2004 09:19 PM

the league of extraordinary gentlemen,
chapter 07 only with 00:01.02 (60.348 seconds) :

tmpgenc adjusts: mpeg-2 720x480 23,976 CQ 80, msp normal,
min=700 max 8000, Gop 1,15,2,1,15 and kvcd nothch matrix

3 scripts.... :arrow: all .avs scripts without resizes:

1-
MPEG2Source("D:\leg.D2V")
undot()
deen()

2-
MPEG2Source("D:\leg.D2V")
undot()
asharp(1,2)
deen()

3-
LoadPlugin("C:\Filters25\MPEG2Dec3.dll")
LoadPlugin("C:\Filters25\STMedianFilter.dll")
LoadPlugin("C:\Filters25\asharp.dll")
LoadPlugin("C:\Filters25\unfilter.dll")
LoadPlugin("C:\Filters25\undot.dll")
MPEG2Source("D:\leg.D2V")
undot()
asharp(1, 4)
STMedianFilter(3, 3, 1, 1 )
MergeChroma(blur(1.5))
MergeLuma(blur(0.1))
ScriptClip(" nf = YDifferenceToNext()" +chr(13)+ "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) ")
function fmin( int f1, int f2) {
return ( f1<f2 ) ? f1 : f2
}

time needed to encode with each script: sorry,i forgot to note...when i remember....was late! :oops:

final sizes from each script:
1- 14,8Mb ( 15.254Kb )
2- 15,3Mb ( 15.671Kb )
3- 15,5Mb ( 15.883Kb )

pictures... i don't choose a special scene to post.
*best way to see the pictures: right click and open a new page for each picture. :wink:

1- undot deen
http://www.digitalfaq.com/archives/error.gif

2- undot asharp deen
http://www.digitalfaq.com/archives/i.../2004/09/6.jpg

3- Kwag Motion Adaptive
http://www.digitalfaq.com/archives/i.../2004/09/7.jpg

what you (all) choose :?:

:P 8)

incredible 09-05-2004 02:20 PM

Jorel, nice tests ...

but I cant get your pictures working :-(

I also did them on my DVD rebuilder workouts.

1-
MPEG2Source("D:\leg.D2V")
undot()
deen()

Yep, the classic one, but to me still to general as Deen should be tweaked to the source noise condition. ;-)



2-
MPEG2Source("D:\leg.D2V")
undot()
asharp(1,2)
deen()

Same here BUT an asharp of 1,2 does plain the details IMHO too much. The lower the second value the more it plains, a higher value will rise the sharpen threshold (edgedetection).



3-

The MA script behaves on every source different as if the source gots more motion, the more it blurs, the more the compression in relation to the other two scripts will rise ;-)

jorel 09-05-2004 03:27 PM

Quote:

Originally Posted by incredible
Jorel, nice tests ...

but I cant get your pictures working :-(

;-)

thanks ink but if you don't saw the pictures using right click on the thumbnails-open new page ? 8O
try here:
http://img74.exs.cx/my.php?loc=img74...1undotdeen.jpg

http://img74.exs.cx/my.php?loc=img74...asharpdeen.jpg
http: /img74.exs.cx/my.php?loc=img74&image=01undotasharpdeen.jpg - edited, the last link was posted twice!
http://img74.exs.cx/my.php?loc=img74...onAdaptive.jpg

please,tell me if is working now(here is ok and load faster)
if don't work i can send the pictures for you.

anyone have problems to open the pictures too? :?

rds_correia 09-05-2004 04:28 PM

Hi Jorel,
First and second time I browsed your post I could open them and I could also see a thumbnail.
So I downloaded them.
But now, there is no thumbnail either.
Something's wrong with imageshack or kvcd.net :roll:
Cheers

jorel 09-05-2004 09:14 PM

oh my GOD,what's wrong!?!?...then i don't know what to do! :?
i clean all the temp files,historic and cookies from IE and firefox,then i open this page again....i see the thumbnails and clicking on them i open each image in ~14 seconds....imageshack is in USA and i in Brasil.....the emoticons in my signature are in imageshack too....do you see that emoticons ?
all pictures that i posted in 5 forums are hosted in imageshack and all are opening!
the links to the pictures still not working for you all in Europe? :?
well....i can send by mail if you want!

jorel 09-05-2004 09:23 PM

i was editing the last post and get:
Error in deleting post

DEBUG MODE

SQL Error : 1016 Can't open file: 'phpbb_search_wordmatch.MYI'. (errno: 145)

DELETE FROM phpbb_search_wordmatch WHERE post_id IN (100965)

Line : 417
File : /home/kvcdnet/public_html/forum/includes/functions_search.php

....i never saw it before!
maybe is a local problem,don't know! :?
this afternoon(inmy local hour) 36 members in the forum and 12 logged.
in few seconds the pages stop to open and seconds later "none" was logged and only 6 guests in the forum.
:arrow: ink was logged with me and was logged out together with us all,maybe he remember.
:arrow: do you remember that moment ink :?:

kwag 09-05-2004 09:27 PM

Fixed :!:
I just ran a "Repair" on the database ;)
It was probably some inconsistencies when I imported the database from the old hosting.

-kwag

rds_correia 09-06-2004 03:03 PM

Hi guys,
Well, sorry for the off-topic but I would add that the forum has been growing slower every minute since we moved last time.
In the early stages it was faster than a bullet, then it went as fast as when we were at ipowerweb and now it's slow as hell :evil:
I have experienced this both at work and now at home and I'm using different PCs and ISPs.
I have to wait more than 10 seconds to move between pages...
Other sites/forums are still fast as always.
Just thought I should warn Karl about it.
Cheers

kwag 09-06-2004 03:11 PM

Quote:

Originally Posted by rds_correia
I have to wait more than 10 seconds to move between pages...
Other sites/forums are still fast as always.

Yes Rui, you are correct.
I am also seeing that ~10 second delay between page loading.
It seems it's a database loading problem, because the main portal www.kvcd.net still loads very fast between pages, and that is on the same host.
I'm sending a note to tech support now :!:

Thanks,
-kwag

jorel 09-06-2004 07:41 PM

@ all

right click on thumbnail and open a new page to see in full size:

1- undot deen
http://www.digitalfaq.com/archives/error.gif

2- undot asharp deen
http://www.digitalfaq.com/archives/i.../2004/09/6.jpg

3- Kwag Motion Adaptive
http://www.digitalfaq.com/archives/i.../2004/09/7.jpg

nobody saw that pictures? 8O

Kwag,ink,Correia,Jell,Boulder...and ALL ...i'm waiting opinions and nobody post anything. you're opinions are very importants !

@ Phil
Phil, do you "Phil" how i "Phil" ? :lol:
waiting for all and no one post with answers!

muaddib 09-07-2004 01:34 AM

Quote:

Originally Posted by jorel
muaddib can you use:
undot()
asharp(1,2)
deen()
to get the same picture and post for comparisons?

Sure... here it is: nemo_asharp-deen_1179.png

Also here is anoter screenshot with boulder's sujestion (that I like) with
RemoveGrain(mode=2).RemoveDirt(mthreshold=100): nemo_removegrain-removedirt_1179.png

jorel 09-07-2004 08:19 AM

thanks muaddib! :wink:

all the links to your sample pictures together here:

http://www.jltoca.uaivip.com.br/Movi...mo_ma_1179.png

http://www.jltoca.uaivip.com.br/Movi..._deen_1179.png

http://www.jltoca.uaivip.com.br/Movi...-deen_1179.png

http://www.jltoca.uaivip.com.br/Movi...edirt_1179.png

i have my vote but waiting the general opinions from all! :wink:

@ all
your votes and comments? .....don't forget to see my samples pictures too!
:)

jorel 09-10-2004 03:34 PM

:seehearspeak:

no one? dead thread? better forget? rest in peace? :?
if yes, don't need to post ! :expert: ......


.... :crashed:

black prince 09-11-2004 09:15 AM

@jorel,

I'm going with asharp-deen :wink: They are all close, but the contrast
seemed better with asharp-deen. :)

-BP

jorel 09-11-2004 09:58 AM

Quote:

Originally Posted by black prince
@jorel,

I'm going with asharp-deen :wink: They are all close, but the contrast
seemed better with asharp-deen. :)

-BP

the earth start to rumble,
the world powers fall,
the glory in all the heaven,
a peacefull man stands tall!

:arrow: thank you BP! :D

this thread is alive again!
reborn after dead!
:lol:

fabrice 09-12-2004 01:02 AM

Hi,

From Muaddib samples, I prefer MA and asharp+deen over others: they are sharper. The 'worst' is deen one and I find removegrain+removedirt a bit blurry.
And between MA and asharp+deen: it's very difficult to see differences, at least in my monitor (a 17'' TFT one)

About Jorel samples: mi monitor don't show me differences at the normal size. Have to zoom them (and Muaddib samples too)!

Salu2
Fabrice

EDITED: Can't zoom because of resolution.

Jorel: wich one do you prefer?

incredible 09-12-2004 01:51 AM

Jorel, try instead of deen a sample using removedirt(...) as suggested by boulder. I personally avoid using a spatial filter when treating (good) DVD sources. Maybe undot() or Removegrain at light settings but nothing else.

A hint: Removegrain works spatial and removedirt works temporal

jorel 09-12-2004 03:01 AM

all right ink.
that's the Boluder's post, right?

Quote:

Originally Posted by Boulder
Hey, you shouldn't use UnDot().RemoveGrain() as RemoveGrain has similar capabilities to UnDot. Better try RemoveGrain().RemoveDirt() :idea: To avoid blockiness during high motion, try to lower the mthreshold value in RemoveDirt. I use mainly mthreshold=100.

i can't find removegrain and don't know the removedirt parameters. :?
where i get removegrain? it's not built in avisynth and i can't find in warpenterprises site!

can you post a script , please? :)

incredible 09-12-2004 05:57 AM

www.removedirt.de.tf

www.removegrain.de.tf

:wink:

jorel 09-12-2004 09:28 AM

thanks ink.

i get the files and i'm reading all details ! :wink:

audioslave 09-12-2004 09:45 AM

@Dialhot
Just one question about the resizing:
Do you use the same script for both menus+extras and for the main movie? I mean, sometimes the menus and extras are 4:3 but the movie is 16:9...?
Also, I made some comparisons, and I think that FluxSmoothT(7) is WAY too much filtering. At least that's what it looks like in the stills. To me it seems that 3-4 is more than enough (temporal) filtering. Feedback please. :wink:

audioslave 09-12-2004 10:17 AM

Well after some extended testing I found the following settings very pleasing to my eyes:
Code:

LoadPlugin("G:\DVD\AVISynth\KDVD\MPEG2Dec3.dll")
LoadPlugin("G:\DVD\AVISynth\KDVD\FluxSmooth.dll")

Mpeg2Source("G:\DVD\Rippat\Temp\temp.d2v", iDCT=7)
LanczosResize(688, 416, 9, 76, 702, 424)
MergeLuma(Sharpen(0.05))
FluxSmoothST(1, 2)
AddBorders(16, 80, 16, 80)

Every comments and suggestions are more than welcome. :)


All times are GMT -5. The time now is 09:08 AM  —  vBulletin © Jelsoft Enterprises Ltd

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