Log in

View Full Version : Vapoursynth


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 [99] 100

asarian
11th November 2024, 20:30
No, there's no way to silence them.

That's too bad. (R57 never had this) But I'll live. :) And thanks for the great VS tool!

Myrsloik
12th November 2024, 12:22
That's too bad. (R57 never had this) But I'll live. :) And thanks for the great VS tool!

If there's actual popular demand I could add a silent option. So reply to this if you care.

asarian
12th November 2024, 14:23
If there's actual popular demand I could add a silent option. So reply to this if you care.


For the record, I care. :)

Reason I'd love to see a silent option, is because many scripts keep importing the stuff everyone else imports too; so the VSPipe output almost always starts with a sheer endless barage of WARNINGS (none of which I can resolve myself, mind you, short of editing all side-packages individually).

Z2697
12th November 2024, 15:17
For the record, I care. :)

Reason I'd love to see a silent option, is because many scripts keep importing the stuff everyone else imports too; so the VSPipe output almost always starts with a sheer endless barage of WARNINGS (none of which I can resolve myself, mind you, short of editing all side-packages individually).

It should have nothing to do with the packages, it's for duplicated plugins. Unless the package ships with plugin included and calls std.LoadPlugin to load it in side the python code, which I haven't seen one like this.
The better thing to do is check and remove duplicates your auto load folder, or clear your script (from std.LoadPlugin) or auto load folder (completely rely on std.LoadPlugin)

amayra
13th November 2024, 17:18
is it not possible to have plug-in that run every platform and architecture ?

just like some mods in games

LigH
13th November 2024, 17:39
Only if they are written in an architecture-independent programming language. Like, in Python; but not in C/C++ which would create CPU dependent byte code. But that would be faster. CPU dependent binary plugins can be optimized for speed using SIMD instructions (like SSE or AVX on intel x86-64 architecture). Plugins in an interpreted script language will always be less performant.

Selur
16th November 2024, 11:16
@Myrsloik: Question regarding "https://www.vapoursynth.com/doc/installation.html#os-x"
Can there be only one 'UserPluginDir' or can I (how?) specify multiple dirs with plugins?
In case, there can only be one: "Feature request: Please support multiple user dirs. :)"

Cu Selur

Myrsloik
18th November 2024, 16:00
@Myrsloik: Question regarding "https://www.vapoursynth.com/doc/installation.html#os-x"
Can there be only one 'UserPluginDir' or can I (how?) specify multiple dirs with plugins?
In case, there can only be one: "Feature request: Please support multiple user dirs. :)"

Cu Selur

GOOD NEWS EVERYONE!

I've now beaten the frivolous spam allegations and can once again answer you questions.

Why do you need multiple dirs? Why isn't LoadAllPlugins good enough? If you have a sane workflow that needs it maybe I'll add it.

ChaosKing
18th November 2024, 16:35
I always wanted either a custom dir with loading priority or simply the ability to unload a plugin.

In case of FrameSeeker https://forum.doom9.org/showthread.php?t=176231, I could use it to test the source filter installed by the user or test an "external" source filter without Appdata dll copy/delete/rename hacks.

Myrsloik
18th November 2024, 16:46
I always wanted either a custom dir with loading priority or simply the ability to unload a plugin.

In case of FrameSeeker https://forum.doom9.org/showthread.php?t=176231, I could use it to test the source filter installed by the user or test an "external" source filter without Appdata dll copy/delete/rename hacks.

Unloading is quite unlikely to happen since it's very complex and generally not required/a good idea.
If you want to load multiple different copies you have the secret arguments forceid and forcens in LoadPlugin to override a plugin's unique id and namespace which will let you get around the unique requirement.
Maybe that's helpful. Please only use this for testing/development or I'll have to kill you all.

ChaosKing
18th November 2024, 17:06
Unloading is quite unlikely to happen since it's very complex and generally not required/a good idea.
If you want to load multiple different copies you have the secret arguments forceid and forcens in LoadPlugin to override a plugin's unique id and namespace which will let you get around the unique requirement.
Maybe that's helpful. Please only use this for testing/development or I'll have to kill you all.

Finally the secret knowledge is mine!

I use windows, I was killed by Bill long ago :devil:

asarian
18th November 2024, 23:20
It should have nothing to do with the packages, it's for duplicated plugins. Unless the package ships with plugin included and calls std.LoadPlugin to load it in side the python code, which I haven't seen one like this.
The better thing to do is check and remove duplicates your auto load folder, or clear your script (from std.LoadPlugin) or auto load folder (completely rely on std.LoadPlugin)

My bad. I had installed R70, after a thorough cleanup, as there were many stubs left of various Python and VapourSynth versions. Apparently there was still one of those 'stubs' left for a plugins dir in AppData somewhere.

'Care' withdrawn, as the issue is resolved now.

Selur
20th November 2024, 20:07
Why do you need multiple dirs? Why isn't LoadAllPlugins good enough? If you have a sane workflow that needs it maybe I'll add it.
Would be useful on to load for example the plugins installed by homebrew and https://github.com/yuygfgg/Macos_vapoursynth_plugins and maybe vsrepo on MacOS.
Not really much of a problem.
But you are right LoadAllPlugins (https://www.vapoursynth.com/doc/functions/general/loadallplugins.html) should work fine. I simply wasn't aware of it. :)

Thanks!

Cu Selur

Selur
7th January 2025, 18:21
Is there a Vapoursynth alternative to Avisynths "TFM(pp=1).TDeint(hints=true)' ?

Jamaika
7th January 2025, 18:52
Is there a Vapoursynth alternative to Avisynths "TFM(pp=1).TDeint(hints=true)' ?
https://github.com/HomeOfVapourSynthEvolution/VapourSynth-TDeintMod

Selur
9th January 2025, 20:52
@Jamaika: TDeintMod does not seem to support 'hints':
tdm.TDeintMod(clip clip, int order[, int field=-1, int mode=0, int length=10, int mtype=1, int ttype=1, int mtql=-1, int mthl=-1, int mtqc=-1, int mthc=-1, int nt=2, int minthresh=4, int maxthresh=75, int cstr=4, int athresh=-1, int metric=0, int expand=0, bint link=True, bint show=False, clip edeint=None, int opt=0, int[] planes]) source: https://github.com/HomeOfVapourSynthEvolution/VapourSynth-TDeintMod/blob/master/README.md
which is why I suspect it will not look at the hints from ' "TFM(pp=1)' :(

Cu Selur

Selur
9th January 2025, 20:54
Oh, just read:
IsCombed is a utility function to check whether or not a frame is combed and stores the result (0 or 1) as a frame property named _Combed. It's intended to be used within std.FrameEval to process only combed frames and leave non-combed frames untouched..
So some wrapper FrameEval might work,..

Jamaika
10th January 2025, 10:41
@Jamaika: TDeintMod does not seem to support 'hints':
tdm.TDeintMod(clip clip, int order[, int field=-1, int mode=0, int length=10, int mtype=1, int ttype=1, int mtql=-1, int mthl=-1, int mtqc=-1, int mthc=-1, int nt=2, int minthresh=4, int maxthresh=75, int cstr=4, int athresh=-1, int metric=0, int expand=0, bint link=True, bint show=False, clip edeint=None, int opt=0, int[] planes]) source: https://github.com/HomeOfVapourSynthEvolution/VapourSynth-TDeintMod/blob/master/README.md
which is why I suspect it will not look at the hints from ' "TFM(pp=1)' :(

Cu Selur
VIVTC is a set of filters that can be used for inverse telecine. It is a rewrite of some of tritical’s TIVTC filters.
https://amusementclub.github.io/doc/plugins/vivtc.html#vivtc.VFM
Creators apparently decided that these functions were unnecessary. :rolleyes:
Unlike TFM, VFM does not have any postprocessing capabilities.
Topic from 2015. https://forum.doom9.org/showthread.php?t=172185

Selur
12th January 2025, 06:04
Thanks.

Selur
1st February 2025, 21:19
@Myrsloik: Would be nice if core.text.Text would also support RGBH in the future, atm. it gives:
vapoursynth.Error: Text: Input clip must be 8..16 bit integer or 32 bit float, passed RGBH
so I have to convert to RGS and back ;)

Myrsloik
3rd February 2025, 09:04
@Myrsloik: Would be nice if core.text.Text would also support RGBH in the future, atm. it gives:
vapoursynth.Error: Text: Input clip must be 8..16 bit integer or 32 bit float, passed RGBH
so I have to convert to RGS and back ;)

It's on the todo list. The reason it hasn't happened yet is that only some compilers support half precision types natively (gcc/clang both have the _Float16 and __fp16 extensions at least) and visual studio doesn't.

Software fp16 support is pointless since then single precision would be faster for all processing anyway. At best it would become a performance trap. Internally x86 cpus need to convert everything to single precision anyway.

Myrsloik
12th February 2025, 09:05
Does anyone still use the Python 3.8 support? Are the windows 7 fanatics still around? It's now been quite a few years since my last check.

_Al_
14th February 2025, 01:59
I use 3.8 because of using old opencv before opencv introduced a bug, reading wrong pixel information for a pixel (it is3/4 quadrant of pixel off), and they do not care to fix it. So forced to use older numpy, older python etc.
But do not mind me. Just saying, you do not have to be win7 fanatic to use older version. :-)

Selur
29th March 2025, 07:51
Does anyone know how to do the same as Avisynth
overlay(o, t, mode="subtract", opacity=0.15)
in Vapoursynth?
The widely used Overlay function from havsfunc, does not work as the Avisynth function does.
see: https://forum.doom9.org/showthread.php?t=186264
Vapoursynth overlay uses expr = f'x y -' which seems the intuitive way, but that is not what Avisynth does.


Cu Selur

Ps.: is there an alternative port of Avisynths Overlay than the one in havsfunc, that I'm not aware of?

Myrsloik
15th April 2025, 14:41
https://github.com/AviSynth/AviSynthPlus/blob/master/avs_core/filters/overlay/OF_add.cpp#L83
With of_add=false
Start transcribing into expr

ChaosKing
15th April 2025, 17:03
I asked chagpt for fun and it "corrected" it to expr = 'x y - 0 max'

Should read as max(x - y, 0), but this is only a simple version of subtract.


Chatgpt: If your parser accepts this, you could use the following:

exprY = 'x y maskY * maskMode * y * (1 - maskMode) + -'
exprY = 'x (maskMode * y * maskY + (1 - maskMode) * y) -'
exprY = 'x (maskMode ? y * maskY : y) -'


For UV
exprU = 'xU (maskMode ? ((half * (1 - maskU) + maskU * yU)) : yU) - + half'
exprV = 'xV (maskMode ? ((half * (1 - maskV) + maskV * yV)) : yV) - + half'

Superdark-correction:
exprU = 'Yneg = max(0, -Y); mult = min(Yneg, over32); U = ((U * (over32 - mult)) + (half * mult)) >> shift'

ps I don't know what I'm doing :rolleyes:

GeoffreyA
16th April 2025, 12:24
VSPipe from R71 detected as malware in AVG. I reported it as a false positive.

Z2697
16th April 2025, 15:10
AVG is now owned by the "security giant" Gen Digital.
https://en.wikipedia.org/wiki/AVG_AntiVirus
https://en.wikipedia.org/wiki/Gen_Digital#Mergers_and_acquisitions

It's hard to imagine why they are taking such act. I mean look how many companies and softwares acquired! (and agreed to be acquired?)
Some stories say that those products are much worse after the merges or acquisitions.

It's almost like they are trying to dictate what's malware and what's not.

GeoffreyA
16th April 2025, 15:53
AVG is now owned by the "security giant" Gen Digital.
https://en.wikipedia.org/wiki/AVG_AntiVirus
https://en.wikipedia.org/wiki/Gen_Digital#Mergers_and_acquisitions

It's hard to imagine why they are taking such act. I mean look how many companies and softwares acquired! (and agreed to be acquired?)
Some stories say that those products are much worse after the merges or acquisitions.

It's almost like they are trying to dictate what's malware and what's not.

From Grisoft to Gen Digital! I find that AVG has always been a bit high on the false positives. When I compile FFmpeg occasionally, every second executable from the Media Autobuild Suite gets quarantined, likely owing to heuristics, so I've got to add the whole directory as an exception. With OCCT, the linpack executable gets blocked. Other than that, AVG Free has been all right for me. I've been using it since 2007.

Myrsloik
17th April 2025, 13:05
This time I have something slightly different for you to test. This version should be functionally identical to the R71 release but with one important difference: Python 3.12 and later support. As in 3.13 and 3.14 as well.

Try it out and see if it works. The portable install script will probably download the wrong file or fail in some other hilarious way so install the portable version manually.

https://github.com/vapoursynth/vapoursynth/releases/tag/R71-limited-api-test1

Z2697
17th April 2025, 14:53
This time I have something slightly different for you to test. This version should be functionally identical to the R71 release but with one important difference: Python 3.12 and later support. As in 3.13 and 3.14 as well.

Try it out and see if it works. The portable install script will probably download the wrong file or fail in some other hilarious way so install the portable version manually.

https://github.com/vapoursynth/vapoursynth/releases/tag/R71-limited-api-test1

It should also work for any version >= 3.8? (also combine the two separate wheels for 3.8 and newer?)

Myrsloik
17th April 2025, 15:29
It should also work for any version >= 3.8? (also combine the two separate wheels for 3.8 and newer?)

No. Anything older than 3.12 (technically 3.11 if compiled for it but then it's slower) doesn't have a complete enough python version independent api.

So 3.8 support remains as it is for the windows 7 fans. In the future I probably won't drop support for python versions until they're end of life. So 3.12 is good until 2029 unless something unexpected happens.

Z2697
17th April 2025, 17:18
No. Anything older than 3.12 (technically 3.11 if compiled for it but then it's slower) doesn't have a complete enough python version independent api.

So 3.8 support remains as it is for the windows 7 fans. In the future I probably won't drop support for python versions until they're end of life. So 3.12 is good until 2029 unless something unexpected happens.

Do you mean that 3.11 is generally slower for VapourSynth, or the version independent api of it is slower?

Myrsloik
17th April 2025, 17:37
Do you mean that 3.11 is generally slower for VapourSynth, or the version independent api of it is slower?

It's python 3.11. I also think most people already have migrated to 3.12.

Z2697
17th April 2025, 18:38
It's python 3.11. I also think most people already have migrated to 3.12.

Somehow I'm still on 3.11 and think building new VS releases for 3.11 is easier than upgrading Python LOL :o
Better find some time to finally do it.

Selur
17th April 2025, 19:37
In the future I probably won't drop support for python versions until they're end of life.
:goodpost: :thanks: That lessens the burden of trying to get pytorch&co working with Vapoursynth a lot. :)

Cu Selur

Selur
20th April 2025, 23:29
Using: https://github.com/Selur/VapoursynthScriptsInHybrid/blob/master/FillDuplicateFrames.py
with FillDuplicateFrames(clip=clip, method="MV", thresh=0.030000).out
that calls:
def interpolateWithMV(self, clip, n, start, end):
num = end - start
sup = core.mv.Super(clip, pel=2, hpad=0, vpad=0)
bvec = core.mv.Analyse(sup, blksize=16, isb=True, chroma=True, search=3, searchparam=1)
fvec = core.mv.Analyse(sup, blksize=16, isb=False, chroma=True, search=3, searchparam=1)
self.smooth = core.mv.FlowFPS(clip, sup, bvec, fvec, num=num, den=1, mask=2)
self.smooth_start = start
self.smooth_end = end
out = self.smooth[n-start]
if self.debug:
return out.text.Text(text="MV",alignment=9)
return out
gives me tons of :
Explicitly instantiated a Cache. This is no longer possible and the original clip has been passed through instead.
and I'm wondering why?
Where am I explicitly instantiating a cache? How can I fix this?

Cu Selur

Myrsloik
21st April 2025, 07:15
You probably have an old version of some plugin that does it internally. Or that's my guess.

Selur
21st April 2025, 07:57
Since I this does not happen with other interpolation methods, it must be mvtools.
I checked, I'm using https://github.com/dubhater/vapoursynth-mvtools/releases/tag/v24 which seems to be the latest version.
Strangely using:
sup = core.mv.Super(clip, pel=2, hpad=0, vpad=0)
bvec = core.mv.Analyse(sup, blksize=16, isb=True, chroma=True, search=3, searchparam=1)
fvec = core.mv.Analyse(sup, blksize=16, isb=False, chroma=True, search=3, searchparam=1)
clip = core.mv.FlowFPS(clip, sup, bvec, fvec, num=50, den=1, mask=2)
instead of:
fdf = FillDuplicateFrames(clip=clip, method="MV")
clip = fdf.out
the problem does not occur.
So it must be something else in FillDuplicateFrames. Strange.
=> Thanks for the feedback, I'll try to figure out what is causing this.

Cu Selur

Selur
21st April 2025, 08:23
Correction this is caused by mvtools!
I simplified the script to:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
import sys
import os
core = vs.core
# Import scripts folder
scriptPath = 'F:/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))

# loading plugins
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll")

clip = core.lsmas.LWLibavSource(source="G:/TestClips&Co/files/test.avi", format="YUV420P8", stream_index=0, cache=0, prefer_hw=0)

sup = core.mv.Super(clip, pel=2, hpad=0, vpad=0)
bvec = core.mv.Analyse(sup, blksize=16, isb=True, chroma=True, search=3, searchparam=1)
fvec = core.mv.Analyse(sup, blksize=16, isb=False, chroma=True, search=3, searchparam=1)
clip = core.mv.FlowFPS(clip, sup, bvec, fvec, num=50, den=1, mask=2)

# output
clip.set_output()
and calling:
VSPipe.exe c:\Users\Selur\Desktop\FillDuplicateFrames_MV_Cache.vpy NUL -c y4m
gave me:

Warning: Explicitly instantiated a Cache. This is no longer possible and the original clip has been passed through instead.
Warning: Explicitly instantiated a Cache. This is no longer possible and the original clip has been passed through instead.
Warning: Explicitly instantiated a Cache. This is no longer possible and the original clip has been passed through instead.
Warning: Explicitly instantiated a Cache. This is no longer possible and the original clip has been passed through instead.
Output 857 frames in 0.44 seconds (1926.36 fps)
=> will report to dubhater => https://github.com/dubhater/vapoursynth-mvtools/issues/87

Selur
23rd April 2025, 16:53
mvtools problem should be fixed in current git (https://github.com/dubhater/vapoursynth-mvtools/issues/87), sadly there wasn't a new release
=> could someone build and share a new Windows 64bit build?

Selur
24th April 2025, 13:47
Thanks to yuygfgg for the link.
=> Working libmvtools version: https://github.com/Mr-Z-2697/vapoursynth-mvtools/releases/tag/v24%2B8%2Bpatch-1

Myrsloik
21st May 2025, 12:26
R72-RC1 (https://github.com/vapoursynth/vapoursynth/releases/tag/R72-RC1)

Go test it. Has named pipe support in vspipe and supports ALL python versions starting with 3.12. The portable install script also works unlike the the previous test build.

Selur
21st May 2025, 14:08
Nice! Thanks, for the info. Initial tests did not show a problem here.

Myrsloik
27th May 2025, 07:49
R72-RC1 (https://github.com/vapoursynth/vapoursynth/releases/tag/R72-RC1)

Go test it. Has named pipe support in vspipe and supports ALL python versions starting with 3.12. The portable install script also works unlike the the previous test build.

I've added a clang build as well (same link). Speed comparisons welcome.

Myrsloik
2nd June 2025, 16:13
R72 (https://github.com/vapoursynth/vapoursynth/releases/tag/R72) is out. Blag post here (https://www.vapoursynth.com/2025/06/r72-named-pipes-and-python-3-12-support-on-windows/).

Myrsloik
5th June 2025, 17:37
Does anyone here still use a CPU without AVX2 instructions?

It's been standard in all CPUs for 15 years now

Adub
8th June 2025, 00:40
At least on my end - that's a negative ghost rider.

If anything, my oldest system is an AVX2 Zen 2 Threadripper. Then making extensive use of AVX512 on a Zen 5 9950X, and then ARM NEON on an M4 Mac.

It's for this reason that I made AVX2 the bare minimum support in Zsmooth (https://github.com/adworacz/zsmooth/commit/a3857a93386c37b32196366722a489ecf378eae8) and I have yet to receive any requests to make an older build.

Selur
8th June 2025, 06:40
Only, non-AVX2 system here is my Linux old NAS.
I know of a few Windows users of Hybrid that use non-AVX2 systems. (got reports when I started adding zsmooth support ;))
afaik starting with Windows 11 24H2 any supported cpu has AVX2, so the Windows 11 users are probably fine.
=> personally, I think it's reasonable to require AVX2 in future Vapoursynth versions, but folks with old Windows 7 and Windows 10 capture systems might complain. :)

Adub
9th June 2025, 04:36
Interesting to hear that there were some complaints - I honestly don't mind making a non-AVX2 build, if it's useful for some users. Zig makes it trivial. I just didn't receive any requests for one.