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

Closed Thread
 
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: Finland
Posts: 5,729
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  
Old 17th August 2019, 02:25   #482  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
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  
Old 17th August 2019, 10:35   #483  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,729
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  
Old 17th August 2019, 20:48   #484  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
Same issue I had with mxNet. Yes, VS 47.2 fixes it.
__________________
...desu!
Mystery Keeper is offline  
Old 1st September 2019, 21:29   #485  |  Link
fAy01
Registered User
 
Join Date: Jun 2010
Posts: 91
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  
Old 2nd October 2019, 05:02   #486  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,371
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  
Old 2nd October 2019, 08:16   #487  |  Link
HolyWu
Registered User
 
Join Date: Aug 2006
Location: Taiwan
Posts: 392
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  
Old 2nd October 2019, 15:32   #488  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,371
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  
Old 2nd October 2019, 15:47   #489  |  Link
_Al_
Registered User
 
Join Date: May 2011
Posts: 321
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  
Old 2nd October 2019, 16:04   #490  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,371
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  
Old 2nd October 2019, 16:20   #491  |  Link
_Al_
Registered User
 
Join Date: May 2011
Posts: 321
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  
Old 20th October 2019, 20:46   #492  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Contrasharpen and smdegrain(contrasharp=True) produce a pink border. VS R48 RC1

clip = core.std.BlankClip(format=vs.YUV420P8)
clip=haf.SMDegrain(clip, contrasharp=True)
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline  
Old 20th October 2019, 21:07   #493  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,554
Quote:
Originally Posted by ChaosKing View Post
Contrasharpen and smdegrain(contrasharp=True) produce a pink border. VS R48 RC1

clip = core.std.BlankClip(format=vs.YUV420P8)
clip=haf.SMDegrain(clip, contrasharp=True)
I can't reproduce it. Using the vsrepo version of everything. Try adding vs.core.std.SetMaxCPU("none") to the start of the script on your end.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet

Last edited by Myrsloik; 20th October 2019 at 21:14.
Myrsloik is offline  
Old 20th October 2019, 22:48   #494  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
The pink border disappears with SetMaxCPU("none"). My cpu is a ryzen 2600
With SetMaxCPU("avx2") and "sse2" it's still pink.

EDIT
With BlankClip(format=vs.YUV420P16) (and 420P10) it's the same, except that sse2 produces vertical stripes.

EDIT
422, 444 is also affected.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database

Last edited by ChaosKing; 20th October 2019 at 22:54.
ChaosKing is offline  
Old 21st October 2019, 07:42   #495  |  Link
l00t
Where's my loot?
 
Join Date: May 2019
Posts: 63
bbmod also seems to be affected, it was OK with R47.2 and broken in R48-RC1

(tested with YUV420P8, YUV444P16 and YUV420P16)

Quote:
Originally Posted by ChaosKing View Post
Contrasharpen and smdegrain(contrasharp=True) produce a pink border. VS R48 RC1

clip = core.std.BlankClip(format=vs.YUV420P8)
clip=haf.SMDegrain(clip, contrasharp=True)
l00t is offline  
Old 21st October 2019, 08:11   #496  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,554
Quote:
Originally Posted by l00t View Post
bbmod also seems to be affected, it was OK with R47.2 and broken in R48-RC1

(tested with YUV420P8, YUV444P16 and YUV420P16)
I still can't reproduce it. What are you using to view the output?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline  
Old 21st October 2019, 08:39   #497  |  Link
l00t
Where's my loot?
 
Join Date: May 2019
Posts: 63
VapourSynth Edtior r19
l00t is offline  
Old 21st October 2019, 08:46   #498  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
vsedit r19

Code:
import vapoursynth as vs

import mvsfunc as mvf
import havsfunc as haf
core = vs.core


clip = core.std.BlankClip(width=200,height=100, format=vs.YUV420P8)
sm=haf.SMDegrain(clip, contrasharp=True) # havsfunc from master
clip=core.std.StackHorizontal([clip.text.Text("blank"), sm.text.Text("smdegrain +\ncontrasharp \ncpu default/not set")])


vs.core.std.SetMaxCPU("none")

clip2 = core.std.BlankClip(width=200,height=100, format=vs.YUV420P8)
sm=haf.SMDegrain(clip2, contrasharp=True) # havsfunc from master
clip2=core.std.StackHorizontal([clip2.text.Text("blank"), sm.text.Text("smdegrain +\ncontrasharp cpu none")])

c=core.std.StackVertical([clip, clip2])



vs.core.std.SetMaxCPU("sse2")

clip3 = core.std.BlankClip(width=200,height=100, format=vs.YUV420P16) #16!
sm=haf.SMDegrain(clip3, contrasharp=True) # havsfunc from master
clip3=core.std.StackHorizontal([clip3.text.Text("blank"), sm.text.Text("smdeg + contrasharp \ncpu sse2 16bit")])


c=core.std.StackVertical([c, mvf.Depth(clip3, 8)])

c.set_output()
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline  
Old 21st October 2019, 08:58   #499  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,554
Nice, that manages to reproduce the green stripes. Oddly enough the pink border doesn't happen on my system.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline  
Old 21st October 2019, 09:19   #500  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
And if it helps. The problem is produced somewhere in contrahsrapening and not smdegrain: https://github.com/HomeOfVapourSynth...sfunc.py#L5406
It's a short script and the pink border still happens if you remove miniblur.

When I remove the only Expr line, the stripes disappear but the pink border is still there. Border could be Repair or MakeDiff. Will test later more.


EDIT
should this produce a pink image?
Code:
clip = core.std.BlankClip(width=200,height=100, format=vs.YUV420P8)
matrix1 = [1, 2, 1, 2, 4, 2, 1, 2, 1]
con = core.std.Convolution(clip, matrix=matrix1)

clip=core.std.MakeDiff(clip, con)
EDIT2
mode=0 -> green image. So I guess the pink border comes from MakeDiff.


EDIT3
This is how it looks in R47
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database

Last edited by ChaosKing; 21st October 2019 at 09:33.
ChaosKing is offline  
Closed Thread

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 23:18.


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