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. |
21st September 2012, 10:05 | #1 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
vsavsreader -- AviSynth script reader for VapourSynth
I wrote a VapourSynth plugin a few days ago.
This plugin works as a source filter on VapourSynth. you will be able to use avisynth filters which does not exist yet for VS(e.g. DirectShowSource) and has some compatibility issue like ColorMatrix() with this plugin. vsavsreader-1.0.0.zip requirement: VapourSynth-r30 or later AviSYnth2.6/avisynth+ Microsoft Visual C++ 2015 Redistributable Packages
__________________
my repositories Last edited by Chikuzen; 10th May 2016 at 12:49. |
23rd September 2012, 10:41 | #2 | Link | |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 6,915
|
I get this error when load the plugin:
Quote:
c.avs.LoadPlugin('vsavsreader.dll') VS r8 AviSynth 2.6.0a3 XP SP3
__________________
BeHappy, AviSynth audio transcoder. |
|
27th September 2012, 13:41 | #4 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
updated for VS-r9
see first post.
__________________
my repositories |
28th September 2012, 01:09 | #5 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
I looked at the source and spotted this small problem:
****vsapi->propSetInt(props, "_DurationNum", ah->avs_vi->fps_denominator * n, 0); Should be ****vsapi->propSetInt(props, "_DurationNum", ah->avs_vi->fps_denominator, 0);
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
28th September 2012, 07:20 | #6 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
fixed.
__________________
my repositories |
1st October 2012, 12:24 | #7 | Link |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,666
|
Hi Chikuzen, thanks for this usefull plugin.
Since there are some plugins/scripts that can work with dither's lsb in/out. I was wondering if would it be possible to add a function that can merge msb/lsb into a compatible YUVxxxP16 format? |
1st October 2012, 12:42 | #8 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
I think that this is a VS's bug.
from vsstdlib.c Code:
static int findCommonVi(const VSNodeRef **nodes, int num, VSVideoInfo *outvi, int ignorelength, const VSAPI *vsapi) { int mismatch = 0; int i; const VSVideoInfo *vi; *outvi = *vsapi->getVideoInfo(nodes[0]); for (i = 1; i < num; i++) { vi = vsapi->getVideoInfo(nodes[i]); if (outvi->width != vi->width || outvi->height != vi->height) { outvi->width = 0; outvi->height = 0; mismatch = 1; } if (outvi->format != vi->format) { outvi->format = 0; mismatch = 1; } if ((outvi->numFrames < vi->numFrames && outvi->numFrames) || (!vi->numFrames && outvi->numFrames)) { outvi->numFrames = vi->numFrames; if (!ignorelength) mismatch = 1; } } return mismatch; }
__________________
my repositories Last edited by Chikuzen; 1st October 2012 at 12:52. |
1st October 2012, 12:44 | #9 | Link | |
typo lover
Join Date: May 2009
Posts: 595
|
Quote:
stacked format is not supported. Code:
clip = core.avsr.Import('foo.avs', bitdepth=16)
__________________
my repositories Last edited by Chikuzen; 1st October 2012 at 12:47. |
|
1st October 2012, 12:49 | #10 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
1st October 2012, 12:58 | #11 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
Then, is pointing out the same address right as for format of node[0] and format of node[1] ?
__________________
my repositories |
1st October 2012, 13:03 | #12 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
I found the problem. You're never supposed to create a format struct yourself, you query it from the core.
Code:
format->id = table[i].id; strcpy(format->name, table[i].name); format->colorFamily = table[i].color_family; format->bitsPerSample = ah->bitdepth; format->bytesPerSample = (ah->bitdepth + 7) / 8; format->subSamplingW = table[i].subsample_w; format->subSamplingH = table[i].subsample_h; format->numPlanes = avs_is_y8(ah->avs_vi) ? 1 : 3; return format; Code:
return vsapi->getFormatPreset(table[i].id, core); something like: Code:
return registerFormat(cmYuv/cmRgb/cmGray, stInteger, bitsPerSample, subSamplingW, subSamplingH, core);
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
1st October 2012, 13:13 | #13 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
ok, I understood.
Since this plugin was written when the source code had not been opened yet, I was not using vsapi in the place which needs it.
__________________
my repositories Last edited by Chikuzen; 1st October 2012 at 13:17. |
1st October 2012, 13:21 | #14 | Link | |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,666
|
Quote:
* Edit * Maybe it's not such a bad idea to add that information to the readme. Last edited by Reel.Deel; 1st October 2012 at 15:46. Reason: added suggestion |
|
1st October 2012, 14:10 | #15 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
fixed Splice issue.
please download fixed version from the link of first post. I appreciate advice of Myrsloik.
__________________
my repositories |
1st October 2012, 17:43 | #16 | Link | |
typo lover
Join Date: May 2009
Posts: 595
|
Quote:
If you write them, I'll add them into the readme.
__________________
my repositories |
|
2nd October 2012, 13:05 | #17 | Link | |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,666
|
Quote:
I wish my Japanese were half as good as your English. * Edit * Here's the description I wrote on how to import Dither's msb/lsb format into Vapoursynth. I'm not an expert so I hope it makes sense. Code:
VsAvsReader is able to convert Dither's interleaved MSB/LSB format into a compatible Vapoursynth YUV4xxP9/10/16 format. Dither's MSB/LSB must be interleaved, stacked format is not supported. Only YUV planar formats are allowed. example 1: Use VsAvsReader's Import function to load external Avisynth script. Vapoursynth script # Core import vapoursynth as vs core = vs.Core(accept_lowercase=True) # Import plugins core.std.LoadPlugin('C:/vsavsreader.dll') # Use "Import" to load interleaved MSB/LSB Avisynth script. clip = core.avsr.Import('C:/script.avs', bitdepth=16) External Avsiynth script being imported. # script.avs LoadPlugin("C:/plugins/DGDecode.dll") LoadPlugin("C:/plugins/Dither.dll") Import("C:/scriptss/Dither.avsi") MPEG2Source("D:/source.d2v") Dither_convert_8_to_16() Dither_resize16(1280, 720) Dither_convey_yuv4xxp16_on_yvxx() _____________________________________________________________________ Example 2: Use VsAvsReader's Eval function to create Avisynth script inside a Vapoursynth script. Vapoursynth script # Core import vapoursynth as vs core = vs.Core(accept_lowercase=True) # Import plugins core.std.LoadPlugin('C:/vsavsreader.dll') # Use "Eval" to create interleaved MSB/LSB Avisynth script. lines = ''' LoadPlugin("C:/plugins/DGDecode.dll") LoadPlugin("C:/plugins/Dither.dll") Import("C:/scriptss/Dither.avsi") MPEG2Source("D:/source.d2v") Dither_convert_8_to_16() Dither_resize16(1280, 720) Dither_convey_yuv4xxp16_on_yvxx() ''' video = core.avsr.Eval(lines=lines, bitdepth=16) Last edited by Reel.Deel; 6th October 2012 at 13:44. |
|
5th October 2012, 05:58 | #18 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
@Reel.Deel
added
__________________
my repositories |
6th October 2012, 13:21 | #19 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
__________________
my repositories |
16th November 2012, 02:30 | #20 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
update
download it from the link of first post. * support alpha channel If input avs is RGB32, alpha will be stored in "_Alpha" prop.
__________________
my repositories |
Thread Tools | Search this Thread |
Display Modes | |
|
|