qwe7989199 / aegisub_scripts

Some scripts might be useful for fansub
MIT License
92 stars 10 forks source link

[Need Help]关于enc-hsub-VS.lua出现报错“Please check your ...”的问题 #5

Closed Cyame closed 4 years ago

Cyame commented 4 years ago

domo老师好,

感谢一直以来的脚本维护与开发。 关于使用消极套进行压制的时候,我这边似乎没有什么问题(因为本身是开发者,系统变量和环境都有配置的习惯)

帮同组的轴做配置的时候,已经添加路径并且进行了初始化。 但是点击Encode后,出现了持续报错Please check your QSVEnc等等错误(尝试了NVC,QSV和VCE等三种,均显示Check)

阅读源码后,

if exe=="NVEnc" and first_time then
        button,result=aegisub.dialog.display(dia_NV,{"OK","Save","Cancel"})
        if (button=="Save" or  button=="OK") then 
            text="NVpreset:"..result.NVpreset.."\nNVbitrate:"..result.NVbitrate.."\nNV_other_para:"..result.NV_other_para.."\n"
            file=io.open(enc_bat_set,"w")
            file:write(text)
            file:close()
            aegisub.dialog.display({{class="label",label="NVEnc setting was saved to:\n"..enc_bat_set}},{"OK"},{close='OK'})
            if not from_setting then
            if res.nvencpath=="" then t_error("Please check your NVEnc.",true) end
            bat_code=quo(res.nvencpath).." -i "..quo(scriptpath.."hardsub.vpy").." --vpy --vbrhq "..result.NVbitrate.." --preset "..result.NVpreset.." "..result.NV_other_para.." -o "..quo(target..encname..res.vtype)
            end
        else
            aegisub.cancel()
        end
    elseif exe=="NVEnc" and not first_time then
        if nvencpath=="" then t_error("Please check your NVEnc.",true) end
        bat_code=quo(nvencpath).." -i "..quo(scriptpath.."hardsub.vpy").." --vpy --vbrhq "..NVbitrate.." --preset "..NVpreset.." "..NV_other_para.." -o "..quo(target..encname..res.vtype)
    end

怀疑是否是nvencpath==""导致的问题?

可在配置已经将懒人包(暂时这么称呼)里的所有可以添加的库全部添加...

想请教一下具体原因。比如是否需要将lib添加进系统变量中?以及是否和中文盘符/路径有关?

qwe7989199 commented 4 years ago

elseif exe=="NVEnc" and not first_time then下面的 if nvencpath==""改成if res.nvencpath==""试一试(qsvenc等同理) 看看问题还存在么。 逻辑上前者是从配置文件中读取路径,后者是从界面结果(res)中读取路径。

确认无误后,我会改一下这部分代码。

另,这套东西基本依赖绝对路径的,除了avisynth相关的安装之外应该不涉及环境变量。