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

LigH
10th September 2017, 16:01
Attachments need to be approved here. Better use any pastebin if you can, or the CODE bbTag.

Selur
10th September 2017, 16:10
@mparade: Do you get an error when you open the script with inside the Vapoursynth editor, or through:
"C:\PROGRA~1\Hybrid\VAPOUR~1\vspipe.exe" --info "PATH to Script"
if you do you might want to share that info,...

mparade
10th September 2017, 16:35
@mparade: Do you get an error when you open the script with inside the Vapoursynth editor, or through:
"C:\PROGRA~1\Hybrid\VAPOUR~1\vspipe.exe" --info "PATH to Script"
if you do you might want to share that info,...

In VS editor there seems to be no error.
In Windows command line I got: "No output file specified"

sneaker_ger
10th September 2017, 16:37
You need to specify a hyphen ("-") for the vsipe command.

Selur
10th September 2017, 16:48
Oh, sorry, sneaker_ger is right I forgot to write it down. :)
"C:\PROGRA~1\Hybrid\VAPOUR~1\vspipe.exe" --info "PATH to Script" -

Cu Selur

mparade
10th September 2017, 17:03
Oh, sorry, sneaker_ger is right I forgot to write it down. :)
"C:\PROGRA~1\Hybrid\VAPOUR~1\vspipe.exe" --info "PATH to Script" -

Cu Selur

Then:

1. Message on command line: setVideoInfo: The VSFormat pointer passed by DGSource was not obtained from registerFormat() or getFormatPreset().

2. I get bug report from my Windows 10 64 bit OS:
Operation of VSPipe.exe has been terminated -- close program button inside the bug report window needs to click on

Selur
10th September 2017, 17:10
setVideoInfo: The VSFormat pointer passed by DGSource was not obtained from registerFormat() or getFormatPreset().
That either sounds like a bug in DGSource or a bug/limitation in Vapoursynth 'avs'-filter handling capabilities.

stax76
10th September 2017, 17:11
I've tried:

import vapoursynth as vs
core = vs.get_core()
core.avs.LoadPlugin(r"D:\Software\Medien\DGDecNV\DGDecodeNV.dll")
clip = core.avs.DGSource(r"D:\Video\Samples\4K\HEVC 10-bit_temp\HEVC 10-bit.dgi", fulldepth = True)
clip.set_output()

result:

Unhandled exception at 0x00007FFB268634BE (ucrtbase.dll) in Veedub64.exe: Fatal program exit requested.

mparade
12th September 2017, 20:02
The answer to this maybe as simple as whether Vapoursynth supports HDR from Avisynth source filters or not. Or maybe it can have problem with 16 bit and it needs to be converted to 10 bit first.

Selur
12th September 2017, 20:06
Problem is:
a. DG probably will not create a native Vapoursynth version of DGSource.
b. I would understand the Vapoursynth developers when they say that they won't support anything but 8bit from Avisynth filters.
-> I keep my fingers crossed. :)

Myrsloik
12th September 2017, 22:28
Problem is:
a. DG probably will not create a native Vapoursynth version of DGSource.
b. I would understand the Vapoursynth developers when they say that they won't support anything but 8bit from Avisynth filters.
-> I keep my fingers crossed. :)

I already support all the avs+ formats. This is something else. I also have no intention of paying (I mean compulsory donation hahahahaha) to debug this. Or buying an nvidia graphics card for that matter.

Let the butthurt commence!

Logan9778
13th September 2017, 07:40
Yeah, just love that "compulsory donation". :p However, in Nvidia's defense ( as much as they charge for a dang video card ), using the GPU did significantly speed up my AviSynth / X264 output.

lansing
13th September 2017, 16:15
How do I apply filter to a range of frames on a video? I have a list of range and a list of different setting of a filter, and have each setting applies to each range of frames.

ranges = [[0,100],[500,1000],[1500,10000]]
settings = [1,2,3]

clip = somefunc(setting=settings[0]) # applies to frame 0-100
clip = somefunc(setting=settings[1]) # applies to frame 500-1000


This looks like a task for the FrameEval but it doesn't allow me to set the range of frames as input.

Myrsloik
13th September 2017, 17:53
How do I apply filter to a range of frames on a video? I have a list of range and a list of different setting of a filter, and have each setting applies to each range of frames.

ranges = [[0,100],[500,1000],[1500,10000]]
settings = [1,2,3]

clip = somefunc(setting=settings[0]) # applies to frame 0-100
clip = somefunc(setting=settings[1]) # applies to frame 500-1000


This looks like a task for the FrameEval but it doesn't allow me to set the range of frames as input.

Trim and splice. Like avisynth.

splinter98
13th September 2017, 18:19
Trim and splice. Like avisynth.

Yep, but unlike avisynth you can sprinkle some python magic (untested):


def gen_clip(clip, ranges, settings):
i = 0
for rng, setting in ranges:
start, end = rng
if start > i:
yield clip[i:start], None
yield clip[start:end]), setting
i = end
if end < len(clip):
yield clip[end:]

clip = core.std.Splice([somefunc(c, setting=s) for c,s in gen_clip(clip, ranges, settings) if s is not None else c])

manono
13th September 2017, 20:33
Trim and splice. Like avisynth.
Except AviSynth has ReplaceFramesSimple (http://www.avisynth.nl/users/stickboy/RemapFrames.zip):

A=somefunc(settings)
ReplaceFramesSimple(Last,A,Mappings="[0 500]")

It is, admittedly, even more helpful when you have multiple instances of needing the same settings over a limited range of frames but I couldn't live without it and find the more traditional Trim/Splice method pretty clunky and completely unworkable when there are a lot of different filters with different settings to use over a limited range of frames. It won't work in Vapoursynth without changes being made?

http://www.avisynth.nl/users/stickboy/

Are_
13th September 2017, 23:42
And in vapoursynth you have https://github.com/Irrational-Encoding-Wizardry/Vapoursynth-RemapFrames and https://github.com/Irrational-Encoding-Wizardry/fvsfunc/blob/master/fvsfunc.py#L825 and only god know how many more python functions scattered around the internet.

TheFluff
14th September 2017, 00:32
Yes. You have the Python standard library at your fingertips and the VS clips are list-like objects. There is absolutely no need for plugins to muck around with frame orders or applying filters to parts of clips.

If I read the original request correctly you just want to use zip() (https://docs.python.org/3/library/functions.html#zip) to pair up frame ranges with their arguments. That's pretty much a oneliner, something like
ranges = [(0, 200), (300, 400)]
settings = [{'argument': 3}, {'argument': 4}]
clip = core.std.splice([core.foo.Bar(clip, **args)[start:end] for (start, end), args in zip(ranges, settings)])


Not tested, of course.

Python syntax abuse used:
- Double splat operator (**), or "argument dict unpacking": if you have a function in Python that takes two named arguments a and b, and a dict like {"a": 3, "b": 4}, calling func(**argsDict) will end up calling the function with the a parameter being 3 and the b parameter being 4. Very handy, that. Use single splat (*) for similarly translating a list to positional arguments. You can use both at the same time, as in func(*positional, **named).

- List comprehensions, as in [str(x) for x in [0, 1, 2]] - a handy way to write oneliners and you should use them at every opportunity to make sure nobody can read your code.

- Nested destructuring (or maybe it's more appropriately called "unpacking" in Python terminology?) assignment of iterator variables, as in:
[str(c) for (b, c), a in [((3, 5), 6)]]
# returns ['5']

lansing
14th September 2017, 00:55
Yes. You have the Python standard library at your fingertips and the VS clips are list-like objects. There is absolutely no need for plugins to muck around with frame orders or applying filters to parts of clips.

If I read the original request correctly you just want zip() (https://docs.python.org/3/library/functions.html#zip) to pair up frame ranges with their arguments. That's pretty much a oneliner, something like
ranges = [(0, 200), (300, 400)]
settings = [{'argument': 3}, {'argument': 4}]
clip = core.std.splice([core.foo.Bar(clip[start:end], **args) for (start, end), args in zip(ranges, settings)])


Not tested, of course.

Python syntax abuse used:
- Double splat operator (**), or "argument dict unpacking": if you have a function in Python that takes two named arguments a and b, and a dict like {"a": 3, "b": 4}, calling func(**argsDict) will end up calling the function with the a parameter being 3 and the b parameter being 4. Very handy, that. Use single splat (*) for similarly translating a list to positional arguments. You can use both at the same time, as in func(*positional, **named).

- List comprehensions, as in [str(x) for x in [0, 1, 2]] - a handy way to write oneliners and you should use them at every opportunity to make sure nobody can read your code.

- Nested destructuring (or maybe it's more appropriately called "unpacking" in Python terminology?) assignment of iterator variables, as in:
[str(c) for (b, c), a in [((3, 5), 6)]]
# returns ['5']


I did use zip() in a for loop similar, but then that will only append clips with frames that were specified in the ranges. In this example, I want to apply filter on frame 0-200 and 300-400, and have frame 201-299 and frames after 400 untouched.

Reading through the filter description, looks like ReplaceFrames is the function for this task.

lansing
14th September 2017, 15:30
Ok I got it working with ReplaceFramesSimple in the remapframes package

ranges = [[0,200],[300,400],[1000,10000]]
settings = [1,2,3]

for r, s in zip(ranges, settings):
temp = somefunc(clip, setting=s)
map_string = '[{} {}]'.format(r[0], r[1])
final_clip = core.remap.Rfs(clip, temp, mappings=map_string, mismatch=False)

Artofeel
19th September 2017, 13:04
AVFS is not working since pfmap-185 version
just closes right after start mounting (VapourSynth-R39-test4 \ VapourSynth-R38)
pfmap-184 is last working
I'm only one who used that feature?..

Myrsloik
19th September 2017, 13:08
AVFS is not working since pfmap-185 version
just closes right after start mounting (VapourSynth-R39-test4 \ VapourSynth-R38)
pfmap-184 is last working
I'm only one who used that feature?..

I'll give it a try then. Note that you don't even need it since a branded pismo library is also included in the installer.

Artofeel
19th September 2017, 15:08
Note that you don't even need it since a branded pismo library is also included in the installer.yeah, but I use pismo
like store thousands of images in one .pfo file
so I need new version of it due to some bugfixes

lansing
24th September 2017, 02:18
I'm trying to load a virtualdub filter through the avs loader, and I'm getting the error "Plugin C:/Program Files (x86)/VapourSynth/core64/plugins/AvsCompat.dll tried to register 'NeatVideo' more than once".


core.avs.LoadPlugin(r"VDubFilter.dll")
core.avs.LoadVirtualdubPlugin(r'NeatVideo.vdf', 'NeatVideo', 1)

clip = core.avs.NeatVideo(clip, ProfilePath, PresetPath, '1', '1', '1', '0')

Myrsloik
24th September 2017, 08:32
I'm trying to load a virtualdub filter through the avs loader, and I'm getting the error "Plugin C:/Program Files (x86)/VapourSynth/core64/plugins/AvsCompat.dll tried to register 'NeatVideo' more than once".


core.avs.LoadPlugin(r"VDubFilter.dll")
core.avs.LoadVirtualdubPlugin(r'NeatVideo.vdf', 'NeatVideo', 1)

clip = core.avs.NeatVideo(clip, ProfilePath, PresetPath, '1', '1', '1', '0')


Where can I find both of these dlls and their source code?

I suspect that it's registering several different overloads of the same function which isn't supported (and so unusual nobody really encountered it before).

lansing
24th September 2017, 13:23
The vdubfilter.dll came with the avs+ update zip,
https://github.com/pinterf/AviSynthPlus/releases

The virtualdub version of the neatvideo dll can be download from its demo version
https://www.neatvideo.com/download

Myrsloik
24th September 2017, 20:13
The vdubfilter.dll came with the avs+ update zip,
https://github.com/pinterf/AviSynthPlus/releases

The virtualdub version of the neatvideo dll can be download from its demo version
https://www.neatvideo.com/download

Should be fixed in the next version. Note that the different overloads of the NeatVideo function will be distinct ones since VS doesn't do overloads at all. So the different versions will be called NeatVideo, NeatVideo_2, NeatVideo_3 and so on. Now to look into a few more bugs before I release the next test version.

lansing
24th September 2017, 20:30
I'll report this issue to the neatvideo forum to see if it's a bug or not

Myrsloik
24th September 2017, 20:33
I'll report this issue to the neatvideo forum to see if it's a bug or not

It's not a bug.

lansing
24th September 2017, 20:39
It's not a bug.

Okay.

Myrsloik
26th September 2017, 21:12
yeah, but I use pismo
like store thousands of images in one .pfo file
so I need new version of it due to some bugfixes

Reproduced. I've contacted Joe Lowe about it so it should be fixed soon...

Myrsloik
26th September 2017, 21:23
R39-RC1 (https://www.dropbox.com/s/xv65xpsdflahjub/VapourSynth-R39-rc1.exe?dl=1)

Start testing!

r39:
updated to zimg v2.6
added offline documentation to the installer
renamed the croprel function to crop, croprel will still be kept as an alias for for compatibility with existing scripts
fixed missing max value clamping for 9-15 bit input with convolution
optimized prewitt and sobel
removed the min and max arguments from sobel and prewitt because they interact very oddly with float formats
avisynth compatibility can now handle functions with multiple overloads
added float support to boxblur
removed subtext file size limit
fixed missing fps correction in avisource that would produce an error with some files
switched to nasm as the assembler
visual studio runtime detection is improved in the installer, it should no longer attempt re-installs when a newer version is present
minor optimization in vspipe, you can now output blankclip into the void much faster
memory will now be 64 byte aligned on systems with avx512 support
added swapn and dupn operators to expr
reverted the argument handling in levels, arguments no longer take a 3 plane list due it making no sense when combined with the planes argument
optimized levels, the integer version is now implemented with a lut and the floating point version is faster when gamma=1.0
improved get_outputs() in python (stuxcrystal)
format objects can now be cast to int which will return the format id (stuxcrystal)
added method to make it easier to query formats from python (stuxcrystal)
made it possible to install the python part as a module (stuxcrystal)

lansing
26th September 2017, 23:18
Ran into another problem with the avs' virtualdub plugin loader that it doesn't takes in named arguments, while vapoursynth asks for named arguments.
Also got the error "VirtualdubFilterProxy: only RGB32 supported for VirtualDub filters" and there's no conversion to RGB32 in vs. And when I set "format=vs.RGB" then editor would crash.

clip = core.resize.Bicubic(clip, format=vs.RGB)
clip.set_output()

Myrsloik
26th September 2017, 23:19
Ran into another problem with the avs' virtualdub plugin loader that it doesn't takes in named arguments, while vapoursynth asks for named arguments.
Also got the error "VirtualdubFilterProxy: only RGB32 supported for VirtualDub filters" and there's no conversion to RGB32 in vs. And when I set "format=vs.RGB" then editor would crash.

clip = core.resize.Bicubic(clip, format=vs.RGB)
clip.set_output()


You can use unnamed arguments so I don't see the problem. The format you want is COMPATBGR32

lansing
26th September 2017, 23:41
I got the error "NeatVideo: Too many unnamed arguments specified". I'm using an older version of NeatVideo(3.5) which should be taking in 7 arguments including "clip".

core.avs.LoadPlugin(r"VDubFilter.dll")
core.avs.LoadVirtualdubPlugin(r'NeatVideo.vdf', 'NeatVideo', 1)
#...
clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.COMPATBGR32)

clip = core.avs.NeatVideo(clip, ProfilePath, PresetPath, '1', '1', '1', '0')

Myrsloik
26th September 2017, 23:44
I got the error "NeatVideo: Too many unnamed arguments specified". I'm using an older version of NeatVideo(3.5) which should be taking in 7 arguments including "clip".

core.avs.LoadPlugin(r"VDubFilter.dll")
core.avs.LoadVirtualdubPlugin(r'NeatVideo.vdf', 'NeatVideo', 1)
#...
clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.COMPATBGR32)

clip = core.avs.NeatVideo(clip, ProfilePath, PresetPath, '1', '1', '1', '0')


It's got multiple overloads like I mentioned. Try the NeatVideo_N() functions. List all the functions and signatures to see which version takes 7 arguments.

lansing
27th September 2017, 00:09
Okay I got the filter to work with NeatVideo_2(). And when I intentionally left out two, it gives me an error "NeatVideo_2: argument s6 is required", it doesn't tell me how many arguments I'm missing.

And there's a lot of warning about frame N not prefetched in the editor's log:
"Avisynth Compat: requested frame 47 not prefetched, using slow method"

Myrsloik
27th September 2017, 00:12
Okay I got the filter to work with NeatVideo_2(). And when I intentionally left out two, it gives me an error "NeatVideo_2: argument s6 is required", it doesn't tell me how many arguments I'm missing.

And there's a lot of warning about frame N not prefetched in the editor's log:
"Avisynth Compat: requested frame 47 not prefetched, using slow method"

That's normal since it doesn't know about these filters. At least it works. Two layers of compatibility wrappers will always be quirky...

lansing
27th September 2017, 02:59
um, after more testing, looks like the filter stop having effect after around 6 random seeks in the preview or a few seconds of playback.

Myrsloik
27th September 2017, 22:58
um, after more testing, looks like the filter stop having effect after around 6 random seeks in the preview or a few seconds of playback.

What's profilepath and presetpath? How do I make myself a working script with this so I can try it?

lansing
28th September 2017, 02:11
I uploaded a sample profile and preset for the Neatvideo4 demo version here, it takes 2 arguments instead of 7 in the older version
sample profiles (http://www.mediafire.com/file/j70mrl8bvs6eqne/nv4_profile_preset_sample.7z)

sample script:

ProfilePath = r'sample_noise_profile.dnp'
PresetPath = r'sample_preset.nfp'

core.avs.LoadPlugin(r"VDubFilter.dll")
core.avs.LoadVirtualdubPlugin(r'NeatVideo4.vdf', 'NeatVideo', 1)

clip = core.ffms2.Source('abc.mp4')

clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.COMPATBGR32)

clip = core.avs.NeatVideo_2(clip, ProfilePath, PresetPath)

Myrsloik
28th September 2017, 09:22
yeah, but I use pismo
like store thousands of images in one .pfo file
so I need new version of it due to some bugfixes

The bug has been located and the next pismo release should fix it.

Artofeel
28th September 2017, 17:49
The bug has been located and the next pismo release should fix it.
yes it's worked now
thanks to you and Joe

Myrsloik
29th September 2017, 22:34
I uploaded a sample profile and preset for the Neatvideo4 demo version here, it takes 2 arguments instead of 7 in the older version
sample profiles (http://www.mediafire.com/file/j70mrl8bvs6eqne/nv4_profile_preset_sample.7z)

sample script:

ProfilePath = r'sample_noise_profile.dnp'
PresetPath = r'sample_preset.nfp'

core.avs.LoadPlugin(r"VDubFilter.dll")
core.avs.LoadVirtualdubPlugin(r'NeatVideo4.vdf', 'NeatVideo', 1)

clip = core.ffms2.Source('abc.mp4')

clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.COMPATBGR32)

clip = core.avs.NeatVideo_2(clip, ProfilePath, PresetPath)


Odd, seems to work correctly here the whole time. The processing it does is a simple level/color adjustment, right?

Even with a load of seeking. The demo doesn't have some odd frame processing limit?

lansing
30th September 2017, 00:24
Odd, seems to work correctly here the whole time. The processing it does is a simple level/color adjustment, right?

Even with a load of seeking. The demo doesn't have some odd frame processing limit?

It's a denoising filter.

I tested again on both version, seems like the problem only occurs in my older v3.6, doesn't happen in the newer demo v4, while both works fine when loading from avs+.

And I couldn't find an older v3 demo version for you to test on...so I guess I'll just have to update my software.

Myrsloik
30th September 2017, 15:38
R39-RC3 (https://www.dropbox.com/s/jehsp83eml35jjk/VapourSynth-R39-RC3.exe?dl=1)

Should be final unless other issues are found. Test to see if all the issue you've reported actually are fixed. Will release it in a few days if no problems are found.

r39:
updated to zimg v2.6
updated pismo file mount runtime to build 188
added offline documentation to the installer
fixed clamping issues in levels filter
renamed the croprel function to crop, croprel will still be kept as an alias for for compatibility with existing scripts
fixed missing max value clamping for 9-15 bit input with convolution
optimized prewitt and sobel
removed the min and max arguments from sobel and prewitt because they interact very oddly with float formats
avisynth compatibility can now handle functions with multiple overloads
added float support to boxblur
removed subtext file size limit
fixed missing fps correction in avisource that would produce an error with some files
switched to nasm as the assembler
visual studio runtime detection is improved in the installer, it should no longer attempt re-installs when a newer version is present
minor optimization in vspipe, you can now output blankclip into the void much faster
memory will now be 64 byte aligned on systems with avx512 support
added swapn and dupn operators to expr
reverted the argument handling in levels, arguments no longer take a 3 plane list due it making no sense when combined with the planes argument
optimized levels, the integer version is now implemented with a lut and the floating point version is faster when gamma=1.0
improved get_outputs() in python (stuxcrystal)
format objects can now be cast to int which will return the format id (stuxcrystal)
added method to make it easier to query formats from python (stuxcrystal)
made it possible to install the python part as a module (stuxcrystal)

lansing
30th September 2017, 17:00
Loading RGB24 clip with avisource still has the upside down bug

LigH
30th September 2017, 17:34
There are top-down and bottom-up DIB's, IIRC...

Myrsloik
30th September 2017, 17:42
Loading RGB24 clip with avisource still has the upside down bug

Right, I'll take a look at that too. Can't remember if I tried to flip things correctly or not in avisource...

Myrsloik
30th September 2017, 18:16
Loading RGB24 clip with avisource still has the upside down bug

I need a sample to debug this. It should be doing the right thing already.