获取名称错误:VapourSync/Python中未定义名称“video”

2024-05-19 07:07:16 发布

您现在位置:Python中文网/ 问答频道 /正文

尝试在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

Code

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

Tags: thetoincoreimportisasvideo
2条回答

在调用Trim将其作为参数之前,您没有定义video。你知道吗

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

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

这将使用^{}插件加载一个视频文件Rule6.mkv,该插件假定已正确安装。你知道吗

相关问题 更多 >

    热门问题