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 3rd January 2013, 00:49   #1  |  Link
xekon
Registered User
 
Join Date: Jul 2011
Posts: 217
Target Resize clip plugin constrain dimensions maintain aspect ratio width height

hope somebody finds this useful. I did a search for a script/plugin that could do this and didn't find anything. Let me know if you find any issues with the script or if you have any suggestions.

Code:
######
##
## Target Resize v0.1 by xekon
##
## Resizes by target width or height while maintaining aspect ratio and staying codec compliant
##
## Usage: Import("Tresize-v0.1.avsi")
## resize clip to 640 px wide: TresizeW(tw=640)
## resize clip to 480 px tall: TresizeH(th=480)
##
####
function TresizeW(clip input, int "tw", int "cMod") {
	tw = Default(tw, 640)#Width
	cMod = Default(cMod, 2)#codec Mod
	
	inH = input.height
	inW = input.width
	AR = (float(inW) / float(inH))
	th = int(float(tw) / AR)
	th = ((th / cMod) * cMod)
	Spline64Resize(input, tw, th)
}
function TresizeH(clip input, int "th", int "cMod") {
	th = Default(th, 480)#Height
	cMod = Default(cMod, 2)#codec Mod
	
	inH = input.height
	inW = input.width
	AR = (float(inW) / float(inH))
	tw = int(float(th) * AR)
	tw = ((tw / cMod) * cMod)
	Spline64Resize(input, tw, th)
}
xekon is offline   Reply With Quote
Old 23rd October 2013, 15:20   #2  |  Link
itsonlyjustincase
Registered User
 
Join Date: Nov 2009
Posts: 152
Hi,

I'm a avisynth noob

How to use it to have my .mp4 files resized ?
itsonlyjustincase is offline   Reply With Quote
Reply

Tags
constrain dimensions, maintain aspect ratio, resize

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 03:42.


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