Quantcast Avisynth: MA Script for a one-Movie DVD ? - Page 3 - digitalFAQ.com Forums [Archives]
Go Back    digitalFAQ.com Forums [Archives] > Video Production Forums > Avisynth Scripting

Reply
 
LinkBack Thread Tools
  #41  
09-01-2004, 11:17 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #42  
09-01-2004, 11:52 AM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
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. I have really appreciated your advice and obvious expertise in the past, but 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).
Reply With Quote
  #43  
09-01-2004, 11:57 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #44  
09-01-2004, 12:13 PM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #45  
09-01-2004, 12:20 PM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #46  
09-02-2004, 05:33 AM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
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.

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)
Reply With Quote
  #47  
09-02-2004, 05:49 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
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

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).
Reply With Quote
  #48  
09-02-2004, 08:41 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
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 . 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.
Reply With Quote
  #49  
09-02-2004, 08:52 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Dialhot
(hum... even mean divisible by two. You meant odd... no ?)
Exactly, I had a brain fart

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 . 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.
Reply With Quote
  #50  
09-02-2004, 09:11 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
  #51  
09-02-2004, 09:53 AM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
  #52  
09-03-2004, 04:01 AM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
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()
Reply With Quote
  #53  
09-03-2004, 04:34 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #54  
09-03-2004, 09:53 PM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
  #55  
09-04-2004, 02:21 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
Hey, you shouldn't use UnDot().RemoveGrain() as RemoveGrain has similar capabilities to UnDot. Better try RemoveGrain().RemoveDirt() To avoid blockiness during high motion, try to lower the mthreshold value in RemoveDirt. I use mainly mthreshold=100.
Reply With Quote
  #56  
09-04-2004, 02:36 AM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Boulder
Hey, you shouldn't use UnDot().RemoveGrain() as RemoveGrain has similar capabilities to UnDot. Better try RemoveGrain().RemoveDirt() 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.

I was doing it just for testing, and I'll now try your advice about RemoveDirt.
Thanks!
Reply With Quote
  #57  
09-04-2004, 09:05 AM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
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.
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?
Reply With Quote
  #58  
09-04-2004, 06:43 PM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #59  
09-04-2004, 09:19 PM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
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.... 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!

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.

1- undot deen


2- undot asharp deen


3- Kwag Motion Adaptive


what you (all) choose

:P
Reply With Quote
  #60  
09-05-2004, 02:20 PM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
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
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Ant Movie Cataloge script problems black prince Computers 1 07-20-2004 07:17 PM
Avisynth: Movie was too blue? Bilal Avisynth Scripting 10 08-26-2003 08:55 AM
DVD2SVCD: Script to convert entire movie? TheDJ Video Encoding and Conversion 21 08-07-2003 11:57 AM
Avisynth: Difference between MA script and optimal script? mistermickster Avisynth Scripting 2 08-01-2003 09:36 AM
KVCD: AVS script much worse than the straight movie Bigswaffo Video Encoding and Conversion 47 06-26-2002 10:24 AM




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