-3

尝试在 vapoursynth 中制作 gif,遵循教程但不断出现名称错误。如果有人可以帮助解释它有什么问题以及如何解决它,我将不胜感激。

Failed to initialize script.
Failed to evaluate the script:
Python exception: name 'video' is not defined

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1927, in 
vapoursynth.vpy_evaluateScript
File "src\cython\vapoursynth.pyx", line 1928, in 
vapoursynth.vpy_evaluateScript
File "C:/Users/caitl/Pictures/bbh.vpy", line 12, in 
core.max_cache_size = 1000 #Use this command to limit the RAM usage. 1000 or 2000 is fine.
NameError: name 'video' is not defined

代码

import os
import vapoursynth as vs
import havsfunc as haf
import mvsfunc as mvs
import descale as descale
import muvsfunc as muvs
import resamplehq as rhq
import CSMOD as cs
import Dither as dither

core = vs.get_core()
video = core.std.Trim(video, a, b)
video = haf.QTGMC(video, Preset="Slower", TFF=True)
video = core.fmtc.resample(video, css="444")
video = descale.Debilinear(video, 629,354)
video = mvs.BM3D(video, sigma=8.84, radius1=1, profile1="fast", matrix="709")
video = hnw.FineSharp(video, sstr=1.13)
video = core.std.CropRel(video, left=72, top=52, right=107, bottom=52)
video = core.fmtc.bitdepth(video, bits=8)
video.set_output()
4

2 回答 2

2

您没有在将其作为参数video的调用之前定义。Trim

于 2019-12-15T20:42:10.833 回答
1

文档中的示例脚本说您需要创建一个视频对象,例如,通过加载一个文件:

from vapoursynth import core
video = core.ffms2.Source(source='Rule6.mkv')

Rule6.mkv这将使用插件加载视频文件ffms2,假定已正确安装。

于 2019-12-15T22:43:52.573 回答