Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th June 2008, 21:41   #1  |  Link
steptoe
Registered User
 
steptoe's Avatar
 
Join Date: Mar 2003
Location: UK
Posts: 360
Scripts that require MOD 2/4/8/16

Is there a simple function that I could use to get my video source the right MOD for some functions or filters that require the sizes to be a specific size

I know some require it to be say MOD 8 and if it isn't you could end up with strange results or the filter even failing

EG

MOD(1280,1200,8)

Yes I know these values are correct, but its just an example without trying to find some weird source that has strange dimension


Where the first two are you width and height and the third is the actual MOD that you require to get the images sizes as they should be so the filter won't fail or do weird things to the source as its not dimensions that the filter or function was expecting
steptoe is offline   Reply With Quote
Old 16th June 2008, 21:58   #2  |  Link
mikeytown2
Resize Abuser
 
mikeytown2's Avatar
 
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
Your asking for something that would put this into a easy to use function?

Code:
ColorBars(641,481)
#mod 4 example
Mod = 4
OrginalW = width()
OrginalH = height()
ModW = Ceil(Float(OrginalW)/Mod)*Mod
ModH = Ceil(Float(OrginalH)/Mod)*Mod



AddBorders(ModW-OrginalW,ModH-OrginalH,0,0)

#Filter

Crop(ModW-OrginalW,ModH-OrginalH,0,0)
mikeytown2 is offline   Reply With Quote
Old 16th June 2008, 22:04   #3  |  Link
gzarkadas
Registered User
 
gzarkadas's Avatar
 
Join Date: Sep 2005
Location: 100011110010001000001 10000011111111000001
Posts: 222
Either RoundBs or IntBs would be suitable. They round / truncate to any base; in your case you should set the base argument to 2, 4, 8, etc. For example:
Code:
...
new_width = RoundBs(width, 8)
new_height = RoundBs(height, 8)
xxxResize(new_width, new_height)
# now last is mod-8
...
If you don't want to install AVSLib, you can paste the code of the functions from the related CVS file; it has no dependencies on other AVSLib modules.
__________________
AVSLib, a free extension library for Avisynth. Current version: 1.1.0 (beta), 14/05/2007.
[ Home page | Download page ]
gzarkadas is offline   Reply With Quote
Old 18th June 2008, 09:51   #4  |  Link
steptoe
Registered User
 
steptoe's Avatar
 
Join Date: Mar 2003
Location: UK
Posts: 360
Many thanks thats exactly what I was looking for
steptoe is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 +1. The time now is 19:42.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.