Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th October 2021, 16:13   #1  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,474
Resize error: Resize error 3074: no path between colorspaces (2/2/2 => 5/2/2).

Using R57-RC1 and:
Code:
# Imports
import os
import sys
import ctypes
# Loading Support Files
Dllref = ctypes.windll.LoadLibrary("I:/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Import scripts folder
scriptPath = 'I:/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SubtitleFilter/SubText/SubText.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DenoiseFilter/NEO_FFT3DFilter/neo-fft3d.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/EEDI3.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/vsznedi3.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/temporalsoften.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/scenechange.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/d2vSource/d2vsource.dll")
# Import scripts
import havsfunc
# source: 'G:\1993 - What`s Up.vob'
# current color space: YUV420P8, bit depth: 8, resolution: 720x480, fps: 29.97, color matrix: 470bg, yuv luminance scale: limited, scanorder: top field first
# Loading G:\1993 - What`s Up.vob using D2VSource
clip = core.d2v.Source(input="E:/Temp/vob_16bae54470829c3a13bc00ba381a4b9b_853323747.d2v")
# making sure input color matrix is set as 470bg
clip = core.resize.Bicubic(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 29.970
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# setting field order to what QTGMC should assume (top field first)
clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=2)
# Deinterlacing using QTGMC
clip = havsfunc.QTGMC(Input=clip, Preset="Fast", TFF=True) # new fps: 29.97
# make sure content is preceived as frame based
clip = core.std.SetFieldBased(clip, 0)
clip = clip[::2]

# denoising using Neo-FFT3D
clip = core.neo_fft3d.FFT3D(clip=clip, bw=16, bh=16)

# Loading image based subtitle G:\TestClips&Co\files\Subtitles\00010.track_4608.sup using Subtitle
subs = core.sub.ImageFile(clip=clip, file="G:/TestClips&Co/files/Subtitles/00010.track_4608.sup", blend=False)
alpha = core.std.PropToClip(subs)
subs = core.resize.Bicubic(subs, width=clip.width, height=clip.height, format=clip.format.id, matrix_s="470bg", range_s="limited")
gray_format = core.register_format(vs.GRAY, clip.format.sample_type, clip.format.bits_per_sample, 0, 0)
alpha = core.resize.Bicubic(alpha, width=clip.width, height=clip.height, format=gray_format.id, range_s="limited")
clip = core.std.MaskedMerge(clip, subs, alpha)

# adjusting output color from: RGB24 to YUV420P8 for x264Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="470bg", range_s="limited")


# set output frame rate to 29.970fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)

# Output
clip.set_output()
I get:
  1. Code:
    C:\Users\Selur\Desktop\test2.vpy:54: DeprecationWarning: register_format() is deprecated. Use "query_video_format" instead.
    gray_format = core.register_format(vs.GRAY, clip.format.sample_type, clip.format.bits_per_sample, 0, 0)
    which brings me to http://www.vapoursynth.com/doc/pytho...egister_format but sadly using 'query_video_format' in the search there doesn't get me any results.
    -> How to use query_video_format ? to replace the above line to get rid of the warning=
  2. Code:
    Error on frame 0 request:
    Resize error: Resize error 3074: no path between colorspaces (2/2/2 => 5/2/2). May need to specify additional colorspace parameters.
    This code did work before,..

Would be nice if someone cloud help solve these two problems.

Cu Selur
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is online now   Reply With Quote
Old 10th October 2021, 16:16   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,474
Okay, seems like the output of the MaskedMege isn't RGB24 like I suspected but the same as the clip, so I don't need the last conversion.
So the only question remaining is how can I use query_video_format to avoid the deprecated warning?
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is online now   Reply With Quote
Old 10th October 2021, 16:49   #3  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 358
https://github.com/vapoursynth/vapou...ynth.pyx#L2270

Code:
gray_format = core.query_video_format(vs.GRAY, clip.format.sample_type, clip.format.bits_per_sample, 0, 0)
__________________
Me on GitHub
PC Specs: Ryzen 5950X, 64 GB RAM, RTX 2070
DJATOM is offline   Reply With Quote
Old 10th October 2021, 18:09   #4  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,474
Thanks!
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:35.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.