SilSinn9801
17th August 2022, 02:06
Three years ago (or maybe more), HolyWu had written some helper function for looping still images with RGB & alpha layers (https://forum.doom9.org/showthread.php?p=1873530#post1873530):
# HolyWu's helper function for looping an RGB+alpha still image
def loop_vfx(c, times):
c[0] = c[0] * times
c[1] = c[1] * times
return c
I used this code in four VapourSynth R45 projects & was now trying to use it in a R59 project when I now get these warnings & errors in VapourSynth Editor r19:
2022-08-16 20:45:59.749
setVideoInfo: Video filter Source has more than one output node but only the first one will be returned
setVideoInfo: Video filter Source has more than one output node but only the first one will be returned
2022-08-16 20:45:59.797
Failed to evaluate the script:
Python exception: 'vapoursynth.VideoNode' object does not support item assignment
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 2890, in vapoursynth._vpy_evaluate
File "src\cython\vapoursynth.pyx", line 2891, in vapoursynth._vpy_evaluate
File "D:\fakepath\TH09_07.VPY", line 54, in
ChanLabelLoop = loop_vfx(ChannelLabels,9156)
File "D:\fakepath\TH09_07.VPY", line 12, in loop_vfx
c[0] = c[0] * times
TypeError: 'vapoursynth.VideoNode' object does not support item assignment
2022-08-16 20:45:59.888
Core freed but 1 filter instance(s) still exist
Core freed but 1 filter instance(s) still exist
For context, this is part of the script I’m trying to run that uses HolyWu’s loop_vfx function:
import vapoursynth as vs
from vapoursynth import core
import vsutils as vsu
import havsfunc as haf
import functools
import sys
import math
vsufuncs = vsu.vsutils()
# HolyWu's helper function for looping an RGB+alpha still image
def loop_vfx(c, times):
c[0] = c[0] * times
c[1] = c[1] * times
return c
# corrscope oscilloscope video
Corrscope = core.ffms2.Source(r'E:\corrscope\TH09_07.MKV') # 60 fps, RGB
CorrscopeCrop = Corrscope[8626:17782] # total 9156 frames
# corrscope channel-label overlay (RGB+alpha)
ChannelLabels = core.ffms2.Source(r'E:\corrscope\5FM+3SSG+ADPCM+RHY.png',alpha=True)
ChanLabelLoop = loop_vfx(ChannelLabels,9156) #invoking here HolyWu’s function
ChanLabelRGB = ChanLabelLoop[0].std.AssumeFPS(fpsnum=60,fpsden=1)
ChanLabelMask = ChanLabelLoop[1].std.AssumeFPS(fpsnum=60,fpsden=1) # match frame rate to corrscope video
# Overlay channel labels onto corrscope segment
Loop2 = haf.Overlay(CorrscopeCrop,ChanLabelRGB,mask=ChanLabelMask)
Loop2.set_output()
This code above would’ve worked fine under VapourSynth R45, but under R59 it refuses to work now.
# HolyWu's helper function for looping an RGB+alpha still image
def loop_vfx(c, times):
c[0] = c[0] * times
c[1] = c[1] * times
return c
I used this code in four VapourSynth R45 projects & was now trying to use it in a R59 project when I now get these warnings & errors in VapourSynth Editor r19:
2022-08-16 20:45:59.749
setVideoInfo: Video filter Source has more than one output node but only the first one will be returned
setVideoInfo: Video filter Source has more than one output node but only the first one will be returned
2022-08-16 20:45:59.797
Failed to evaluate the script:
Python exception: 'vapoursynth.VideoNode' object does not support item assignment
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 2890, in vapoursynth._vpy_evaluate
File "src\cython\vapoursynth.pyx", line 2891, in vapoursynth._vpy_evaluate
File "D:\fakepath\TH09_07.VPY", line 54, in
ChanLabelLoop = loop_vfx(ChannelLabels,9156)
File "D:\fakepath\TH09_07.VPY", line 12, in loop_vfx
c[0] = c[0] * times
TypeError: 'vapoursynth.VideoNode' object does not support item assignment
2022-08-16 20:45:59.888
Core freed but 1 filter instance(s) still exist
Core freed but 1 filter instance(s) still exist
For context, this is part of the script I’m trying to run that uses HolyWu’s loop_vfx function:
import vapoursynth as vs
from vapoursynth import core
import vsutils as vsu
import havsfunc as haf
import functools
import sys
import math
vsufuncs = vsu.vsutils()
# HolyWu's helper function for looping an RGB+alpha still image
def loop_vfx(c, times):
c[0] = c[0] * times
c[1] = c[1] * times
return c
# corrscope oscilloscope video
Corrscope = core.ffms2.Source(r'E:\corrscope\TH09_07.MKV') # 60 fps, RGB
CorrscopeCrop = Corrscope[8626:17782] # total 9156 frames
# corrscope channel-label overlay (RGB+alpha)
ChannelLabels = core.ffms2.Source(r'E:\corrscope\5FM+3SSG+ADPCM+RHY.png',alpha=True)
ChanLabelLoop = loop_vfx(ChannelLabels,9156) #invoking here HolyWu’s function
ChanLabelRGB = ChanLabelLoop[0].std.AssumeFPS(fpsnum=60,fpsden=1)
ChanLabelMask = ChanLabelLoop[1].std.AssumeFPS(fpsnum=60,fpsden=1) # match frame rate to corrscope video
# Overlay channel labels onto corrscope segment
Loop2 = haf.Overlay(CorrscopeCrop,ChanLabelRGB,mask=ChanLabelMask)
Loop2.set_output()
This code above would’ve worked fine under VapourSynth R45, but under R59 it refuses to work now.