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 2nd August 2021, 11:07   #1  |  Link
Troc
Registered User
 
Troc's Avatar
 
Join Date: Oct 2020
Location: Finland
Posts: 23
Filter requires RGBS?

I'm using Vapoursynth to try a denoiser. A friend who uses Hybrid says it works wonders, however I was looking to use it in conjunction to Virtualdub2.

The filter is this:
https://github.com/HolyWu/vs-dpir

My script:
from vapoursynth import core
from vsdpir import DPIR
#video = core.ffms2.Source(source=r"G:\_Anime\CH73 DVD\Disc1\Episode1.mkv")
from vsdpir import DPIR
ret = DPIR(core.ffms2.Source(source=r"G:\_Anime\CH73 DVD\Disc1\Episode1.mkv"), "task: str='denoise'", "device_type: str='cuda'")
video.set_output()


I get an error that goes like this:

"raise vs.Error('DPIR: Only RGBS format is supported')
vapoursynth.Error: DPIR: Only RGBS format is supported


What am I supposed to do? I tested converting the file into various types of RGB in Virtualdub2 but the same error happened every time. There's no results for this error in Google and no info on what RGBS video is - outside of some pictures of SCART converters that can't be what I'm looking for. How do I solve this? Do I just give up and learn how to use Hybrid?
Troc is offline   Reply With Quote
Old 2nd August 2021, 11:27   #2  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,471
You need to convert the video to the RGBS format first:
Code:
vs.core.resize.Bicubic(video, format=vs.RGBS)
and you'll probably need to convert it back at the end:
Code:
vs.core.resize.Bicubic(video, format=vs.YUV420P8, matrix_s="709")
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 2nd August 2021 at 12:15. Reason: Brainfarting
Myrsloik is offline   Reply With Quote
Old 2nd August 2021, 12:06   #3  |  Link
Troc
Registered User
 
Troc's Avatar
 
Join Date: Oct 2020
Location: Finland
Posts: 23
Quote:
vs.core.resize(video, format=vs.RGBS)
Alright, I edited the code to include this, so it looks like this now:


from vapoursynth import core
import vapoursynth as vs
from vsdpir import DPIR
video = core.ffms2.Source(source=r"G:\_Anime\CH73 DVD\Disc1\Episode1.mkv")
vs.core.resize("G:\_Anime\CH73 DVD\Disc1\Episode1.mkv", format=vs.RGBS)
ret = DPIR(core.ffms2.Source(source=r"G:\_Anime\CH73 DVD\Disc1\Episode1.mkv"), "task: str='denoise'", "device_type: str='cuda'")


I get the following error: TypeError: 'vapoursynth.Plugin' object is not callable

I added the "import vapoursynth as vs" since before I did that, it said "vs is not defined" and I figured it was short for vapoursynth. However this second error I don't understand. Was I supposed to put the core resize as a part of the DPIR source or the earlier source?
Troc is offline   Reply With Quote
Old 2nd August 2021, 12:16   #4  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,471
Brainfart. I updated my reply. See the documentation for resize here:
http://www.vapoursynth.com/doc/functions/resize.html
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 2nd August 2021, 12:59   #5  |  Link
Troc
Registered User
 
Troc's Avatar
 
Join Date: Oct 2020
Location: Finland
Posts: 23
Alrighty, I fixed the resize part and got a new error. Progress is good. New error:

Code:
File "src\cython\vapoursynth.pyx", line 2069, in vapoursynth.Function._call_
vapoursynth.Error: Index: Can't open 'VideoNode
Format: YUV420P8
Width: 720
Height: 480
Num Frames: 35845
FPS: 24000/1001
Flags: NoCache isCache'
The same error happened with my RGB conversions, only changing the Format. Am I close to a breakthrough here?
Troc is offline   Reply With Quote
Old 2nd August 2021, 15:00   #6  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,670
I have never seen that error before, but here's an example on how I use DPIR in a portable Vapoursynth:
Code:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll")
# source: 'G:\TestClips&Co\files\test.avi'
# current color space: YUV420P8, bit depth: 8, resolution: 640x352, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
# Loading source using FFMS2
clip = core.ffms2.Source(source="G:/TestClips&Co/files/test.avi",cachefile="E:/Temp/avi_6c441f37d9750b62d59f16ecdbd59393_853323747.ffindex",format=vs.YUV420P8,alpha=False)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
from vsdpir import DPIR
# adjusting color space from YUV420P8 to RGBS for VsDPIRDenoise
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_s="limited")
# denoising using DPIRDenoise
clip = DPIR(clip=clip, strength=5.000, device_index=0)
# adjusting output color from: RGBS to YUV420P10 for x265Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="470bg", range_s="limited")
# set output frame rate to 25.000fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output()
may be that helps.


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 offline   Reply With Quote
Reply

Tags
dpir, errors, rgbs, vapoursynth

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 05:00.


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