Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ######################
- # Updated 5/17/2017
- # This is meant to be a starter script for using MPC-HC to capture with a PEXHDCAP
- # I currently use PEXHDCAP driver 1.1.0.140.7 with these settings: http://i.imgur.com/DG4RlHH.jpg
- # The Video Proc Amp tab: http://i.imgur.com/L6xdn9a.jpg
- ######################
- # Google Search for these plugins
- LoadPlugin("C:\avisynth\ColorMatrix.dll")
- LoadPlugin("C:\avisynth\ChromaShift.dll")
- #
- ######################
- # This function is used to fix the capturing from specifically the PEXHDCAP
- # You can tweak the levels a bit if you want to change the look.
- ######################
- function colorcorrection(clip c)
- {
- c
- # Fix the Chroma Shift that is caused by the PEXHDCAP
- ChromaShift(U=-2)
- ConvertToYV24()
- #Fix the Luma, it is off by 1 pixel
- MergeLuma(Crop(1,0,width-1,height).AddBorders(0,0,1,0))
- # Convert back so we are working in the correct colorspace
- ConvertToYUY2(matrix="Rec.709")
- # Adjust Gamma to more closely match a CRT TV and clamp the color levels to what the PEXHDCAP captures (16-235)
- Levels(0, 0.82, 255, 16, 235, coring=false)
- # Convert to the SD colorspace, the PEXHDCAP captures in the HD colorspace
- ColorMatrix(mode="Rec.709->Rec.601")
- }
- #
- ######################
- # This is the basic capture function for 240p material, it crops, resizes, and does a couple of minor adjustments.
- # cx = cropping px from the left side
- # cy = cropping px from the top
- # cw = width of game, used for cropping right side
- # w = final width to size to
- # s = amount to sharpen horizontally
- ######################
- function capture(clip c, float cx, float cy, int cw, int w, float s)
- {
- c
- h=2
- # Crop and Resize to the correct height (224*2)
- PointResize(cw, h*224 , cx, cy*h/2, cw, 224)
- #
- # Adjust the saturation (optional)
- Tweak(sat=1.05)
- # Resize to the final Width
- BicubicResize(w, Height)
- #Sharpen after the resize
- Sharpen(s, 0.0)
- #
- }
- ######################
- # Created this function after reading Acmlm's capture guide here: http://acmlm.org/etc/vidfilters/snes.htm
- # I found that this can create a sharper picture, but it also requires a lot more tweaking.
- # cx = cropping px from the left side
- # cy = cropping px from the top
- # cw = width of game, used for cropping right side
- # w = final width to size to
- # s = amount to sharpen the width
- ######################
- function NEWcapture(clip c, float cx, float cy, float cw, int w, float s)
- {
- c
- # Convert to the YV24 Colorspace to minimize colorbleed
- ConvertToYV24()
- # Crop and resize the width to the native game capture size (256*224)
- # These are done in subpixel increments and can vary between game systems
- BicubicResize(260, 224, -0.6, -0.1, cx, cy, cw, 224)
- # Sharpen the image from the resize
- Sharpen(s, 0)
- # 2 pixels are left on the right and left sides (on purpose) crop them off here
- crop(2, 0, Width-4, Height)
- # Set the size to 512x448
- PointResize(Width*2, Height*2)
- # Convert back to the correct colorspace
- ConvertToYUY2()
- # Resize to the final Width
- BicubicResize(w, Height)
- }
- ######################
- # This function is for capturing 240p video (usually NES, SNES, Genesis) from a S-Video source (GV-USB2 etc..)
- # cx = cropping px from the left side
- # cy = cropping px from the top
- # cw = width of game, used for cropping right side
- # w = final width to size to
- # s = amount to sharpen horizontally
- ######################
- function captureSVID240(clip c, float cx, float cy, int cw, int w, float s)
- {
- c
- # Separate Fields, this creates 60fps video with half height
- ComplementParity.SeparateFields()
- # Double the Height to get back to original
- PointResize(Width, Height*2)
- # Crop and resize
- PointResize(cw, 448 , cx, cy, cw, 448)
- # Set the width
- BicubicResize(w, Height)
- # These can be adjusted to your liking, look them up on the Avisynth Wiki
- Tweak(sat=1.05)
- Sharpen(s, 0.0)
- }
- #
- ######################
- # This is the main area where you adjust things.
- # Generally I copy/paste a new function then adjust cropping for that new game.
- # These functions assume the final game height is 448px.
- #####################
- #
- # Only use this with a PEXHDCAP
- colorcorrection()
- #
- # These functions are for a PEXHDCAP
- capture(33, 8, 644, 586, 0.3) #SNES
- #capture(60, 7, 622, 586, 0.3) #DW
- #capture(30, 8, 660, 586, 0.3) #SM64
- #capture(40, 12, 640, 586, 0.3) #LoZ
- #capture(40, 8, 640, 586, 0.3) #Z2
- #
- # Use this function if you have a GV-USB2 or Dazzle
- #captureSVID240(42, 16, 640, 586, 0.3) #SNES (ALTTP)
- #
- #This is the advanced capture function, it will take a bunch of tweaking to get the subpixel cropping correct (240p suite recommended)
- #resized to 512x448 with these settings, adjust the width after you get the subpixel cropping perfect
- #NEWcapture(28.55, 8, 654.3, 512, 0.3) #SNES
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement