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 > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th May 2021, 16:02   #61  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,364
Please check RgTools (bug in Forward/BackwardClense 10+ bits for non SSE4.1 processors)
https://github.com/pinterf/RgTools/releases/tag/1.2
pinterf is offline   Reply With Quote
Old 26th May 2021, 16:42   #62  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,169
Thanks
kedautinh12 is offline   Reply With Quote
Old 26th May 2021, 17:11   #63  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 760
Quote:
Originally Posted by pinterf View Post
Please check RgTools (bug in Forward/BackwardClense 10+ bits for non SSE4.1 processors)
https://github.com/pinterf/RgTools/releases/tag/1.2
Thank you very much, now everything works correctly.

However, I still have the doubt, why was RGTools the one that caused the problem if SCSelect when canceling it in my tests everything worked fine? That was why I turned to the old RemoveDirt which did work.

My script is:

LwLibavVideoSource ("Sample2.MP4")
DeCelluloid()

PD: I am preemptively now using RemoveDirt 0.9.3 x86 (not clang).
__________________
By law and justice!

GMJCZP's Arsenal

Last edited by GMJCZP; 26th May 2021 at 17:20.
GMJCZP is offline   Reply With Quote
Old 26th May 2021, 17:29   #64  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 760
Quote:
Originally Posted by StainlessS View Post
You using the Clang version again with no SSE 4.1 ?
If you dont have SSE4.1, SSE2 is probably best anyway, I remember there were often problems
with SSE3 and I never used it if SSE2 were available. [speed difference, negligible].

Post your script, and versions of stuff, AVS+, RemoveDirt RGtootls.

Also, whatever problem you have, post image using this.

Code:
###
# Function DeCelluloid (adapted by GMJCZP).
###

# Eliminate garbage of top and bottom image of old videos.
# Low Gfactor values => larger detection, more probability appear artifacts
# High Gfactor values => minor detection, more safe.
# Thanks a Didée for the idea.
# https://forum.doom9.org/showthread.php?p=1567932#post1567932
# Requirements: RGTools, RemoveDirt.
# Version 1.0, first attempt.

function DeCelluloid(clip source, float "Gfactor", bool "_grey" ) {
    Gfactor=default(Gfactor, 5.0) # Garbage factor
    _grey = default(_grey, false) # Source in Black and White
    prev = BackwardClense(source, grey=_grey)
    next = ForwardClense(source, grey=_grey)
    h = height(source)
    h_top = int(h*0.20)
    h_top = (h_top % 2) == 0 ? h_top : h_top + 1
    h_bottom = int(h*0.375)
    h_bottom = (h_bottom % 2) == 0 ? h_bottom : h_bottom + 1
    source.LetterBox(h_top,h_bottom).SCSelect(next,prev,source,dfactor=Gfactor)
}

FN = "Sample2.mp4".RT_GetFullPathName

LWLibavVideoSource(FN)
O=Last
#return info
DeCelluloid()

TOP=StackHorizontal(O,Last)
D1=ClipDelta(Last,O)
D2=ClipDelta(Last,O,true)
BOT=StackHorizontal(D1,D2)
StackVertical(Top,Bot)
return last

# Return Clip Difference of input clips (amp==true = Amplified, show==true = show background)
Function ClipDelta(clip clip1,clip clip2,bool "amp",bool "show") {
    amp=Default(amp,false)
    show=Default(show,false)
    c2=clip1.levels(128-32,1.0,128+32,128-32,128+32).greyscale()
    c1=clip1.subtract(clip2)
    c1=(amp)?c1.levels(127,1.0,129,0,255):c1
    return (show)?c1.Merge(c2):c1
}
Off to hopsital Appt, now.
EDIT: I dont see any green stuff.
TinMan, the madness continues.

But little by little all the problems I had, and did not know because I was away from Doom9, have been solved, The Market is flourishing again thanks to your help.

Hopefully pinterf can clarify my question about RGTools and SCSelect
__________________
By law and justice!

GMJCZP's Arsenal

Last edited by GMJCZP; 26th May 2021 at 17:35.
GMJCZP is offline   Reply With Quote
Old 8th January 2025, 17:51   #65  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,364
RemoveDirt v1.1 (20250108)
https://github.com/pinterf/RemoveDirt/releases/tag/v1.1
Milestone: Vapoursynth (API v4) support

This is my first real Vapoursynth port, so it can probably be fine tuned and may contain bugs.
Nevertheless I tried to separate the internal algorithm to have as much common part as it can be, so parts I was using in Avisynth should work in Vapoursynth as well unless I messed up obvious vsapi calls.
I was not surprised that 98% of the time went into de-Avisynthing and restructuring the existing code.

As for the Avisynth part, there is no change in it except that YUY2 (ancient planar hack) support is removed.

The DLL contains Windows builds x86 and x86, Microsoft and LLVM compiled versions.

For usage check documentation in release pack.

Thanks to Selur for the never ending motivation reminders . By seeing the number of working hours, no wonder why I postponed this conversion for years

EDIT: SCSelect fix in v1.1, thx to Selur for the quick test.

Last edited by pinterf; 8th January 2025 at 18:45.
pinterf is offline   Reply With Quote
Old 8th January 2025, 18:44   #66  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,558
Quote:
Thanks to Selur for the never ending motivation reminders .
Thanks to you for keeping up with my nagging and looking into it.


Cu Selur
__________________
Hybrid here in the forum, homepage, its own forum
Selur is offline   Reply With Quote
Old 8th January 2025, 19:06   #67  |  Link
LightArrowsEXE
Mt. Fuji Encoding Alumni
 
LightArrowsEXE's Avatar
 
Join Date: Nov 2016
Location: Netherlands
Posts: 14
As an avid VS user, also thank you! I hope we can see more ports for both frameservers in the future!
LightArrowsEXE is offline   Reply With Quote
Old 8th January 2025, 23:26   #68  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 821
It's hard to say if this works correctly. The show option specifies which motion blocks are being changed.
Avisynth function: Clense [function, false, 4]
Avisynth function: ForwardClense [function, false, -1]
Avisynth function: BackwardClense [function, false, -1]
Avisynth function: SCSelect [function, function, function, function, true]
Avisynth function: Repair [function, function, 16, 16]
Avisynth function: Repair [function, function, 16, 16]
Avisynth function: RestoreMotionBlocks [function, function, function, function, false, 70, 1, 2, false, 10, 12, false]
Avisynth function: RemoveGrain [function, 17, 17]
Jamaika is offline   Reply With Quote
Old 9th January 2025, 06:53   #69  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,364
Thanks for the report, but please provide a meaningful script instead of this debug output.
Also clarify the bug report a bit, what's wrong, the documentation or "show" does not work as intended?
pinterf is offline   Reply With Quote
Old 9th January 2025, 08:05   #70  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 821
I`m amateur. I'm looking at the wiki page. Test script. It seems that the RestoreMotionBlocks can't work without RgTools.
function RemoveDirt(clip input, bool "_grey", int "repmode")
{
_grey=default(_grey, false)
repmode=default(repmode, 16)
clmode=17
clensed=Clense(input, grey=_grey, cache=4)
sbegin = ForwardClense(input, grey=_grey, cache=-1)
send = BackwardClense(input, grey=_grey, cache=-1)
select = SCSelect(input, sbegin, send, clensed, debug=true)
alt=Repair(select, input, mode=repmode, modeU = _grey ? -1 : repmode )
restore=Repair(clensed, input, mode=repmode, modeU = _grey ? -1 : repmode)
corrected=RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, gmthreshold=70, dist=1, dmode=2, debug=false, noise=10, noisy=12, grey=_grey)
return RemoveGrain(corrected, mode=clmode, modeU = _grey ? -1 : clmode )
}

Testing:
AviSource("input_v210.avi", audio=false, pixel_type="V210")
RemoveDirt(false, 16)

If debug=true, then SCSelect sends output of the following type to the DebugView utility.
Hmm,... If I only have ffmpeg then this function is unnecessary. I don't have any information displayed.

The boolean variable debug and show are used for debugging. If show=true, then the blocks, which are marked as motion blocks in the first phase are colored red, those found in the second phase are colored green and finally the motion blocks marked by postprocessing are colored blue. In this way, one can easily check whether the above variables were selected appropriately. if debug=true, then RestoreMotionBlocks sends output of the following kind to the debugview utility:
I only have one color red and blue. Which parameter increases, decreases the motion block area.
When I use RemoveDirt(true, 16) the video won't play and everything is pink.

Last edited by Jamaika; 9th January 2025 at 08:13.
Jamaika is offline   Reply With Quote
Old 9th January 2025, 08:38   #71  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,364
Quote:
Originally Posted by Jamaika View Post
When I use RemoveDirt(true, 16) the video won't play and everything is pink.
You intentionally passed grey=true to the script function which passes it over to its various filters. I suppose in this case filters simply do not process and ignore the chroma planes thus they contain garbage. In your case you see pink colors, I can see diagonal lines.
pinterf is offline   Reply With Quote
Old 9th January 2025, 09:18   #72  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 821
Quote:
Originally Posted by pinterf View Post
You intentionally passed grey=true to the script function which passes it over to its various filters. I suppose in this case filters simply do not process and ignore the chroma planes thus they contain garbage. In your case you see pink colors, I can see diagonal lines.
Maybe but video doesn't play.
For amateurs ffmpeg with new RestoreMotionBlocks.
https://www.sendspace.com/file/8yufh8
Jamaika 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 02:03.


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