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 6th December 2017, 06:26   #2901  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 986
Quote:
Originally Posted by tyee View Post
Just starting to learn VS, but can't find links to any 64 bit plugins to test a script. Trying to find RemoveGrain.dll and Repair.dll to test finesharp script. Anyone got links?

update - ok, I read they are not needed anymore but I would like to know where the 64 bit plugins reside?
http://www.vapoursynth.com/doc/pluginlist.html
lansing is online now   Reply With Quote
Old 6th December 2017, 07:10   #2902  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 986
Updating on my issue with loading multiple instances of a virtualdub filters. I did more testings on a few more vd filters, the problem should be coming from either avisynth or virtualdub. (I highly believe that it's avisynth)
Loading multiple instance of any vd filter in an avs script will result in an "out-of-bound memory access" crash on program close, which is the same behavior I had in vapoursynth earlier.

This will crash in avisynth:
Code:
LoadVirtualDubPlugin("Autolevels.vdf", "Autolevels", 0)

src = AVISource("sample.avi").ConvertToRGB32()
a = src.Autolevels(40, 46, 50, 0, 0, 0, 0, 0)
b = src.Autolevels(40, 80, 50, 0, 0, 0, 0, 0)

a+b
This will work:
Code:
LoadVirtualDubPlugin("Autolevels.vdf", "Autolevels", 0)
LoadVirtualDubPlugin("Autolevels_copy.vdf", "Autolevels_copy", 0)

src = AVISource("sample.avi").ConvertToRGB32()
a = src.Autolevels(40, 46, 50, 0, 0, 0, 0, 0)
b = src.Autolevels_copy(40, 80, 50, 0, 0, 0, 0, 0)

a+b
lansing is online now   Reply With Quote
Old 6th December 2017, 08:54   #2903  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 989
Quote:
Originally Posted by lansing View Post
Updating on my issue with loading multiple instances of a virtualdub filters. I did more testings on a few more vd filters, the problem should be coming from either avisynth or virtualdub. (I highly believe that it's avisynth)
Loading multiple instance of any vd filter in an avs script will result in an "out-of-bound memory access" crash on program close, which is the same behavior I had in vapoursynth earlier.
Yes, already reported, something like a double free at exit, don't spend any more time investigating on the vs side.

Last edited by pinterf; 6th December 2017 at 08:55. Reason: Quote too long
pinterf is offline   Reply With Quote
Old 6th December 2017, 19:01   #2904  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 986
Quote:
Originally Posted by pinterf View Post
Yes, already reported, something like a double free at exit, don't spend any more time investigating on the vs side.
Ok hope this get fix soon, getting it to work fills in the last missing piece of my project.
lansing is online now   Reply With Quote
Old 9th December 2017, 04:46   #2905  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 986
Is there a function that can replace a range of frames with another range of frame of the same clip?

I want to replace frame 200-250 with frame 0-150. It's not remapping, the length of the resulting clip should be different to the original. I looked into remapframes but it doesn't have it.
lansing is online now   Reply With Quote
Old 9th December 2017, 07:28   #2906  |  Link
AzraelNewtype
Registered User
 
AzraelNewtype's Avatar
 
Join Date: Oct 2007
Posts: 127
Sure.

http://www.vapoursynth.com/doc/functions/trim.html

http://www.vapoursynth.com/doc/functions/splice.html
AzraelNewtype is offline   Reply With Quote
Old 9th December 2017, 08:20   #2907  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 986
I know that we can write it using those native functions. I'm just asking to see if we have something written already.

I have another question about slicing, is there a short form to get a clip of N frame to the end of the clip? "clip[50, -1]" only gets frame 50 to the second to the last frame, is there a flag that represent the last frame of the clip?
lansing is online now   Reply With Quote
Old 9th December 2017, 09:51   #2908  |  Link
AzraelNewtype
Registered User
 
AzraelNewtype's Avatar
 
Join Date: Oct 2007
Posts: 127
clip[50:]

Of course [:-1] is only giving the second to last. That's what negative slice indexes do.

As for wrapping three trims and a splice to do arbitrary replacement of unrelated clips, that kind of really small helper function isn't the sort of thing people share libraries of. A naive implementation is probably about five lines. It's barely even syntactic sugar if you have to define the trim points of the input and replacement separately.
AzraelNewtype is offline   Reply With Quote
Old 11th December 2017, 17:22   #2909  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 986
Reporting a memory leak on ModifyFrame as I found it here earlier.

Memory will not flush after I closed preview in vs editor. Using the sample script from the document will cause the leak:
Code:
def set_frame_number(n, f):
   fout = f.copy()
   fout.props['FrameNumber'] = n
   return fout

clip = core.std.ModifyFrame(clip=clip, clips=clip, selector=set_frame_number)
lansing is online now   Reply With Quote
Old 12th December 2017, 13:22   #2910  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,858
Quote:
Originally Posted by lansing View Post
Reporting a memory leak on ModifyFrame as I found it here earlier.

Memory will not flush after I closed preview in vs editor. Using the sample script from the document will cause the leak:
Code:
def set_frame_number(n, f):
   fout = f.copy()
   fout.props['FrameNumber'] = n
   return fout

clip = core.std.ModifyFrame(clip=clip, clips=clip, selector=set_frame_number)
I've found 3 memory leaks so far in various places. Expect the next version to improve on things a lot. Note that all leaks more or less only happened when objects were destroyed so it'd never be discovered when using vspipe or simply encoding things.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 12th December 2017, 16:43   #2911  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,858
R41-test1

Some of the fixes required fairly big changes in the cython code so test as many scripts as possible. This binary should be considered alpha quality.

Code:
r41:
updated to zimg v2.7
removed dependency on the now deprecated codecvt header
fixed memory leak where modifyframe wouldn't release the function reference when done
fixed a rare memory leak that could happen if the core was freed before the last frame 
fixed a memory leak that would happen if a python videoframe object was instantiated
improved imwri's input and output format guessing, now integer and float image formats will most likely be returned in native precision
imwri now requires hdri support since it's now enabled by default
stackvertical now properly rejects compat formats instead of producing unexpected output
the default initial cache size now also depends on the number of threads used
fixed negative frame request error listing the parent node name instead of the correct name
fixed expr clamping of 9-15 bit output, previously it would clamp to 16bit
fixed corrupted output in expr when mixing int and float for input and output (pinterf)
Imwri builds will be provided separately at a later time when more testing has been done.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 12th December 2017 at 17:12.
Myrsloik is offline   Reply With Quote
Old 12th December 2017, 22:21   #2912  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 986
Thank you, the leak is now gone, memory usage drops back to 30MB after preview close.

Quote:
Originally Posted by Myrsloik View Post
Quote:
Originally Posted by lansing
Can I output image file name with imwrif base on frame number in the frame property?
If you call imwri insode frameeval ypu should be able to do it.
I can't get it working, I tried various formatings but all failed.

Code:
from functools import partial

img_dir = r"F:\temp_img_w\{}.png"

def set_frame_number(n, f):
	fout = f.copy()
	fout.props.FrameNumber = n
	return fout

clip = core.std.ModifyFrame(clip=clip, clips=clip, selector=set_frame_number)

def writeimgfn(n, f, clip, path):
	num = f.props.FrameNumber
	rgb_clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.RGB24)
	return core.imwrif.Write(rgb_clip, imgformat="PNG", filename=path.format(n))

clip = core.std.FrameEval(clip, partial(writeimgfn, clip=clip, path=img_dir), prop_src=clip)

clip.set_output()
It returns error "Write: Filename string doesn't contain a number".

Last edited by lansing; 12th December 2017 at 22:24.
lansing is online now   Reply With Quote
Old 12th December 2017, 22:40   #2913  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,858
Quote:
Originally Posted by lansing View Post
Thank you, the leak is now gone, memory usage drops back to 30MB after preview close.



I can't get it working, I tried various formatings but all failed.

Code:
from functools import partial

img_dir = r"F:\temp_img_w\{}.png"

def set_frame_number(n, f):
	fout = f.copy()
	fout.props.FrameNumber = n
	return fout

clip = core.std.ModifyFrame(clip=clip, clips=clip, selector=set_frame_number)

def writeimgfn(n, f, clip, path):
	num = f.props.FrameNumber
	rgb_clip = core.resize.Bicubic(clip, matrix_in_s="709", format=vs.RGB24)
	return core.imwrif.Write(rgb_clip, imgformat="PNG", filename=path.format(n))

clip = core.std.FrameEval(clip, partial(writeimgfn, clip=clip, path=img_dir), prop_src=clip)

clip.set_output()
It returns error "Write: Filename string doesn't contain a number".
Unless you have a more complex use case than this example you should simply be using vspipe and ffmpeg to write images. How does your script fail anyway?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 12th December 2017, 23:13   #2914  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 986
Quote:
Originally Posted by Myrsloik View Post
Unless you have a more complex use case than this example you should simply be using vspipe and ffmpeg to write images. How does your script fail anyway?
I'm working on a project to color match dragon ball z, for better color matching accuracy, I need to build a big montage for every scene and stored them as a clip, like 1 frame = 1 montage, each frame resolution varies. After that I need to output all the images to be use for the color matching program.

By tagging and saving a frame number onto each output image instead of the sequence counter will help to back track if something went wrong. For example, if one of the images gives poor matching result, I would know exactly where to look for that scene.
lansing is online now   Reply With Quote
Old 14th December 2017, 00:44   #2915  |  Link
gonca
Registered User
 
Join Date: Jul 2012
Location: Scarborough, Canada
Posts: 798
Using Vapoursynth to try to process a UHD video
script is
Quote:
import vapoursynth as vs
core = vs.get_core()
core.avs.LoadPlugin(r'C:\Program Files (Portable)\dgdecnv\x64 Binaries\DGDecodeNV.dll')
clip = core.avs.DGSource(r'D:\#TEMP\xxxx.dgi', fieldop=0, fulldepth=True)
clip.set_output()
error report
Code:
Error Video encoding using NVEnc 3.23 (1.7.0.4)

Video encoding using NVEnc 3.23 failed with exit code: -1073741819 (0xC0000005)

The exit code might be a system error code: The instruction at 0xp referenced memory at 0xp. The memory could not be s.


------------------- Video encoding using NVEnc 3.23 -------------------

"C:\Program Files (Portable)\StaxRip\Apps\NVEnc\NVEncC64.exe" --vbrhq 38400 --codec h265 --preset quality --level 5.1 --output-depth 10 --weightp --ref 5 --gop-len 24 --lookahead 32 --qp-init 1 --max-bitrate 38400 --vbr-quality 25 --aq --cuda-schedule auto --colormatrix bt2020nc --colorprim bt2020 --transfer smpte2084 --mv-precision q-pel --cabac -i "W:\TEMP\KONG SKULL ISLAND_temp\KONG SKULL ISLAND.vpy" -o "W:\TEMP\KONG SKULL ISLAND_temp\KONG SKULL ISLAND_out.h265"




StaxRip.ErrorAbortException: Video encoding using NVEnc 3.23 failed with exit code: -1073741819 (0xC0000005)

The exit code might be a system error code: The instruction at 0xp referenced memory at 0xp. The memory could not be s.


------------------- Video encoding using NVEnc 3.23 -------------------

"C:\Program Files (Portable)\StaxRip\Apps\NVEnc\NVEncC64.exe" --vbrhq 38400 --codec h265 --preset quality --level 5.1 --output-depth 10 --weightp --ref 5 --gop-len 24 --lookahead 32 --qp-init 1 --max-bitrate 38400 --vbr-quality 25 --aq --cuda-schedule auto --colormatrix bt2020nc --colorprim bt2020 --transfer smpte2084 --mv-precision q-pel --cabac -i "W:\TEMP\KONG SKULL ISLAND_temp\KONG SKULL ISLAND.vpy" -o "W:\TEMP\KONG SKULL ISLAND_temp\KONG SKULL ISLAND_out.h265"



   at StaxRip.Proc.Start() in D:\Projekte\VS\VB\StaxRip\General\Proc.vb:line 338
   at StaxRip.NVEnc.Encode() in D:\Projekte\VS\VB\StaxRip\Encoding\NVEnc.vb:line 82
   at StaxRip.GlobalClass.ProcessVideo() in D:\Projekte\VS\VB\StaxRip\General\GlobalClass.vb:line 225
   at System.Threading.Tasks.Parallel.<>c__DisplayClass4_0.<Invoke>b__0()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at StaxRip.GlobalClass.ProcessJob(String jobPath) in D:\Projekte\VS\VB\StaxRip\General\GlobalClass.vb:line 137
If I run
Quote:
"C:\Program Files (Portable)\StaxRip\Apps\NVEnc\NVEncC64.exe" --vbrhq 38400 --codec h265 --preset quality --level 5.1 --output-depth 10 --weightp --ref 5 --gop-len 24 --lookahead 32 --qp-init 1 --max-bitrate 38400 --vbr-quality 25 --aq --cuda-schedule auto --colormatrix bt2020nc --colorprim bt2020 --transfer smpte2084 --mv-precision q-pel --cabac -i "W:\TEMP\KONG SKULL ISLAND_temp\KONG SKULL ISLAND.vpy" -o "W:\TEMP\KONG SKULL ISLAND_temp\KONG SKULL ISLAND_out.h265"
Through the command line The error is Vapoursynth failed to open input file

Any ideas?
gonca is offline   Reply With Quote
Old 14th December 2017, 14:28   #2916  |  Link
kriNon
Registered User
 
Join Date: Jul 2016
Posts: 37
I'm trying to use vapoursynth's avs.LoadPlugin(string path) to load some avisynth filters, however whenever I try to load almost any filter I will get the error:

Code:
Failed to evaluate the script:
Python exception: Avisynth Loader: failed to load module

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1830, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:36860)
File "", line 4, in 
File "src\cython\vapoursynth.pyx", line 1722, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:35000)
vapoursynth.Error: Avisynth Loader: failed to load module
Any idea what could be causing this? I'm running Vapoursynth r40 and Avisynth 2.6 x86.

Thanks!
kriNon is offline   Reply With Quote
Old 14th December 2017, 14:31   #2917  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,858
Quote:
Originally Posted by kriNon View Post
I'm trying to use vapoursynth's avs.LoadPlugin(string path) to load some avisynth filters, however whenever I try to load almost any filter I will get the error:

Code:
Failed to evaluate the script:
Python exception: Avisynth Loader: failed to load module

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1830, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:36860)
File "", line 4, in 
File "src\cython\vapoursynth.pyx", line 1722, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:35000)
vapoursynth.Error: Avisynth Loader: failed to load module
Any idea what could be causing this? I'm running Vapoursynth r40 and Avisynth 2.6 x86.

Thanks!
Did you escape the path properly?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 14th December 2017, 14:35   #2918  |  Link
kriNon
Registered User
 
Join Date: Jul 2016
Posts: 37
Ah sorry, forgot to post my script:
Code:
import vapoursynth as vs
core = vs.get_core()

core.avs.LoadPlugin(r"C:\Program Files (x86)\AviSynth\plugins\deen.dll")
Yeah, I did
kriNon is offline   Reply With Quote
Old 14th December 2017, 14:36   #2919  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 5,596
I believe VapourSynth may not be able to load AviSynth plugins with the ancient v2.0 or v2.5 interfaces, but require v2.6... so: Do you have a few examples which plugins load and which don't?
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 14th December 2017, 14:51   #2920  |  Link
kriNon
Registered User
 
Join Date: Jul 2016
Posts: 37
I've only tested a few, I remember that TIVTC v1.0.5 didn't work, but v1.0.9 worked. Neither Deen or eDeen have worked for me, however I've seen that in https://github.com/vapoursynth/vapou...nth_compat.cpp there are the lines:
PREFETCHR1(deen)
PREFETCHR0(eDeen)
so I assume that there is compatibility?

Also someone used Deen in their vapoursynth script here:
https://gist.github.com/4re/bba3f65469acfe0ec08a

EDIT:
I tested a few avisynth plugins at random to see which ones worked, and can confirm that I got the same error message when trying to load Average, BlendWeight, ColorBalance, FFT3DFilter, and Vinverse.

I have recently reinstalled both Avisynth and Vapoursynth and am having the same error.

Last edited by kriNon; 14th December 2017 at 15:16.
kriNon 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 - 2018, vBulletin Solutions Inc.