Jaded-Encoding-Thaumaturgy / vs-preview

Previewer for VapourSynth scripts.
Apache License 2.0
57 stars 16 forks source link

VSpreview cannot run #142

Closed wangjikang11 closed 2 months ago

wangjikang11 commented 2 months ago

VSpreview cannot run. The following is the code and error information. How can I fix it? code:

## Dependencies: Allows vspreview to run [required; do not remove]
import vstools
import vapoursynth as vs
from vapoursynth import core
from awsmfunc import FrameInfo
from vskernels import Hermite, EwaLanczos
from vspreview import set_output
from awsmfunc.types.placebo import PlaceboColorSpace as csp
from awsmfunc.types.placebo import PlaceboTonemapMode as TMmode
from awsmfunc.types.placebo import PlaceboTonemapFunction as TMfunc
from awsmfunc.types.placebo import PlaceboGamutMode as GMTmode
from awsmfunc.types.placebo import PlaceboTonemapOpts as TMopts

## <Additional dependencies>
## Place any additional dependencies you want to use in your comp here
## <End of additional dependencies>

## File paths: Hold shift and right-click your file, select copy as path, and paste it here
clip1 = core.lsmas.LWLibavSource(r"C:\Users\wangj\Desktop\影视对比\video\[奥本海默].Oppenheimer.2023.EUR.UHD.BluRay.2160p.x265.10bit.HDR.DTS-HD.MA.2Audios-CMCT\[奥本海默].Oppenheimer.2023.UHD.BluRay.2160p.x265.10bit.HDR.DTS-HD.MA.2Audios-CMCT.mkv")
clip2 = core.lsmas.LWLibavSource(r"C:\Users\wangj\Desktop\影视对比\video\[奥本海默].Oppenheimer.2023.EUR.UHD.BluRay.2160p.x265.10bit.HDR.DTS-HD.MA.2Audios-CMCT\[奥本海默].Oppenheimer.2023.UHD.BluRay.2160p.x265.10bit.HDR.DTS-HD.MA.2Audios-CMCT.mkv")
clip3 = core.lsmas.LWLibavSource(r"C:\Users\wangj\Desktop\影视对比\video\[奥本海默].Oppenheimer.2023.EUR.UHD.BluRay.2160p.x265.10bit.HDR.DTS-HD.MA.2Audios-CMCT\[奥本海默].Oppenheimer.2023.UHD.BluRay.2160p.x265.10bit.HDR.DTS-HD.MA.2Audios-CMCT.mkv")

### Source: Name of the source
source1 = "1"
source2 = "2"
source3 = "3"
#
### <Additional comp settings>
### Place any additional settings you want to use in your comp here
### <End of additional comp settings>
#
### Frameinfo: Displays the frame number, type, and group name in the top left corner (no modification required; add/remove lines as needed)
clip1 = FrameInfo(clip1, source1)
clip2 = FrameInfo(clip2, source2)
clip3 = FrameInfo(clip3, source3)
### FrameProp: Slowpoke Pics/file-name labeling (no modification required; add/remove lines as needed)
clip1 = clip1.std.SetFrameProp('Name', data = source1)
clip2 = clip2.std.SetFrameProp('Name', data = source2)
clip3 = clip3.std.SetFrameProp('Name', data = source3)
## Output: Comment/uncomment as needed depending on how many clips you're comparing
set_output(clip1)
set_output(clip2)
set_output(clip3)

error:

root: ERROR: There was an error while loading the script!
| Traceback (most recent call last):
|   File "C:\Users\wangj\AppData\Local\Programs\Python\Python312\Lib\site-packages\vspreview\models\outputs.py", line 55, in setValue
|     output = local_storage[str(i)]
|              ~~~~~~~~~~~~~^^^^^^^^
| KeyError: '0'

| During handling of the above exception, another exception occurred:

| Traceback (most recent call last):
|   File "C:\Users\wangj\AppData\Local\Programs\Python\Python312\Lib\site-packages\vspreview\main\window.py", line 403, in load_script
|     self.toolbars.main.rescan_outputs()
|   File "C:\Users\wangj\AppData\Local\Programs\Python\Python312\Lib\site-packages\vspreview\toolbars\main\toolbar.py", line 151, in rescan_outputs
|     self.outputs = outputs if isinstance(outputs, VideoOutputs) else VideoOutputs(self.main)
|                                                                      ^^^^^^^^^^^^^^^^^^^^^^^
|   File "C:\Users\wangj\AppData\Local\Programs\Python\Python312\Lib\site-packages\vspreview\models\outputs.py", line 35, in __init__
|     self.setValue(main, local_storage)
|   File "C:\Users\wangj\AppData\Local\Programs\Python\Python312\Lib\site-packages\vspreview\models\outputs.py", line 58, in setValue
|     output = self.out_type(vs_output, i, newstorage)  # type: ignore
|              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|   File "C:\Users\wangj\AppData\Local\Programs\Python\Python312\Lib\site-packages\vspreview\core\types\video.py", line 97, in __init__
|     self.setValue(vs_output, index, new_storage)
|   File "C:\Users\wangj\AppData\Local\Programs\Python\Python312\Lib\site-packages\vspreview\core\types\video.py", line 132, in setValue
|     self.prepared.clip = self.prepare_vs_output(self.source.clip)
|                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|   File "C:\Users\wangj\AppData\Local\Programs\Python\Python312\Lib\site-packages\vspreview\core\types\video.py", line 275, in prepare_vs_output
|     heuristics, assumed_props = video_heuristics(clip, True, assumed_return=True)
|                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| TypeError: video_heuristics() got an unexpected keyword argument 'assumed_return'

Thanks

Setsugennoao commented 2 months ago

Update vstools

wangjikang11 commented 2 months ago

Pls which vstools I need to update, thanks for the help

LightArrowsEXE commented 2 months ago

git latest should work.

wangjikang11 commented 2 months ago

it's worked, thank you !