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. |
19th August 2013, 05:32 | #1 | Link |
Registered User
Join Date: Nov 2011
Posts: 13
|
Width and Num
Hi
I'd like to change the Num generator based on the width of the video, how can i make this script work? Code:
Width <= 1200 ? Eval(""" S = V.SVSuper("{rc:false,gpu:1, scale:{up:2, down:2}}") A = S.SVAnalyse("{main:{coarse:{distance:-1, bad:{SAD:20}}},penalty:{pzero:1,pnbour:1000}}, refine:[{thsad:20}]}") V.SVSmoothFps(S, A, "{rate:{num:50000,den:1001,abs:true},algo:21, mask:{area:30,cover:100,area_sharp:1.0},scene:{blend:false,mode:0,limits:{blocks:100}}}", url=URL, mt=100) GetMTMode(false) > 0 ? distributor() """): last Width > 1200 ? Eval(""" S = V.SVSuper("{rc:false,gpu:1, scale:{up:2, down:2}}") A = S.SVAnalyse("{main:{coarse:{distance:-1, bad:{SAD:20}}},penalty:{pzero:1,pnbour:1000}}, refine:[{thsad:20}]}") V.SVSmoothFps(S, A, "{rate:{num:60000,den:1001,abs:true},algo:21, mask:{area:30,cover:100,area_sharp:1.0},scene:{blend:false,mode:0,limits:{blocks:100}}}", url=URL, mt=100) GetMTMode(false) > 0 ? distributor() """): last Thanks |
19th August 2013, 09:40 | #2 | Link | |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
Quote:
Code:
Width = V.Width I got the same error about a missing :, but only when I didn't have SVPflow installed - after that I got other errors about OpenCL so I didn't investigate much further. Doing two exclusive tests on Width seems a bit wasteful - you could just do: Code:
Width > 1200 ? Eval("""...""") : Eval("""...""") Off the top of my head, and not tested due to lack of plugins: Code:
mynum = V.width <= 1200 ? "50000" : "60000" S = V.SVSuper("{rc:false,gpu:1, scale:{up:2, down:2}}") A = S.SVAnalyse("{main:{coarse:{distance:-1, bad:{SAD:20}}},penalty:{pzero:1,pnbour:1000}}, refine:[{thsad:20}]}") V.SVSmoothFps(S, A, "{rate:{num:" + mynum + ",den:1001,abs:true},algo:21, mask:{area:30,cover:100,area_sharp:1.0},scene:{blend:false,mode:0,limits:{blocks:100}}}", url=URL, mt=100) GetMTMode(false) > 0 ? distributor() : last Last edited by wonkey_monkey; 19th August 2013 at 12:21. Reason: fixed as per Gavino's post below |
|
19th August 2013, 09:47 | #3 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
You can simplify the code to this:
Code:
num = Width <= 1200 ? 50000 : 60000 S = V.SVSuper("{rc:false,gpu:1, scale:{up:2, down:2}}") A = S.SVAnalyse("{main:{coarse:{distance:-1, bad:{SAD:20}}},penalty:{pzero:1,pnbour:1000}}, refine:[{thsad:20}]}") V.SVSmoothFps(S, A, "{rate:{num:"+String(num)+",den:1001,abs:true},algo:21, mask:{area:30,cover:100,area_sharp:1.0},scene:{blend:false,mode:0,limits:{blocks:100}}}", url=URL, mt=100) GetMTMode(false) > 0 ? distributor() : last GetMTMode(false) > 0 ? distributor() : last |
|
|