1 (edited by mashingan 18-03-2016 08:25:26)

Topic: [solved] video_in instead of core.ffms2.Source

Hi, is it possible to use

clip = video_in

instead of

clip = core.ffms2.Source(source="the_video_file.mkv")

?

I want to test your mpv build with various videos but seems redundant if I have to change the video source and calling it again in cmd.
For now using video_in will return error.
I'm on windows 10.

Thanks in advance.

Re: [solved] video_in instead of core.ffms2.Source

Here's the full script generated by the current windows dev. build:

import vapoursynth as vs
core = vs.get_core(threads=7)

core.std.LoadPlugin("<svp-path>\\plugins64\\svpflow1_vs.dll")
core.std.LoadPlugin("<svp-path>\\plugins64\\svpflow2_vs.dll")

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

crop_string  = "core.std.CropRel(input,0,2,0,0)"
resize_string = ""
super_params     = "{scale:{up:0},gpu:1,rc:true}"
analyse_params   = "{main:{search:{coarse:{distance:-8,bad:{sad:2000,range:24}},type:2}},refine:[{thsad:250}]}"
smoothfps_params = "{gpuid:11,rate:{num:5,den:2},algo:13,mask:{area:200},scene:{}}"

demo_mode   = 0
stereo_type = 0

########## BEGIN OF base.py ##########
# This file is a part of SmoothVideo Project (SVP) ver.4
# This is NOT the full Vapoursynth script, all used variables are defined via
# JScript code that generates the full script text.

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,fps=container_fps)
    smooth  = core.std.AssumeFPS(smooth,fpsnum=smooth.fps_num,fpsden=smooth.fps_den)
    if demo_mode==1:
        return demo(input,smooth)
    else:
        return smooth

if stereo_type == 1:
    lf = interpolate(core.std.CropRel(clip,0,(int)(clip.width/2),0,0))
    rf = interpolate(core.std.CropRel(clip,(int)(clip.width/2),0,0,0))
    smooth = core.std.StackHorizontal([lf, rf])
elif stereo_type == 2:
    lf = interpolate(core.std.CropRel(clip,0,0,0,(int)(clip.height/2)))
    rf = interpolate(core.std.CropRel(clip,0,0,(int)(clip.height/2),0))
    smooth = core.std.StackVertical([lf, rf])
else:
    smooth =  interpolate(clip)
########### END OF base.py ###########

smooth.set_output()

3 (edited by mashingan 18-03-2016 08:20:54)

Re: [solved] video_in instead of core.ffms2.Source

Thank you!
I added the keyword argument to core.svp2.SmoothFps to follow your example.
It seemed it need fps=container_fps, before I edited it, mpv always complained that SmoothFps couldn't find the framerates smile

In SVPFlow page for vapoursynth didn't stated for fps so I didn't know before.
(This is my first time trying vapoursynth, seemed nice, because of python syntax? big_smile )

Thank you again!
Worked marvelous cool