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 15th January 2022, 06:30   #4621  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,371
Quote:
Originally Posted by lewyturn View Post
How to use "std.SplitPlanes(vnode clip)'", I can't find an example, can anyone give me an example?
e.g for YUV clip, . Y plane would be [0], U plane would be [1], V would be [2] ; similar for RGB (0,1,2)

s = core.std.SplitPlanes(clip)
s[0].set_output() #output Y plane
poisondeathray is offline   Reply With Quote
Old 15th January 2022, 19:42   #4622  |  Link
Jukus
Registered User
 
Join Date: Jul 2019
Location: Russia
Posts: 87
I'm trying to get QTGMC to work on Debian, I installed everything need from http://deb-multimedia.org/dists/stab.../binary-amd64/ and separately the scripts, I get this error:
Code:
Failed to evaluate the script:
Python exception: znedi3: error reading weights

Traceback (most recent call last):
File "vapoursynth.pyx", line 2242, in vapoursynth.vpy_evaluateScript
File "vapoursynth.pyx", line 2243, in vapoursynth.vpy_evaluateScript
File "/usr/local/lib/python3.9/dist-packages/havsfunc.py", line 1314, in QTGMC
edi1 = QTGMC_Interpolate(ediInput, InputType, EdiMode, NNSize, NNeurons, EdiQual, EdiMaxD, pscrn, int16_prescreener, int16_predictor, exp, alpha, beta, gamma, nrad, vcheck,
File "/usr/local/lib/python3.9/dist-packages/havsfunc.py", line 1595, in QTGMC_Interpolate
interp = nnedi3(Input, field=field, planes=planes)
File "vapoursynth.pyx", line 2067, in vapoursynth.Function.__call__
vapoursynth.Error: znedi3: error reading weights
What to do?

Last edited by Jukus; 15th January 2022 at 19:51.
Jukus is offline   Reply With Quote
Old 15th January 2022, 19:54   #4623  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,371
Quote:
Originally Posted by Jukus View Post
I'm trying to get QTGMC to work on Debian, I installed everything need from http://deb-multimedia.org/dists/stab.../binary-amd64/ and separately the scripts, I get this error:
[CODE]Failed to evaluate the script:
Python exception: znedi3: error reading weights
does the package include nnedi3_weights.bin ?

https://github.com/dubhater/vapoursy...i3_weights.bin
poisondeathray is offline   Reply With Quote
Old 15th January 2022, 20:02   #4624  |  Link
Jukus
Registered User
 
Join Date: Jul 2019
Location: Russia
Posts: 87
Quote:
Originally Posted by poisondeathray View Post
does the package include nnedi3_weights.bin ?

https://github.com/dubhater/vapoursy...i3_weights.bin
Yes
Code:
/usr/share/nnedi3/nnedi3_weights.bin
Jukus is offline   Reply With Quote
Old 16th January 2022, 17:59   #4625  |  Link
Jukus
Registered User
 
Join Date: Jul 2019
Location: Russia
Posts: 87
Need to move nnedi3_weights.bin to
Code:
/usr/lib/x86_64-linux-gnu/vapoursynth/
Anyway, something is very bad, before that I used everything new on Arch from AUR and the performance was 2 times better

Last edited by Jukus; 16th January 2022 at 18:23.
Jukus is offline   Reply With Quote
Old 16th January 2022, 20:47   #4626  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 365
Could someone help explain how trim and slice works in vapoursynth?

I am struggling converting a simple avisynth script where I replace a segment of a clip with some frames from a different clip and are unable to get it to work in vapoursynth.

Code:
video_a = core.dgdecodenv.DGSource(f"E:\video_a.dgi")
video_b = core.dgdecodenv.DGSource(f"E:\video_b.dgi")
video_b = video_b[12:2156] # 2156 - 12 = 2144 frames

#Neither of the following works at all in vapoursynth, I can't figure out how to reference "end of clip/last frame" in vapoursynth trim...
video = core.std.Trim(video_a,0,5298) + video_b + core.std.Trim(video_a,7444,-1)
video = core.std.Trim(video_a,0,5298) + video_b + core.std.Trim(video_a,7444,0)

#The following returns a video, but returns fewer frames than expected (7443 - 5299 = 2144 frames):
video = video_a[0:5298] + video_b + video_a[7444:-1]
Original clip has 34311 frames, but using vapoursynth slice the returned clip only has 34308.
So in python/vapoursynth either 1+1 does not equal 2 or I have forgotten how to do simple math...
__________________
(i have a tendency to drunk post)

Last edited by mastrboy; 16th January 2022 at 21:07.
mastrboy is offline   Reply With Quote
Old 16th January 2022, 20:50   #4627  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
http://www.vapoursynth.com/doc/pytho...yntactic-sugar

clip = clip[5:11] <=> clip = core.std.Trim(clip, first=5, last=10)
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 16th January 2022, 21:16   #4628  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 365
Quote:
Originally Posted by ChaosKing View Post
http://www.vapoursynth.com/doc/pytho...yntactic-sugar

clip = clip[5:11] <=> clip = core.std.Trim(clip, first=5, last=10)
Wait... You are telling me that the code for slice subtracts 1 for the second argument? What exactly is the purpose for that?

I would then absolutely prefer to just use Trim rather than remembering that -1 stuff, but does anyone know how to reference the last frame in Trim like slice does with "-1" or avisynth does with trim(10,0)?
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Old 16th January 2022, 21:22   #4629  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
(untested) I think it's just std.Trim(10)
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 16th January 2022, 21:54   #4630  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 365
Quote:
Originally Posted by ChaosKing View Post
(untested) I think it's just std.Trim(10)
Thanks, that worked, and I feel like an idiot for not testing it without the second argument

It's a lot better than the "solution" I found in my own: core.std.Trim(video,10,video.num_frames - 1)
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Old 16th January 2022, 22:11   #4631  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 673
Hi, folks.

Could somebody help me with vapoursynth?

It's been a while since I left the world of publishing but recently I took up a project that I would like to have ready for when my son is born. The fact is that I wanted to install vapoursynth and what used to work for me now doesn't.

I have checked the script and VSEdit says it is correct. The video is fine because I had to install AVS+ and it loads without any problems.

My system is: Windows 11 x64
Python installed: 3.9.9 and 3.10.1 (use VSC)
Vapoursynth: R57
Code:
Code:
from vapoursynth import core
import vapoursynth as vs
core = vs.core

#video = core.ffms2.Source(source=r"C:\xxx\Movie.mkv") #,format=vs.YUV420P8)
video = core.lsmas.LWLibavSource(r"C:\xxx\Movie.mkv", format=vs.YUV420P8)

video.set_output()
Problem:
Quote:
Error forming pixmap from frame. Expected format CompatBGR32. Instead got 'YUV420P8'.
I have also tried VSEdit2 and when previewing the program it closes.



Thanks in advance.
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite

Last edited by Overdrive80; 16th January 2022 at 22:14.
Overdrive80 is offline   Reply With Quote
Old 16th January 2022, 22:27   #4632  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,371
Overdrive80 - are you using vsedit mod for API4 and r57 ?

https://github.com/YomikoR/VapourSynth-Editor/releases
poisondeathray is offline   Reply With Quote
Old 17th January 2022, 01:49   #4633  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 673
@Poison

Nop, for VSEditor was using https://bitbucket.org/mystery_keeper...tor/downloads/ and for V2 https://bitbucket.org/gundamftw/vapo...r-2/downloads/

Then, do you think that could be for VSeditor??

EDIT: I have tried the version that you post and is the same result, close of application.
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite

Last edited by Overdrive80; 17th January 2022 at 01:51.
Overdrive80 is offline   Reply With Quote
Old 17th January 2022, 05:53   #4634  |  Link
_Al_
Registered User
 
Join Date: May 2011
Posts: 321
Quote:
Originally Posted by mastrboy View Post
Wait... You are telling me that the code for slice subtracts 1 for the second argument? What exactly is the purpose for that?
As soon ,as there is a programming involved, it just works. Indexing is always from zero. So for example you need to slice an interval and you know it starts on 10th frame including and length is 5 frames, so it is:
frame=10
length = 5
clip[frame:frame+length]
If both frames were included you'd need to use clip[frame:frame+length-1]. Imagine more intervals, easily turning it into nightmare as well.

Slicing is still better, as long as you remember this rule, because, you do not need to specify position if slicing from beggining:
clip[:100] #slicing first 100 frames (you see again, you want just first 100 frames, you do this and not confusing: clip[:100-1]

or more importandly, better if slicing from a middle to the end:
clip[10:] # using 10th frame index to the end
so
clip = clip.std.Trim(first=10, last=clip.num_frames-1)
is the same as:
clip = clip[10:]

If using keyword arguments always and not just:
clip = clip.std.Trim(10, clip.num_frames-1)
is better way, because above line is not readable much. Avisynth users do that all the time, using lines like: filter(3,56, -1, 45, 1000, 0) is just a nightmare to read. :-)
Prone to make mistakes.

Last edited by _Al_; 17th January 2022 at 05:55.
_Al_ is offline   Reply With Quote
Old 17th January 2022, 13:15   #4635  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 673
@poisondeathray

If I trying open script with vdub2 I get this message: "AVI import filter error: (Unknown) (80040154)"



EDIT: Solved. I had uninstall all and I had followed the instructions of https://www.l33tmeatwad.com/vapoursy...software-setup, with sames versions of files (python and vapoursynth). I could investigate what caused the problem, whether VS or Python
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite

Last edited by Overdrive80; 17th January 2022 at 16:15.
Overdrive80 is offline   Reply With Quote
Old 27th January 2022, 06:09   #4636  |  Link
~ VEGETA ~
The cult of personality
 
~ VEGETA ~'s Avatar
 
Join Date: May 2013
Location: Planet Vegeta
Posts: 155
when I try running a simple scrip which has hafsfunc in it (and other wrappers) it gives me that there is no module named packaging. I installed python 3.9.7 for all users as well as vapoursynth 57.

plus, vs editor 2 stops working right after i press preview... while vs edit 1 works, but it doesn't show the output..
~ VEGETA ~ is offline   Reply With Quote
Old 28th January 2022, 14:24   #4637  |  Link
Julek
Registered User
 
Julek's Avatar
 
Join Date: Dec 2020
Posts: 87
Quote:
Originally Posted by ~ VEGETA ~ View Post
when I try running a simple scrip which has hafsfunc in it (and other wrappers) it gives me that there is no module named packaging. I installed python 3.9.7 for all users as well as vapoursynth 57.

plus, vs editor 2 stops working right after i press preview... while vs edit 1 works, but it doesn't show the output..
You need LibP2P library for vsedit 2.
Julek is offline   Reply With Quote
Old 28th January 2022, 17:54   #4638  |  Link
Jukus
Registered User
 
Join Date: Jul 2019
Location: Russia
Posts: 87
Quote:
Originally Posted by Jukus View Post
Need to move nnedi3_weights.bin to
Code:
/usr/lib/x86_64-linux-gnu/vapoursynth/
Anyway, something is very bad, before that I used everything new on Arch from AUR and the performance was 2 times better
I built everything new from git, updated proprietary Nvidia drivers from backports and still performance is almost 2 times less on Debian than it was on Arch, it looks magical.
Jukus is offline   Reply With Quote
Old 28th January 2022, 21:45   #4639  |  Link
~ VEGETA ~
The cult of personality
 
~ VEGETA ~'s Avatar
 
Join Date: May 2013
Location: Planet Vegeta
Posts: 155
Quote:
Originally Posted by Julek View Post
You need LibP2P library for vsedit 2.
it is installed, everything should be fine but still doesn't work.

I read that it doesn't work after vapoursynth 54.

can you verify?
~ VEGETA ~ is offline   Reply With Quote
Old 29th January 2022, 16:29   #4640  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 377
Try to load explicitly via core.std.LoadPlugin. That way you will see an error if plugin fails to load.
__________________
Me on GitHub
PC Specs: Ryzen 5950X, 64 GB RAM, RTX 2070
DJATOM is offline   Reply With Quote
Reply

Tags
speed, vaporware, 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 17:27.


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