1 (edited by dlr5668 07-04-2016 10:19:40)

Topic: [vapoursynth] new batch video encoding method

Hello, guys! Today we will learn how to convert multiple files to 60 fps. We will use StaxRip.

http://i.imgur.com/A2ykcUN.png

Why staxrip ?

  • amazing GUI

  • support VS

  • great profile system

First we need to add svp to VS chain (make sure to fix paths):

core = vs.get_core(threads=19)

core.std.LoadPlugin("C:\\Program Files (x86)\\SVP 4 Dev\\plugins64\\svpflow1_vs.dll")
core.std.LoadPlugin("C:\\Program Files (x86)\\SVP 4 Dev\\plugins64\\svpflow2_vs.dll")

clip = clip.resize.Bicubic(format=vs.YUV420P8)

crop_string  = ""
resize_string = "core.resize.Bicubic(input,1280,720,filter_param_a=0,filter_param_b=0.75)"
super_params     = "{pel:1,scale:{up:0},gpu:1,full:false,rc:true}"
analyse_params   = "{main:{search:{coarse:{distance:-8},distance:0}}}"
smoothfps_params = "{gpuid:11,rate:{num:2,den:1},algo:13,mask:{area:50},scene:{blend:true}}"

def interpolate(clip):
    input = clip
    if crop_string!='':
        input = eval(crop_string)
    if resize_string!='':
        input = eval(resize_string)

    super   = core.svp1.Super(input,super_params)
    vectors = core.svp1.Analyse(super["clip"],super["data"],input,analyse_params)
    smooth  = core.svp2.SmoothFps(input,super["clip"],super["data"],vectors["clip"],vectors["data"],smoothfps_params,src=clip)
    smooth  = core.std.AssumeFPS(smooth,fpsnum=smooth.fps_num,fpsden=smooth.fps_den)
    return smooth

smooth =  interpolate(clip)

smooth.set_output()

http://i.imgur.com/QCutqAB.png

Second, setup x264 encode setting and save template.
http://i.imgur.com/qi0RPuR.png

Add file list and press start.

I have 1.5x real time performance for my task (medium quality video encode for phone).
http://i.imgur.com/R1V4XAS.png

2 (edited by dlr5668 07-04-2016 15:13:01)

Re: [vapoursynth] new batch video encoding method

GIF guide:
http://gfycat.com/VainDelayedAmericanwirehair
http://gfycat.com/ArtisticWholeAdmiralbutterfly

Profile path %appdata%\StaxRip x64\Templates

Post's attachments

svp avisynth.srip 28.26 kb, 1428 downloads since 2016-04-07 

svp VS.srip 27.97 kb, 1421 downloads since 2016-04-07 

Re: [vapoursynth] new batch video encoding method

Thanks a bunch for these instructions, been looking for some modern app like this for a while.
However, I get Python exception: name 'core' is not defined that implies it can't

import vapoursynth as vs

Funny thing is when I run python from command prompt I can import this module just fine since it was installed properly. Any idea why that is?

By the way, you're missing the import line in the text script even though you have it in the screenshot.

Re: [vapoursynth] new batch video encoding method

No errors for me with this:
http://i.imgur.com/QCutqAB.png
I ll update pics in post.

Re: [vapoursynth] new batch video encoding method

esv wrote:

Thanks a bunch for these instructions, been looking for some modern app like this for a while.
However, I get Python exception: name 'core' is not defined that implies it can't

import vapoursynth as vs

Funny thing is when I run python from command prompt I can import this module just fine since it was installed properly. Any idea why that is?

By the way, you're missing the import line in the text script even though you have it in the screenshot.

That line will break script. Its only needed with svp manager.

Re: [vapoursynth] new batch video encoding method

That line will break script.

Sorry, I'm a bit confused — are you using/running this script somewhere? I thought you only need it inside SVP manager and nowhere else?  Or am I missing something?

Re: [vapoursynth] new batch video encoding method

dlr5668 wrote:

No errors for me with this:

Thanks, now that other error is gone (you were right, should not have imported the module, I guess StaxRip does it automatically).
However, now I get another exception

Python exception: Plugin: path\to\Vapoursynth\plugins64\svpflow1_vs64.dll already loaded (com.svp-team.flow1)

Do you know how come it's already loaded? Is it safe to ignore?

Re: [vapoursynth] new batch video encoding method

Ok, thanks! I've just ignored this 2nd exception and it converted the video.
However, the output is 47.952fps (which is double the source 23.976). Sorry for such a nub question, but where exactly do you set the target FPS rate?

9 (edited by dlr5668 07-04-2016 10:54:22)

Re: [vapoursynth] new batch video encoding method

Uploaded gifv guide

Re: [vapoursynth] new batch video encoding method

esv

smoothfps_params = "{gpuid:11,rate:{num:2,den:1},algo:13,mask:{area:50},scene:{blend:true}}"

num - numerator
den - denominator
They must be integer

11 (edited by esv 07-04-2016 10:58:33)

Re: [vapoursynth] new batch video encoding method

MAG79 wrote:

dlr5668
I think

num:2.5,den:1

will not work
It must be

num:5,den:2

wink

Yeah, tried 2.5 before, didn't work, that's why I wasn't sure this was the right place.
Ok, 5 works, but is there a way to make it 60FPS? Of course 120FPS (=x5) is even better, but that comes at a performance price I don't really want to pay since my monitor is 60FPS.

Re: [vapoursynth] new batch video encoding method

MAG79 wrote:

dlr5668
I think

num:2.5,den:1

will not work
It must be

num:5,den:2

wink

Nice catch. I only tested 12 fps webcam videos with this script and 24 -> 72.

13 (edited by esv 07-04-2016 11:01:08)

Re: [vapoursynth] new batch video encoding method

25/10 works!
By the way, does it matter if it's not exact 60FPS? Does it have any effect on playback (something slowly going out of sync or something)? I guess not, but I don't really know this stuff very well.

14 (edited by esv 07-04-2016 11:15:22)

Re: [vapoursynth] new batch video encoding method

Thanks for the GIFs!
Interesting though, when I open a file, I get this popup menu http://i.imgur.com/rgqXKkl.png
and when I select e.g. Automatic VapourSynth or VapourSynth ffms2 my SVP settings get overwritten and I have to copy&paste script again.
How come you don't have that popup menu and can use your templates and then load a file?

P.S.
Sorry don't know how to resize picture in this forum. But resized it at imgur source

15 (edited by dlr5668 07-04-2016 11:18:19)

Re: [vapoursynth] new batch video encoding method

I uploaded my basic profiles in 2nd post. Try it.

Copy paste svp settings to 3rd tab

16 (edited by esv 07-04-2016 11:29:52)

Re: [vapoursynth] new batch video encoding method

My StaxRip crashes when I try to open your srip files
But it doesn't matter as much since your guides/screenshots are detailed enough and are working for me. I just don't get why opening a new file overwrites my preset. Plus if you could point to a good guide on those settings (specifically, am interested in a few quality presets that have already been tested and can be used so I don't have to spend a lot of time reading on each of the options)

Exception
Exception has been thrown by the target of an invocation.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at StaxRip.x264Encoder.get_QualityMode() in D:\Projekte\GitHub\staxrip\General\x264.vb:line 500
   at StaxRip.MainForm.UpdateEncoderStateRelatedControls() in D:\Projekte\GitHub\staxrip\Forms\MainForm.vb:line 4773
   at StaxRip.VideoEncoder.OnStateChange() in D:\Projekte\GitHub\staxrip\General\VideoEncoder.vb:line 138
   at StaxRip.MainForm.OpenProject(String path, Boolean saveCurrent) in D:\Projekte\GitHub\staxrip\Forms\MainForm.vb:line 1278
   at StaxRip.MainForm.OpenProject(String path) in D:\Projekte\GitHub\staxrip\Forms\MainForm.vb:line 1244
   at StaxRip.MainForm.OpenProjectFile() in D:\Projekte\GitHub\staxrip\Forms\MainForm.vb:line 2932
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at StaxRip.CommandManager.Process(Command command, List`1 params) in D:\Projekte\GitHub\staxrip\General\General.vb:line 1125
   at StaxRip.CommandManager.Process(String name, List`1 params) in D:\Projekte\GitHub\staxrip\General\General.vb:line 1120
   at StaxRip.UI.CustomMenu.Process(CustomMenuItem item) in D:\Projekte\GitHub\staxrip\UI\Menu Types.vb:line 232
   at StaxRip.UI.CustomMenu.OnCommand(CustomMenuItem item) in D:\Projekte\GitHub\staxrip\UI\Menu Types.vb:line 225
   at StaxRip.UI.CustomMenu.OnKeyDown(Object sender, KeyEventArgs e) in D:\Projekte\GitHub\staxrip\UI\Menu Types.vb:line 209
   at System.Windows.Forms.KeyEventHandler.Invoke(Object sender, KeyEventArgs e)
   at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
   at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
   at System.Windows.Forms.Form.ProcessKeyPreview(Message& m)
   at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
   at System.Windows.Forms.Control.WmKeyChar(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Label.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Re: [vapoursynth] new batch video encoding method

I am lost. I do not understand this. Could someone please post a _full_ info on how to convert video files to 60/75/90FPS etc?
Maybe you guys were doing this for years, but when it says "First we need to add svp to VS chain (make sure to fix paths):" it's like black magic to me. I don't know how to add SVP to VS chain. I don't know how to fix the path.

Please, could someone spend a 5 minutes of their time and explain this?

Re: [vapoursynth] new batch video encoding method

Any help?

Re: [vapoursynth] new batch video encoding method

SVP90FPS wrote:

Any help?

watch 2 gifs, copy paste settings.

20

Re: [vapoursynth] new batch video encoding method

SVP90FPS wrote:

Any help?

Can you be more specific what you need help with? There are already steps laid out above, even with gif screencasts that show where to click. You don't really need to understand toolchains or anything to be able to replicate it. I also did it with 0 experience with this stuff

Re: [vapoursynth] new batch video encoding method

I also would like some help because when I try to copy and paste those srip files into that folder and try to use them, I also can get the same error.
I don't know how to change the directory anyway inside of the file because I can't get to the script editor I can see in the gif

Re: [vapoursynth] new batch video encoding method

Huh, did anyone else get an antivirus warning for "Trojan: Win32/Maltule.C!cl" from StaxRip?

..\StaxRip-x64-1.3.6.0-stable\Apps\qaac\refalac64.exe
..\StaxRip-x64-1.3.6.0-stable\Apps\qaac\qaac64.exe

Were both flagged as containing that upon extraction sad

23 (edited by brucethemoose 06-09-2016 19:44:37)

Re: [vapoursynth] new batch video encoding method

Is this code still relevant? StaxRip just skips right over the SVP script whenever I try to use it.


EDIT: Nevermind, it works for other clips. There's just something VERY screwy about how this DVD is encoded hmm

24 (edited by brucethemoose 07-09-2016 10:45:37)

Re: [vapoursynth] new batch video encoding method

Another quick question: where's the "motion vectors grid" parameter in that script?

EDIT: Also, can I just remove the resize string? I really don't want SVP scaling my video to 720p.

25 (edited by dlr5668 07-09-2016 12:12:33)

Re: [vapoursynth] new batch video encoding method

brucethemoose wrote:

Another quick question: where's the "motion vectors grid" parameter in that script?

EDIT: Also, can I just remove the resize string? I really don't want SVP scaling my video to 720p.

change
resize_string = "core.resize.Bicubic(input,1280,720,filter_param_a=0,filter_param_b=0.75)"
to
resize_string = ""

setup grid here:
analyse_params="{block:{w:32,h:32},main:{search:{coarse:{distance:-12,bad:{sad:2000}},distance:-8},levels:3},refine:[{search:{distance:-6}},{search:{distance:-4}}]}"

you can run svp, open movie than

https://lh3.googleusercontent.com/-8GZKemeL0FU/V9ADzyjsDRI/AAAAAAAAK7U/l80jmJMonv4/s0/2016-09-07_15-10-55.png

and copy paste analyse_params line from svp generated script