### SagaraS Scriptmaker - Version 6.1 ###
### Lade Plugins und setze die globalen Variablen ###
LoadPlugin("C:\Program Files (x86)\SagaraS Scriptmaker\Plugins\resamplehq.dll")
Global breite = 2048
Global hoehe = 1152
Global AR = 0
### Lade Videoquellen ###
SetMTMode(3,2)
### Filter Verarbeitungszone ###
(IsYUY2() == true) ? ConvertToYV16() : Last
### Funktion für Video-Laderoutine ###
Function AVIload (String file, int loading, int cl, int co, int cr, int cu, string pixtype, string afps, int fpsn, int fpsd) {
pixtype2 = (pixtype == "YUY2") ? "YUY2" : (pixtype == "RGB24") ? "RGB24" : (pixtype == "Y8") ? "Y8" : (pixtype == "YV12") ? "YUV420P8" : (pixtype == "YV24") ? "YUV444P8" : pixtype
(loading == 1) ? FFIndex(file) : nop()
clip0 = (loading == 3) ? (pixtype == "Auto") ? LWLibavVideoSource(file) : LWLibavVideoSource(file, format = pixtype2) : (loading == 2) ? Import(file).KillAudio() : (loading == 1) ? (pixtype == "Auto") ? FFVideoSource(file, threads=1) : FFVideoSource(file, threads=1, colorspace=pixtype) : (pixtype == "Auto") ? AVISource(file, false).KillAudio() : AVISource(file, false, pixel_type=pixtype).KillAudio()
clip1 = clip0.AutoFPS(afps, fpsn, fpsd).Cropping(cl, co, cr, cu)
Return (clip1.width == breite && clip1.height == hoehe) ? clip1 : Clip1.Resize()
}
Function AutoFPS (Clip clip0, string afps, int fpsn, int fpsd) {
rate1 = (afps == "Auto") ? (Round(Float(clip0.framerate * 1000)) / 1000) / 2 : nop()
rate2 = (afps == "Auto") ? Round(clip0.framerate) / 2 : nop()
rate = (afps == "Auto") ? (rate1 == rate2) ? 1 : 1001 : (afps == "Igno.") ? clip0.frameratedenominator : fpsd
ratefaktor = (afps == "Auto") ? (rate == 1001) ? 1000 : 1 : nop()
clip0 = (afps == "Auto") ? (rate == 1001) ? clip0.AssumeFPS(Round(clip0.Framerate) * 1000, rate) : clip0.AssumeFPS(round(clip0.framerate), rate) : (afps == "Igno.") ? clip0.AssumeFPS(clip0.frameratenumerator, rate) : clip0.AssumeFPS(fpsn, rate)
Return clip0
}
Function Cropping (Clip clip0, int cl, int co, int cr, int cu) {
clip0 = (clip0.IsRGB32() == True) ? clip0.ConvertToRGB24() : clip0
Return (cl != 0
co != 0
cr != 0
cu != 0) ? clip0.Crop(cl, co, cr, cu) : clip0
}
Function SameColorAs (clip clip0, clip clip1) {
wert1 = (clip0.IsRGB32() == true) ? 0 : (clip0.IsRGB24() == true) ? 1 : (clip0.IsYV24() == true) ? 2 : (clip0.IsYUY2() == true) ? 3 : (clip0.IsYV16() == true) ? 4 : (clip0.IsYV12 == true) ? 5 : (clip0.IsYV411() == true) ? 6 : 7
wert2 = (clip1.IsRGB32() == true) ? 0 : (clip1.IsRGB24() == true) ? 1 : (clip1.IsYV24() == true) ? 2 : (clip1.IsYUY2() == true) ? 3 : (clip1.IsYV16() == true) ? 4 : (clip1.IsYV12 == true) ? 5 : (clip1.IsYV411() == true) ? 6 : 7
return (wert1 == wert2) ? clip0 : (wert2 == 0) ? clip0.ConvertToRGB32() : (wert2 == 1) ? clip0.ConvertToRGB24() : (wert2 == 2) ? clip0.ConvertToYV24() : (wert2 == 3) ? clip0.ConvertToYUY2() : (wert2 == 4) ? clip0.ConvertToYV16() : (wert2 == 5) ? clip0.ConvertToYV12() : (wert2 == 6) ? clip0.ConvertToYV411() : clip0.ConvertToY8()
}
Function Resize (Clip clip1) {
clip3 = clip1
clip1 = (AR == 1) ? ((float(Clip1.height * breite) / clip1.width) / 2 == round((float(Clip1.height * breite) / clip1.width) / 2)) ? ((float(Clip1.width * hoehe) / clip1.height) / 2 == round((float(Clip1.width * hoehe) / clip1.height) / 2)) ? clip1 : clip1.ConvertToRGB24() : clip1.ConvertToRGB24() : clip1
clip1 = (AR == 1) ? (((clip1.width * hoehe) / clip1.height > breite) ? Clip1.ResampleHQ(breite, round(float(Clip1.height * breite) / clip1.width), Kernel = "Spline36", srcmatrix = "TV.709", dstmatrix = "TV.709") : Clip1.ResampleHQ(round(float(clip1.width * hoehe) / clip1.height), hoehe, Kernel = "Spline36", srcmatrix = "TV.709", dstmatrix = "TV.709")) : clip1.ResampleHQ(breite, hoehe, Kernel = "Spline36", srcmatrix = "TV.709", dstmatrix = "TV.709")
back = (AR == 1) ? (0 == 1) ? ImageReader("", 0, clip1.framecount - 1, clip1.framerate).ChangeFPS(clip1.frameratenumerator, clip1.frameratedenominator).ResampleHQ(breite, hoehe, Kernel = "Spline36", dstcolorspace="RGB24", srcmatrix = "TV.709", dstmatrix = "TV.709") : BlankClip(clip1, width = breite, height = hoehe, pixel_type = "RGB24").KillAudio() : clip1
Return (AR == 1) ? Overlay(back, clip1, (back.width - clip1.width) / 2, (back.height - clip1.height) / 2).SameColorAs(clip3) : clip1
}