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 11th September 2016, 08:30   #2281  |  Link
HolyWu
Registered User
 
HolyWu's Avatar
 
Join Date: Aug 2006
Location: Taiwan
Posts: 763
Quote:
Originally Posted by Selur View Post
but that still ignored the alpha (background all black)
Then you probably should look at the alpha channel first by using alpha.set_output() to make sure the content is correct. Or provide your png file.
HolyWu is offline   Reply With Quote
Old 11th September 2016, 08:34   #2282  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,230
]Here's the png I used.

Cu Selur
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..

Last edited by Selur; 11th September 2016 at 13:04.
Selur is offline   Reply With Quote
Old 11th September 2016, 09:57   #2283  |  Link
HolyWu
Registered User
 
HolyWu's Avatar
 
Join Date: Aug 2006
Location: Taiwan
Posts: 763
Quote:
Originally Posted by Selur View Post
Here's the png I used.

Cu Selur
For unknown reason, the value of the alpha channel is inverse. We need to apply Invert on the alpha clip. We also need to set fulld=True in bitdepth to keep the output in full-range, otherwise we don't get full opacity/transparency.

Code:
alpha = core.fmtc.bitdepth(clip=alpha, bits=clip.format.bits_per_sample, fulld=True).std.Invert()
HolyWu is offline   Reply With Quote
Old 11th September 2016, 10:19   #2284  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,230
Thanks! That works!
Positioning and only showing the logo for a short time works fine too:
Code:
# Imports
import sys
import os
import vapoursynth as vs
core = vs.get_core()
# Import Scripts Folder
scriptPath = 'G:/Hybrid/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Import havsfunc
import havsfunc as havsfunc
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/Imagemagick/libimwri.dll")
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/Support/fmtconv.dll")
core.std.LoadPlugin(path="G:/Hybrid/Vapoursynth/vapoursynth64/plugins/SourceFilter/LSmashSource/vslsmashsource.dll")
# Loading F:\TestClips&Co\test.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="F:/TestClips&Co/test.avi", cache=0)
# adding 'F:\TestClips&Co\background.png' using Overlay
[logo, alpha] = core.imwrif.Read(filename="F:/TestClips&Co/background.png", alpha=True)
logo = core.resize.Bicubic(clip=logo, format=clip.format.id, matrix_s="709")
alpha = core.fmtc.bitdepth(clip=alpha, bits=clip.format.bits_per_sample, fulld=True).std.Invert()
beforeLogo = core.std.Trim(clip,last=49)
selection = core.std.Trim(clip,first=50,last=100)
afterLogo = core.std.Trim(clip,first=101)
selection = havsfunc.Overlay(clipa=selection, clipb=logo, mask=alpha, x=20, y=40)
clip = beforeLogo + selection + afterLogo
# Output
clip.set_output()
-> Next question: How to fade the logo in and out over x frames?

Cu Selur
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..

Last edited by Selur; 11th September 2016 at 11:47.
Selur is offline   Reply With Quote
Old 12th September 2016, 20:42   #2285  |  Link
splinter98
Registered User
 
Join Date: Oct 2010
Posts: 36
Quote:
Originally Posted by Selur View Post
-> Next question: How to fade the logo in and out over x frames?
Try my crossfade function from: http://forum.doom9.org/showthread.ph...34#post1755234
splinter98 is offline   Reply With Quote
Old 12th September 2016, 20:44   #2286  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,230
Will do Thanks!
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 13th September 2016, 11:37   #2287  |  Link
aculnaig
Registered User
 
Join Date: May 2016
Posts: 7
Can't build VapourSynth

Can't build vapoursynth ( gcc (GCC) 6.2.1 20160830 )

VapourSynth ( latest git )
Code:
git describe --tags
R33.1-18-gf65402b
zimg ( latest git )
Code:
git describe --tags
release-2.2.1-13-g1855661

Errors
Code:
src/core/vsresize.cpp:33:2: error: #error zAPI v2 or greater required
 #error zAPI v2 or greater required
  ^~~~~


src/core/vsresize.cpp:121:23: error: ‘ZIMG_TRANSFER_ST2084’ was not declared in this scope
         { "st2084",   ZIMG_TRANSFER_ST2084 },
                       ^~~~~~~~~~~~~~~~~~~~
src/core/vsresize.cpp:122:23: error: ‘ZIMG_TRANSFER_ARIB_B67’ was not declared in this scope
         { "std-b67",  ZIMG_TRANSFER_ARIB_B67 },
                       ^~~~~~~~~~~~~~~~~~~~~~
src/core/vsresize.cpp:123:5: error: no matching function for call to ‘std::unordered_map<std::__cxx11::basic_string<char>, zimg_transfer_characteristics_e>::unordered_map(<brace-enclosed initializer list>)’
     };

src/core/vsresize.cpp:760:26: error: ‘struct vszimgxx::zfilter_graph_builder_params’ has no member named ‘nominal_peak_luminance’
                 m_params.nominal_peak_luminance = propGetScalarDef<double>(in, "nominal_luminance", NAN, vsapi);

Last edited by aculnaig; 13th September 2016 at 11:40.
aculnaig is offline   Reply With Quote
Old 13th September 2016, 11:38   #2288  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,289
You need to use the hdr branch of zimg to build it.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 13th September 2016, 12:26   #2289  |  Link
aculnaig
Registered User
 
Join Date: May 2016
Posts: 7
Thanks, It worked.
aculnaig is offline   Reply With Quote
Old 13th September 2016, 13:15   #2290  |  Link
Sm3n
Registered User
 
Join Date: Jul 2012
Posts: 94
Hello,

can you tell me if my guesses are true. Can I compile zimg on debian?
if yes why can't I compile it? Not sure I actualy can.
System: Debian wheezy x64

Here is my error code: http://paste2.org/tgXKhezc

cheers in advance
Sm3n is offline   Reply With Quote
Old 13th September 2016, 13:49   #2291  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,289
Quote:
Originally Posted by Sm3n View Post
Hello,

can you tell me if my guesses are true. Can I compile zimg on debian?
if yes why can't I compile it? Not sure I actualy can.
System: Debian wheezy x64

Here is my error code: http://paste2.org/tgXKhezc

cheers in advance
You compiler is too old.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 14th September 2016, 22:03   #2292  |  Link
Sm3n
Registered User
 
Join Date: Jul 2012
Posts: 94
OK. And do you think I can upgrade it? I'm not very confortable with debian - that's why I ask but I can manage it eventualy.
I'm trying to look for it right now...
Sm3n is offline   Reply With Quote
Old 14th September 2016, 23:06   #2293  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 311
Quote:
Originally Posted by Sm3n View Post
OK. And do you think I can upgrade it? I'm not very confortable with debian - that's why I ask but I can manage it eventualy.
I'm trying to look for it right now...
https://linuxconfig.org/how-to-upgra...stable-release
Are_ is offline   Reply With Quote
Old 15th September 2016, 10:13   #2294  |  Link
Sm3n
Registered User
 
Join Date: Jul 2012
Posts: 94
Thx a lot.
Sm3n is offline   Reply With Quote
Old 17th September 2016, 20:20   #2295  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,230
I'm trying to get Vapoursynth working on mac, using:
Code:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="/Users/selur/build-Hybrid-Desktop-Release/Hybrid.app/Contents/MacOS/vsfilters/SourceFilter/FFMS2/ffms2.dylib")
# Loading /Users/selur/Desktop/公演后感言.mp4 using FFMS2
clip = core.ffms2.Source(source="/Users/selur/Desktop/公演后感言.mp4",cachefile="/Users/selur/Desktop/temp/mp4_d59244d4d4de113a5823257ae88125fc_16807.ffindex")
# Output
clip.set_output()
I get:
Code:
Failed to evaluate the script:
Python exception: Failed to load /Users/selur/build-Hybrid-Desktop-Release/Hybrid.app/Contents/MacOS/vsfilters/SourceFilter/FFMS2/ffms2.dylib. Error given: dlopen(/Users/selur/build-Hybrid-Desktop-Release/Hybrid.app/Contents/MacOS/vsfilters/SourceFilter/FFMS2/ffms2.dylib, 1): image not found
Traceback (most recent call last):
  File "src/cython/vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:26897)
  File "/Users/selur/Desktop/temp/tempPreviewVapoursynthFile21_04_39_802.vpy", line 5, in <module>
    core.std.LoadPlugin(path="/Users/selur/build-Hybrid-Desktop-Release/Hybrid.app/Contents/MacOS/vsfilters/SourceFilter/FFMS2/ffms2.dylib")
  File "src/cython/vapoursynth.pyx", line 1383, in vapoursynth.Function.__call__ (src/cython/vapoursynth.c:25204)
vapoursynth.Error: Failed to load /Users/selur/build-Hybrid-Desktop-Release/Hybrid.app/Contents/MacOS/vsfilters/SourceFilter/FFMS2/ffms2.dylib. Error given: dlopen(/Users/selur/build-Hybrid-Desktop-Release/Hybrid.app/Contents/MacOS/vsfilters/SourceFilter/FFMS2/ffms2.dylib, 1): image not found
Do I need to load the filter in another way ?
(I'm on mac osx, vapoursynth was installed using homebrew, ffms2 was separately compiled and copied to '/Users/selur/build-Hybrid-Desktop-Release/Hybrid.app/Contents/MacOS/vsfilters/SourceFilter/FFMS2/ffms2.dylib' )
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 17th September 2016, 20:55   #2296  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,526
Use L-SMASH Source- I found it more reliable than ffms2, which is far from being perfect.
kolak is offline   Reply With Quote
Old 17th September 2016, 20:59   #2297  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,230
haven't figured out to compile l-smash on mac and I'm not sure if I the loading script is correct,...
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 17th September 2016, 21:49   #2298  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 755
Quote:
Originally Posted by Selur View Post
Do I need to load the filter in another way ?
(I'm on mac osx, vapoursynth was installed using homebrew, ffms2 was separately compiled and copied to '/Users/selur/build-Hybrid-Desktop-Release/Hybrid.app/Contents/MacOS/vsfilters/SourceFilter/FFMS2/ffms2.dylib' )
Are you sure you have the right file name? Are you sure that file is a library?
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 17th September 2016, 22:48   #2299  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,526
Quote:
Originally Posted by Selur View Post
haven't figured out to compile l-smash on mac and I'm not sure if I the loading script is correct,...
Vapoursynth OSX installer has it. You can find post about it in vs section.
kolak is offline   Reply With Quote
Old 18th September 2016, 05:28   #2300  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,230
Quote:
Are you sure you have the right file name? Are you sure that file is a library?
Ahhh it was a typo. Now I get a 'Video codec not found', but that is probably due to some mistake during the ffms2 compilation. (forgot the ffmpeg libs) Thanks totally didn't see the typo yesterday.
Quote:
Vapoursynth OSX installer has it. You can find post about it in vs section.
Problem with that is that it interferes with the vapoursynth version I installed through homebrew to be able to compile my own vsedit version (contains some limited ipc capabilities).
+ There doesn't seem to be a way to uninstall it and it's r33 not r33.1
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..

Last edited by Selur; 18th September 2016 at 06:47.
Selur 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 11:08.


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