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 August 2019, 21:44   #481  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,591
I'll have to try updating all the plugins and stuff, maybe there is something causing it.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 17th August 2019, 02:25   #482  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,151
Quote:
Originally Posted by Boulder View Post
I'll have to try updating all the plugins and stuff, maybe there is something causing it.
I can reproduce it with earlier vs version, it is okay with newest version.
lansing is offline   Reply With Quote
Old 17th August 2019, 10:35   #483  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,591
Quote:
Originally Posted by lansing View Post
I can reproduce it with earlier vs version, it is okay with newest version.
That's true. I just upgraded from R47 to R47.2 and it's gone
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 17th August 2019, 20:48   #484  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 711
Same issue I had with mxNet. Yes, VS 47.2 fixes it.
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 1st September 2019, 21:29   #485  |  Link
fAy01
Registered User
 
Join Date: Jun 2010
Posts: 74
Thanks for filling my previous requests. Would you consider porting InpaintDelogo https://forum.doom9.org/showthread.php?t=176860 ? Furthermore, I'm interested to see how it'd perform against logoNR.
Also, please port SmoothD2 to as well. http://avisynth.nl/index.php/SmoothD2 <-- SmoothD2 performs better than other deblocking plugin and scripts (DeblockPP7, deblock_qed, and AutoDeblock).

Last edited by fAy01; 27th September 2019 at 19:21.
fAy01 is offline   Reply With Quote
Old 2nd October 2019, 05:02   #486  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,927
overlay bug ?

Overlay bug? havsfunc r32

A foreground clip smaller in dimensions than the background clip, cuts out with black to fill the height

avisynth
https://i.postimg.cc/6pNPV4nf/overlay-avs.png

vapoursynth
https://i.postimg.cc/zX3DmMcc/overlay-vpy.png

avs
Code:
fg=blankclip(1,1024,640,"RGB24",color=color_darkred)
bg=blankclip(1,1280,720,"RGB24",color=color_gray)

overlay(bg,fg)
vpy
Code:
fg = core.std.BlankClip(width=1024, height=640, format=vs.RGB24, fpsnum=24, fpsden=1, length=1, color=[139, 1, 0])
bg = core.std.BlankClip(width=1280, height=720, format=vs.RGB24, fpsnum=24, fpsden=1, length=1, color=[128, 128, 128])
overl = haf.Overlay(bg, fg)

overl.set_output()

EDIT: also, x=, y= positioning do not seem to work in vpy overlay (e.g. x=20, y=20) - it just returns the bg clip; but works ok in avisynth

Last edited by poisondeathray; 2nd October 2019 at 05:13.
poisondeathray is offline   Reply With Quote
Old 2nd October 2019, 08:16   #487  |  Link
HolyWu
Registered User
 
HolyWu's Avatar
 
Join Date: Aug 2006
Location: Taiwan
Posts: 639
Quote:
Originally Posted by poisondeathray View Post
Overlay bug? havsfunc r32

A foreground clip smaller in dimensions than the background clip, cuts out with black to fill the height
It likely is a MaskedMerge bug introduced in VS R47. Try again with VS R46.
HolyWu is offline   Reply With Quote
Old 2nd October 2019, 15:32   #488  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,927
Quote:
Originally Posted by HolyWu View Post
It likely is a MaskedMerge bug introduced in VS R47. Try again with VS R46.
Works with R46.
poisondeathray is offline   Reply With Quote
Old 2nd October 2019, 15:47   #489  |  Link
_Al_
Registered User
 
Join Date: May 2011
Posts: 76
for overlay you can use this overlay function (based on our discussion on ramping), I just simplified that, no moduls needed only numpy.

avantages: much faster, YUV does not need to be converted to 444, numpy does it on the fly even chroma resolutions, works with any vs format
cons: numpy modul needed
formats needs to be the same though, also make sure the lengths are same, and there is enough room for pasting pip did not troubleshoot that:
Code:
import vapoursynth as vs
from vapoursynth import core
import numpy as np

file1 = r'C:\path\background.mp4'
file2 = r'D:\path\pasted_video.avi'
X1,Y1 = (100,100)                       

clip = core.ffms2.Source(file1)
pip = core.ffms2.Source(file2)
#make sure clips have the same format and lenght, then continue

def overlay(clip, pip, X1, Y1):
    pl = clip.format.num_planes
    if clip.format.name == 'CompatBGR32':
        Y1 = clip.height - (Y1 + pip.height)       #Y is mirrored
    X2,Y2 = (X1 + pip.width, Y1 + pip.height)
    #shifting 0,1 or 2 to get chroma coordinates, equivalent of dividing Y plane coordinates by 1,2 or 4
    X1CH,Y1CH  = (X1 >> clip.format.subsampling_w, Y1 >> clip.format.subsampling_h)  
    X2CH,Y2CH  = (X2 >> clip.format.subsampling_w, Y2 >> clip.format.subsampling_h)

    def pip_func(n,f):
        fout = f[0].copy()
        for p in range(pl):
            plane     = np.asarray(f[0].get_read_array (p))
            rectangle = np.asarray(f[1].get_read_array (p))
            plane_out = np.asarray(fout.get_write_array(p))
            if p:  plane[Y1CH:Y2CH, X1CH:X2CH] = rectangle    #p=1,2   U,V plane
            else:  plane[Y1:Y2, X1:X2]         = rectangle    #p=0     Y plane    
            np.copyto(plane_out, plane)            #writing np.array plane into vapoursynth._memoryviewslice     
            del plane_out
        return fout
    return core.std.ModifyFrame(clip, [clip,pip], pip_func)
    
clip = overlay(clip, pip, X1, Y1)
clip.set_output()

Last edited by _Al_; 2nd October 2019 at 16:45.
_Al_ is offline   Reply With Quote
Old 2nd October 2019, 16:04   #490  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,927
Thanks _Al_ ;

I don't "need" it right now in terms of some pressing engagement ; but there are some functions and scripts that rely MaskedMerge and/or Overlay that are probably broken in R47.x

If that method is better in terms of pros/cons , maybe it can be implemented in vapoursynth core, maskedmerge, or havsfunc overlay ?
poisondeathray is offline   Reply With Quote
Old 2nd October 2019, 16:20   #491  |  Link
_Al_
Registered User
 
Join Date: May 2011
Posts: 76
To be fully replaceable, opacity and mask arguments would need to be added. Havsfunc.Overlay offers arguments like that, in a sense if there is no opacity it might not be calledd overlay (as I named that function). It would involve some numpy calculations to achieve that. But MaskedMerge is a vs function, so it is fast, it would be interesting to compare it speed wise.
_Al_ 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 05:10.


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