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 16th November 2012, 02:36   #21  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Chikuzen View Post
update
download it from the link of first post.

* support alpha channel

If input avs is RGB32, alpha will be stored in "_Alpha" prop.
Actually the more proper way to do it to return two clips from the filter. See the avisource code for an example. The basic idea is that you call setvideoinfo(array of two videinfo, 2, core)

And then in the filter's getframe function you call getOutputIndex () to know which of the two clips you should output a frame for. Slightly more complicated to implement but it makes more sense. Or so I think.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 11th January 2013, 17:45   #22  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 595
updated to vsavsreader-0.1.0

* add new option 'alpha'
* change alpha channel support method.
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 15th October 2013, 12:21   #23  |  Link
RTW47
Rome Total War
 
RTW47's Avatar
 
Join Date: Mar 2013
Location: C:\Python33
Posts: 39
then I use Eval() function:
Code:
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin(r'C:\Program Files\VapourSynth\filters\vsavsreader.dll')
avs = """
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\LSMASHSource.dll")
LWLibavVideoSource("D:\amv\10bit.mp4", format="YUV420P8")
#ConvertToRGB24(matrix = "Rec709")
"""
video = core.avsr.Eval(lines = avs)
video.set_output()
In Python shell I get this:
Code:
Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>> 
Traceback (most recent call last):
  File "C:\Users\Edgaras\Desktop\py\1_vsavsreader # 'Eval' Libav FAIL.py", line 9, in <module>
    video = core.avsr.Eval(lines = avs)
  File "vapoursynth.pyx", line 983, in vapoursynth.Function.__call__ (src\cython\vapoursynth.c:15542)
vapoursynth.Error: 'Eval: 
failed to invoke \nLoadPlugin("C:\\Program Files\\AviSynth 2.5\\plugins\\LSMASHSource.dll")
\nLWLibavVideoSource("D:\x07mv\x08bit.mp4", format="YUV420P8")\n#ConvertToRGB24(matrix = "Rec709")\n'
>>>
then importing same .avs script(s) using vsavsreader's Import() function, then there's no error.

-vapoursynth r20 RC3
-avisynth 2.6 alpha 5
-vsavsreader 0.1.0
__________________
GOTO:EOF

Last edited by RTW47; 15th October 2013 at 15:46. Reason: help ^^"
RTW47 is offline   Reply With Quote
Old 14th December 2014, 23:00   #24  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Dumb question:

If there was a 64-bit version of this plugin could it be used to load 32-bit AviSynth scripts in a 64-bit VapourSynth? I know piping allows using applications interchangeably but that may be something completely different.
Reel.Deel is offline   Reply With Quote
Old 14th December 2014, 23:13   #25  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Reel.Deel View Post
Dumb question:

If there was a 64-bit version of this plugin could it be used to load 32-bit AviSynth scripts in a 64-bit VapourSynth? I know piping allows using applications interchangeably but that may be something completely different.
No. Avisynth is loaded into the same process so it has to be 64bit too. You need a more elaborate wrapper that runs avisynth in a 32bit environment for it to work.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 14th December 2014, 23:19   #26  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Quote:
Originally Posted by Myrsloik View Post
No. Avisynth is loaded into the same process so it has to be 64bit too. You need a more elaborate wrapper that runs avisynth in a 32bit environment for it to work.
Understood, sounds like it's something feasible though. Pity that Chikuzen is no longer around...
Reel.Deel is offline   Reply With Quote
Old 16th December 2014, 11:34   #27  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Reel.Deel View Post
Understood, sounds like it's something feasible though. Pity that Chikuzen is no longer around...
What remaining avisynth things do you need?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 16th December 2014, 16:53   #28  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Quote:
Originally Posted by Myrsloik View Post
What remaining avisynth things do you need?
I don't have a very strong case here but DGDecNV and DGMPGDec are really hard to leave behind considering how good they've been to me. I know there's d2vsource but as we all know is still a work in progress. On the other hand DGDecNV also comes in 64-bit so I'm wondering if a 64-bit vsavareader would work with 64-bit AviSynth+?

In the meantime I'm using AVFS to create a fake avi and then loading it with VS.
Reel.Deel is offline   Reply With Quote
Old 16th December 2014, 17:19   #29  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by Reel.Deel View Post
I don't have a very strong case here but DGDecNV and DGMPGDec are really hard to leave behind considering how good they've been to me. I know there's d2vsource but as we all know is still a work in progress. On the other hand DGDecNV also comes in 64-bit so I'm wondering if a 64-bit vsavareader would work with 64-bit AviSynth+?

In the meantime I'm using AVFS to create a fake avi and then loading it with VS.
Yes, it should work with 64bit avs+ as well. I guess.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 16th December 2014, 17:25   #30  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Quote:
Originally Posted by Myrsloik View Post
Yes, it should work with 64bit avs+ as well. I guess.
Unfortunately I only have Microsoft Visual C++ 2010 Express so I guess I'm SOL when it comes to trying to compile a 64-bit vsavsreader.
Reel.Deel is offline   Reply With Quote
Old 16th December 2014, 17:47   #31  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
Quote:
Originally Posted by Reel.Deel View Post
Unfortunately I only have Microsoft Visual C++ 2010 Express so I guess I'm SOL when it comes to trying to compile a 64-bit vsavsreader.
http://www.visualstudio.com/en-us/pr...o-community-vs
TheFluff is offline   Reply With Quote
Old 16th December 2014, 17:59   #32  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Visual Studio Community 2013 seems very nice for someone who does this on a regular basis. I've successfully compiled at most 10 avs plugins in the last 2 years. Also I read somewhere that Community version is a very large download/install compared to the express edition.
Reel.Deel is offline   Reply With Quote
Old 16th December 2014, 18:30   #33  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
there's a difference between being unable to do a thing and being too lazy to do a thing
TheFluff is offline   Reply With Quote
Old 16th December 2014, 19:17   #34  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
I don't like to be mean so I deleted my post...

Last edited by Reel.Deel; 16th December 2014 at 19:24.
Reel.Deel is offline   Reply With Quote
Old 16th December 2014, 19:33   #35  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
I'm just going to add that using vs avisource to open an avisynth script and (if necessary) fmtconv's 16 bit avisynth compatibility functions should work just as well.

I completely forgot that this plugin kinda is obsolete now because avisource exists.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 16th December 2014, 21:18   #36  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Good point Myrsloik, I completely forgot about avisource also.
Reel.Deel is offline   Reply With Quote
Old 29th December 2014, 14:10   #37  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Quote:
Originally Posted by HolyWu View Post
I just do some experiments, and 64-bit VS AVISource seems to conflict with a avs script using 64-bit DGDecNV as the source filter, while VirtualDub x64 can preview that same avs script without problem. The 64-bit vspipe crashed immediately when opening the vpy script. Do you have a supported NVIDIA card to test?
No, I don't have nvidia stuff. It's probably some kind of threading issue since VapourSynth will use multiple threads to request frames from vfw. Especially when using vspipe.

Try using an mt version of avisynth and see if it helps.

Otherwise you're going to have to run it all in a debugger to see why it dies.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 9th May 2016, 10:07   #38  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
Code:
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:/scripts/Dither.avsi")
MPEG2Source("D:/source.d2v")
Dither_convert_8_to_16()
Dither_resize16(1280, 720)
Dither_convey_yuv4xxp16_on_yvxx()

I guess I'm missing the way this is supposed to work:

clip = core.avsr.Import('C:/script.avs', bitdepth=16

This loads clip into VapourSynth, I get that much. But, typically, Dither() et al. are an end-filter deal for me, like:

Code:
clip = whatever (clip)
clip = something else (clip)

....
clip = core.avsr.Import('C:/script.avs', bitdepth=16)
I don't see how that last AVS line builds upon the last state of clip at all. Or am I really missing something?!

Thanks.
__________________
Gorgeous, delicious, deculture!
asarian is offline   Reply With Quote
Old 9th May 2016, 23:07   #39  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
^^ Perhaps I should clarify this a bit:

Code:
#script.avs
LoadPlugin("C:/plugins/DGDecode.dll")
LoadPlugin("C:/plugins/Dither.dll")
Import("C:/scripts/Dither.avsi")
MPEG2Source("D:/source.d2v")
Dither_convert_8_to_16()
Dither_resize16(1280, 720)
Dither_convey_yuv4xxp16_on_yvxx()

The source in this imported AS script is just MPEG2Source, independently of what happened to 'clip' in your VS script thus far. I don't see how that is useful at all (except, maybe, when it's your first line in your VS script).

I'd just rather we'd be able to import/use Dither.avsi (and dll) itself, so you can use the Dither functions directly in VapourSynth. (Kinda makes me wonder whether Dither() even exists for 64-bit)
__________________
Gorgeous, delicious, deculture!
asarian is offline   Reply With Quote
Old 9th May 2016, 23:34   #40  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Quote:
Originally Posted by asarian View Post
I'd just rather we'd be able to import/use Dither.avsi (and dll) itself, so you can use the Dither functions directly in VapourSynth. (Kinda makes me wonder whether Dither() even exists for 64-bit)
Why not just use fmtconv? Also, zimg was integrated into VapourSynth a while back. See documentation for more information. As for MPEG2Source, use D2VSource. Case closed .
Reel.Deel is offline   Reply With Quote
Reply

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 21:28.


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