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.

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)

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}}}"

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()

Second, setup x264 encode setting and save template.

Add file list and press start.

I have 1.5x real time performance for my task (medium quality video encode for phone).

Re: [vapoursynth] new batch video encoding method

Profile path %appdata%\StaxRip x64\Templates

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:

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?

Re: [vapoursynth] new batch video encoding method

esv

num - numerator
den - denominator
They must be integer

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

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

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

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.

Re: [vapoursynth] new batch video encoding method

Thanks for the GIFs!
Interesting though, when I open a file, I get this popup menu
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

Re: [vapoursynth] new batch video encoding method

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

Copy paste svp settings to 3rd tab

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, List1 params) in D:\Projekte\GitHub\staxrip\General\General.vb:line 1125
at StaxRip.CommandManager.Process(String name, List1 params) in D:\Projekte\GitHub\staxrip\General\General.vb:line 1120
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?

Any help?

Re: [vapoursynth] new batch video encoding method

SVP90FPS wrote:

Any help?

watch 2 gifs, copy paste settings.

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

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

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.

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: