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 ;-)


All times are GMT -5. The time now is 06:35 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.