Topic: SVP 4 - ArchLinux - ffff.py syntax error

Hi everyone,

I'm using archlinux and I've installed SVP4 with the official installer, not the AUR package (but I've installed all dependencies manually).

When I try to transcode a video, the transcoding fails because of some python/json parsing issue.  Any idea what to look for?

Here's the output

10:46:47.760: ===== Starting mpv ======
10:46:47.760: Command line: /usr/bin/mpv /home/jucer/intro.original.mp4 --o=/home/jucer/intro.SVP.temporary.mkv --no-audio --no-sub --no-sub-auto --input-ipc-server=/tmp/mpvencodesocket --input-media-keys=no --no-msg-color --vf=vapoursynth:/home/jucer/.local/share/SVP4/scripts/ffff.py:4:4 --of=matroska --ovc=h264_nvenc --ovcopts=b=20005789,preset=slow,profile=high,rc=vbr_hq,maxrate=26007526,bufsize=40011578,time_base=1000/60000,threads=4
10:46:48.507: (+) Video --vid=1 (*) (h264 1920x1080 30.003fps)
10:46:48.507: Audio --aid=1 (*) (aac 2ch 44100Hz)
10:46:48.635: [vapoursynth] Script evaluation failed:
10:46:48.635: [vapoursynth] Python exception: SVSuper: invalid 'params' syntax: * Line 1, Column 2
10:46:48.635: [vapoursynth] Missing '}' or object member name
10:46:48.635: [vapoursynth]
10:46:48.635: [vapoursynth]
10:46:48.635: [vapoursynth] Traceback (most recent call last):
10:46:48.635: [vapoursynth] File "src/cython/vapoursynth.pyx", line 1956, in vapoursynth.vpy_evaluateScript
10:46:48.635: [vapoursynth] File "src/cython/vapoursynth.pyx", line 1957, in vapoursynth.vpy_evaluateScript
10:46:48.635: [vapoursynth] File "/home/jucer/local/share/SVP4/scripts/ffff.py", line 56, in <module>
10:46:48.635: [vapoursynth] smooth = interpolate(clip)
10:46:48.635: [vapoursynth] File "/home/jucer/.local/share/SVP4/scripts/ffff.py", line 37, in interpolate
10:46:48.635: [vapoursynth] super = core.svp1.Super(input_m8,super_params)
10:46:48.635: [vapoursynth] File "src/cython/vapoursynth.pyx", line 1862, in vapoursynth.Function.__call__
10:46:48.635: [vapoursynth] vapoursynth.Error: SVSuper: invalid 'params' syntax: * Line 1, Column 2
10:46:48.635: [vapoursynth] Missing '}' or object member name
10:46:48.635: [vapoursynth]
10:46:48.635: [vapoursynth]
10:46:48.647: (!!!) Intermediate file may be broken: /home/jucer/intro.SVP.temporary.mkv
10:46:48.647: ===== mpv exited with code 9 =====

Re: SVP 4 - ArchLinux - ffff.py syntax error

/home/jucer/local/share/SVP4/scripts/ffff.py ?

Re: SVP 4 - ArchLinux - ffff.py syntax error

Yeah, it is generated by the SVP Manager, it contains :

# This script was generated by SVP 4 Manager.
# Check https://www.svp-team.com for more details.

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

core.std.LoadPlugin("/home/jucer/SVP4/plugins/libsvpflow1_vs64.so")
core.std.LoadPlugin("/home/jucer/SVP4/plugins/libsvpflow2_vs64.so")

clip = video_in

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,gpu_qn:2,rate:{num:2,den:1},algo:13,mask:{area:100},scene:{}}"

src_fps     = container_fps if container_fps>0.1 else 30
demo_mode   = 0
stereo_type = 0
nvof = 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_um - original frame in 4:2:0
# input_m  - cropped and resized (if needed) frame
# input_m8 - input_m converted to 8-bit
    input_um = clip.resize.Point(format=vs.YUV420P8,dither_type="random")
    input_m = input_um
    input_m8 = input_m

    if nvof:
        smooth  = core.svp2.SmoothFps_NVOF(input_m,smoothfps_params,nvof_src=input_m8,src=input_um,fps=src_fps)
    else:
        super   = core.svp1.Super(input_m8,super_params)
        vectors = core.svp1.Analyse(super["clip"],super["data"],input_m8,analyse_params)
        smooth  = core.svp2.SmoothFps(input_m,super["clip"],super["data"],vectors["clip"],vectors["data"],smoothfps_params,src=input_um,fps=src_fps)


    if demo_mode==1:
        return demo(input_m,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 = smooth.resize.Point(format=vs.YUV420P8)

Re: SVP 4 - ArchLinux - ffff.py syntax error

I don't see any syntax errors in 'super_params' string. Are you totally sure this exact script gives that exact error? hmm

Re: SVP 4 - ArchLinux - ffff.py syntax error

Yes, at least, that's what the log message suggests.  If I try to add quotes around the json property names and run the command at the top of the log directly on the command line, I get a bit further but then I get other errors (like having to add pel : 1 in the super_params json...

Re: SVP 4 - ArchLinux - ffff.py syntax error

I am having this same issue except my use case is mpv playback and the script name is 50d0701.py.  Exact same line numbers and errors.

Re: SVP 4 - ArchLinux - ffff.py syntax error

Could it have something to do with python version?

Re: SVP 4 - ArchLinux - ffff.py syntax error

Quaternions, Arch too?

I can only think of a conflict with a system-provided jsoncpp, as libsvpflow* are _statically_ linked with modified jsoncpp to allow "simplified" JSON w/o extra quotes.

But I can't reproduce this behavior, SVP works fine on mine Arch VM.
Will try to updated it to the latest version now, will see...

Re: SVP 4 - ArchLinux - ffff.py syntax error

I'm using Manjaro.  SVP worked great when I first installed it, I'm trying to look through my package install history and uninstall whatever unneeded packages I can find between when it was working and stopped working to try to make this work again

Re: SVP 4 - ArchLinux - ffff.py syntax error

seems to work after updating too...
BTW I'm using mpv-full AUR: https://aur.archlinux.org/packages/mpv-full/

Re: SVP 4 - ArchLinux - ffff.py syntax error

Yeah, I just successfully installed SVP onto my laptop also running Manjaro and it works fine using mpv-full.  Something is mucked up on my desktop and jucer's configuration and I don't have the expertise to debug and find out what it is.  Maybe I should install random packages onto my laptop until it breaks...

Re: SVP 4 - ArchLinux - ffff.py syntax error

I installed jellyfin mpv shim (pip install, not from AUR) which has its own mpv.conf location, and launching mpv from that app works even though plain mpv does not work.  Hopefully that can narrow down where the problem is originating from.

Re: SVP 4 - ArchLinux - ffff.py syntax error

I am also having this issue:

22:23:32.946 [E]: Playback [5f36749]: VS - Script evaluation failed:
22:23:32.946 [E]: Playback [5f36749]: VS - Python exception: SVSuper: invalid 'params' syntax: * Line 1, Column 2
22:23:32.946 [E]: Playback [5f36749]: VS - Missing '}' or object member name
22:23:32.946 [E]: Playback [5f36749]: VS - Traceback (most recent call last):
22:23:32.946 [E]: Playback [5f36749]: VS - File 'src/cython/vapoursynth.pyx', line 2244, in vapoursynth.vpy_evaluateScript
22:23:32.946 [E]: Playback [5f36749]: VS - File 'src/cython/vapoursynth.pyx', line 2245, in vapoursynth.vpy_evaluateScript
22:23:32.946 [E]: Playback [5f36749]: VS - File '/home/$USER/.local/share/SVP4/scripts/5f36749.py', line 56, in <module>
22:23:32.946 [E]: Playback [5f36749]: VS - smooth = interpolate(clip)
22:23:44.998 [E]: Playback [5f36749]: VS - File '/home/$USER/.local/share/SVP4/scripts/5f36749.py', line 37, in interpolate
22:23:44.998 [E]: Playback [5f36749]: VS - super = core.svp1.Super(input_m8,super_params)
22:23:44.998 [E]: Playback [5f36749]: VS - File 'src/cython/vapoursynth.pyx', line 2069, in vapoursynth.Function.__call__
22:23:44.998 [E]: Playback [5f36749]: VS - vapoursynth.Error: SVSuper: invalid 'params' syntax: * Line 1, Column 2
22:23:44.998 [E]: Playback [5f36749]: VS - Missing '}' or object member name
22:23:44.998 [E]: Playback [5f36749]: VS - could not init VS

Very strange... I'm using mpv-full, so I guess I just have to mess with alternative packages or something?

14 (edited by NerdyDeeds 17-11-2020 18:18:17)

Re: SVP 4 - ArchLinux - ffff.py syntax error

Seems like I'm running into a similar error. Until my most recent update, svp was working perfectly. I tried uninstalling the aur package and installed it with the tarball provided here, but it made no difference. I'm using mpv-full-git 0.32.0.r813.g26fc70dbfd-1 and vapoursynth-git R52.14.gc7cc7b95-1, running arch on kernel 5.9.8-zen1-1-zen #1 ZEN SMP PREEMPT. Here's the error:

❯ mpv the.new.pope.s01e01.1080p.bluray.x264-ouija.mp4              
 (+) Video --vid=1 (*) (h264 1920x1080 25.000fps)
 (+) Audio --aid=1 --alang=eng (*) (aac 6ch 48000Hz)
Using hardware decoding (nvdec-copy).
[ao/pulse] The --audio-stream-silence option is set. This will break certain player behavior.
AO: [pulse] 48000Hz 5.1 6ch float
VO: [gpu] 1920x1080 nv12
AV: 00:00:00 / 00:58:43 (0%) A-V:  0.000 Cache: 170s/150MB
[autoconvert] Converting nv12 -> yuv420p
[vapoursynth] Script evaluation failed:
[vapoursynth] Python exception: SVSuper: invalid 'params' syntax: * Line 1, Column 2
[vapoursynth]   Missing '}' or object member name
[vapoursynth] 
[vapoursynth] 
[vapoursynth] Traceback (most recent call last):
[vapoursynth]   File "vapoursynth.pyx", line 2244, in vapoursynth.vpy_evaluateScript
[vapoursynth]   File "vapoursynth.pyx", line 2245, in vapoursynth.vpy_evaluateScript
[vapoursynth]   File "/home/bt/.local/share/SVP4/scripts/c93e5595.py", line 56, in <module>
[vapoursynth]     smooth =  interpolate(clip)
[vapoursynth]   File "/home/bt/.local/share/SVP4/scripts/c93e5595.py", line 37, in interpolate
[vapoursynth]     super   = core.svp1.Super(input_m8,super_params)
[vapoursynth]   File "vapoursynth.pyx", line 2069, in vapoursynth.Function.__call__
[vapoursynth] vapoursynth.Error: SVSuper: invalid 'params' syntax: * Line 1, Column 2
[vapoursynth]   Missing '}' or object member name
[vapoursynth] 
[vapoursynth] 
[vapoursynth] could not init VS
Disabling filter vapoursynth.00 because it has failed.

Re: SVP 4 - ArchLinux - ffff.py syntax error

please try today's update (svpflow libs rev.205)