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 21st January 2024, 17:12   #1  |  Link
RGMOfficial
Registered User
 
RGMOfficial's Avatar
 
Join Date: May 2022
Location: Brazil
Posts: 38
How can i add an image with alpha in Vapoursynth?

I'm trying to add an RGB with alpha image.

Code:
wm = core.lsmas.LWLibavSource(r"watermarkhd.png")

wm.set_output()
With only "wm" as output, it shows the image without alpha, as RGB48.
But with the "wm[1]" as output, trying to get the alpha (Gray), did not output an preview and showed this error.

Code:
Failed to evaluate the script:
Python exception: List index out of bounds

Traceback (most recent call last):
File "src\\cython\\vapoursynth.pyx", line 3124, in vapoursynth._vpy_evaluate
File "src\\cython\\vapoursynth.pyx", line 3125, in vapoursynth._vpy_evaluate
File "", line 28, in 
File "src\\cython\\vapoursynth.pyx", line 2187, in vapoursynth.VideoNode.__getitem__
IndexError: List index out of bounds
__________________
AviSynth+ Projects:
DotCrawl++
RGMOfficial is offline   Reply With Quote
Old 21st January 2024, 18:08   #2  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,370
Use PropToClip
http://www.vapoursynth.com/doc/funct...roptoclip.html

Code:
wm = core.lsmas.LWLibavSource(r"watermarkhd.png")
alpha = core.std.PropToClip(wm)

# alpha.set_output() #view alpha
# wm[0].set_output() #view RGB or YUV channels of source (ie. not the alpha)
# wm[0].set_output(alpha=alpha) #output with alpha eg.. vspipe
To check if alpha is being set

Code:
vspipe --info script.vpy
It should say something like Alpha : Yes
poisondeathray 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 14:43.


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