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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd October 2022, 14:16   #601  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,316
Ah, ok... If you where using the whole package AND several of my filters, you'll reach the user limit sooner as there is only one threadpool for everyone (but it's the purpose to avoid creating a lot of thread), and using the dll of each filter instead, each filter having its onw threadpool, the limit is reached leater because there is one threadpool/filter, and the limit is by threadpool, but it will produce more threads.
__________________
My github.
jpsdr is offline   Reply With Quote
Old 23rd October 2022, 15:08   #602  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
In DBSC script, I am usually quite happy to use Spline36Resize(), however for a particular case I wanted to use Nnedi3.
We find scene cuts and for each one, trim() and find current border and crop it, then resize that to input size (only a bit bigger).
However, for this job I also was wanting to resize to 1:1 SAR at some later point (after DBSC) so thought maybe best to do a single resize
inside of the DBSC script instead of having two upsize steps.
(Src = DVD PAL 4:3, resize wider for 1:1 SAR, eg 768x576)

Spline36Resize is ok for the smaller upsize, I guess a man on a galloping horse could not spot the difference.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 23rd October 2022 at 15:11.
StainlessS is offline   Reply With Quote
Old 31st October 2022, 03:06   #603  |  Link
agressiv
Registered Loser
 
agressiv's Avatar
 
Join Date: Dec 2004
Posts: 117
I'm having corruption using nnedi_rpow2 when any sort of Prefetch command is enabled on my 16-core Ryzen 5950x. My 6-core Intel never has a problem no matter what I set Prefetch to.

* Symptom: Stuttering/sync loss for an encode (first 30 frames or so - basically about 5-10 frames will "repeat" themselves
* Remove nnedi_rpow2, problem never occurs
* Tried removing all other filters
* Even setting AVS Prefetch to "2" has same behavior.
* Tried combinations of threads=1, prefetch=1 etc in the nnedi_rpow2 parameters
* Tried changing to MT_SERIALIZED, MT_NICE_FILTER, no effect
* If I remove Prefetch from the Avisynth script itself, it works fine (but obviously much slower because I'm using McDegrainSharp as well)

I'm not sure if it's the high core count or just AMD itself, anyone else ever see this?

Edit: AviSynth+ 3.7.2 64-bit

Last edited by agressiv; 31st October 2022 at 03:10.
agressiv is offline   Reply With Quote
Old 31st October 2022, 06:32   #604  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
Quote:
Originally Posted by agressiv View Post
I'm having corruption using nnedi_rpow2 when any sort of Prefetch command is enabled on my 16-core Ryzen 5950x. My 6-core Intel never has a problem no matter what I set Prefetch to.

* Symptom: Stuttering/sync loss for an encode (first 30 frames or so - basically about 5-10 frames will "repeat" themselves
* Remove nnedi_rpow2, problem never occurs
* Tried removing all other filters
* Even setting AVS Prefetch to "2" has same behavior.
* Tried combinations of threads=1, prefetch=1 etc in the nnedi_rpow2 parameters
* Tried changing to MT_SERIALIZED, MT_NICE_FILTER, no effect
* If I remove Prefetch from the Avisynth script itself, it works fine (but obviously much slower because I'm using McDegrainSharp as well)

I'm not sure if it's the high core count or just AMD itself, anyone else ever see this?

Edit: AviSynth+ 3.7.2 64-bit
I've seen similar things happen with MVTools functions. Try adding RequestLinear(clim=100) right after the source line and see if it helps. That one's in the TIVTC package I think.
__________________
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 31st October 2022, 06:42   #605  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
Just FYI, the whole point of having plugins_JPSDR.dll is for them to create their own optimised and multithreaded theadpool. TL;DR you guys don't really need Prefetch() with Jean Philippe's plugins. Heck, you'll get better performances without it than with it.
FranceBB is offline   Reply With Quote
Old 31st October 2022, 14:20   #606  |  Link
agressiv
Registered Loser
 
agressiv's Avatar
 
Join Date: Dec 2004
Posts: 117
Thanks! This RequestLinear() bit seems to fix it. I'll mess with it some more.

I'd love to not have to use Prefetch at all, but most of the MvTools (McDegrainSharp) stuff needs it or it's a huge performance hit - unless you know of a way around that?
agressiv is offline   Reply With Quote
Old 31st October 2022, 14:49   #607  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
Quote:
Originally Posted by agressiv View Post
most of the MvTools (McDegrainSharp) stuff needs it or it's a huge performance hit - unless you know of a way around that?
Unfortunately there's no way around MVTools.
There used to be a way with avstp.dll but it ended up being buggy and causing freezes, so now that it has been removed, MVTools will run single-threaded unless you use Prefetch, which is really a shame...
Ferenc is trying to fix it, but none of us seem to understand what is going on... (and if even the Supreme Grandmaster Ferenc Pinter can't properly get what's causing it, no one can).

Here: https://github.com/pinterf/mvtools/issues/46
FranceBB is offline   Reply With Quote
Old 31st October 2022, 15:00   #608  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
Maybe next gen handsome FranceBB can
kedautinh12 is offline   Reply With Quote
Old 31st October 2022, 15:06   #609  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I dont have problems using nnedi_rpow2("Spline36Resize") and McDegrainSharp(). [maybe a bit stutter on start only in player <eg VD2>, not encode]
I do use SetMTMode.avsi in Plugins.

last few lines
Code:
#########################################
# Filters from MVTools v2.6.0.5 (from http://forum.doom9.org/showthread.php?p=1386559#post1386559 ) Tested On 2016/03/06
SetFilterMTMode("MSuper",              MT_MULTI_INSTANCE)
SetFilterMTMode("MAnalyse",            MT_MULTI_INSTANCE)
SetFilterMTMode("MFlowFps",            MT_MULTI_INSTANCE)
SetFilterMTMode("MRecalculate",        MT_MULTI_INSTANCE)
#########################################
#Filters from EEDI2 v0.9.2 (from http://forum.doom9.org/showthread.php?t=173238 ) Tested On 2016/03/06
SetFilterMTMode("EEDI2",               MT_MULTI_INSTANCE)

########################################
SetFilterMTMode("MPP_SharedMemoryClient", 2) # real.finder
SetFilterMTMode("MPP_SharedMemoryServer", 3) # real.finder

########################################
SetFilterMTMode("RoboCrop",   MT_SERIALIZED)    # ADDED by me (always used close to source filter)
SetFilterMTMode("AutoLevels", MT_SERIALIZED)


#########################################
#keep it the last line please
if (FunctionExists("avstp_set_threads")) {
    # this isn't actually optimal, because it will also disable avstp threads if running
    # on a single-threaded filter chain
    avstp_set_threads(0, 1)   #disable threading in dither
}
However, in my usual render script I detect if upsize [where we would use nnedi_rpow2] and also McDegrainSharp, and if so then
I use McDegrainSharp before upsize and after Spline36Resize if downsizing.

EDIT:
In my SetMTMode.avsi there is this line below [but no entry for nnedi_rpow2()]
Code:
SetFilterMTMode("NNEDI3",               MT_MULTI_INSTANCE)
EDIT: "in my usual render script",
a BIG script function that takes a LOT of Global vars [with defaults if not existing] to configure the outcome.
We use Avisynthesizer_Mod / DGIndex / DGIndexNV templates to create scripts with default config Globals, and tweak
a few globals where required.

EDIT:
First few lines of a DGIndex / DGIndxNV template (can work Ok for both dgindex and dgindexNV)
Code:
#ASYNTHER Progressive_169_Robo


VideoFileName   ="__vid__"
AudioFileName   =LCase("__aud__")
AudioDelay      =Value("__del__")

###############

vExt = GetFilenameExtension(VideoFileName)

If(vExt == ".dgi")  { DGSource(VideoFileName)    } # DGIndexNV
Else                { Mpeg2Source(VideoFileName).TFM(d2v=VideoFileName) } # DGIndex : Auto check via TFM illegal transitions


AudioExt = GetFilenameExtension(AudioFileName)

Audio=      (AudioExt==".ac3") ? NICAC3Source(AudioFileName,channels=2,DRC=0)
        \ : (AudioExt==".mpa"||AudioExt=="mp1"||AudioExt==".mp2"||AudioExt==".mp3") ? NicMPG123Source(AudioFileName,Normalize=False)
        \ : (AudioExt==".wav") ? RaWavSource(AudioFileName)
        \ : (AudioExt==".dts") ? NicDTSSource(AudioFileName)
        \ : (AudioExt==".w64") ? RaWavSource(AudioFileName,samplerate=6)
        \ : 0

Assert(!isInt(Audio),"NO AUDIO")

(!isInt(Audio)) ? AudioDub(Audio).DelayAudio(AudioDelay).Trim(0,0) : NOP    # Trim, chop/add audio to length

(!isInt(Audio) && AudioRate() <> 44100) ? ResampleAudio(44100) : NOP

#AssumeTFF                       # not needed, both DGIndexNV and DGIndex set field order
#ConvertToYV24(Interlaced=False) # Optional

###########################
#Return last
###########################


### Status
Global G_FILECOUNT=1

### Debugging
Global G_DEBUG=True

### DeBlock(G_DEBLOCK)
Global G_DEBLOCK=0                  # Debloock setting

### QueryBorderCrop AND AutoContrast
Global G_SAMPLES=40

### QueryBorderCrop
Global G_QBC=True                # Switch On Border Cropping
    Global G_QBC_THRESH=-40.0        Global G_QBC_IGNORE = 0.2
    Global G_QBC_LEFTADD=0           Global G_QBC_TOPADD=0          Global G_QBC_RIGHTADD=0            Global G_QBC_BOTADD=0    # Additional cropping if still some border
    Global G_QBC_WMOD=2              Global G_QBC_HMOD=2                                                                        # Width/height multiple of these
    Global G_QBC_RLBT=$F                                            # Bits left to right, R,L,B,T                               # Edges to crop
    Global G_QBC_LACED=False
    Global G_QBC_SHOW=false

### AutoLevels
Global G_AL_AUTOALEVELS=False
    Global G_AL_IGNORE_LO   = 100.0/512
    Global G_AL_IGNORE_HI   = G_AL_IGNORE_LO
    Global G_AL_RADIUS      = 30
    Global G_AL_SC2TH       = 8
    Global G_AL_SC2PERC     = 100.0/3
    Global G_AL_MINRNG      = 110
    Global G_AL_INPUTLO     = RT_UNDEFINED
    Global G_AL_INPUTHI     = RT_UNDEFINED
    Global G_AL_AUTOGAMMA   = 1                       # 1 = NO Change, 0=Auto, else Gamma
    Global G_AL_MIDPOINT    = 0.5
    Global G_AL_GAMMAX      = 1.5                     Global G_AL_GAMMIN=1.0/G_AL_GAMMAX
    Global G_AL_BORD_L      = 16                       Global G_AL_BORD_T=16                     Global G_AL_BORD_R=16                  Global G_AL_BORD_B=16
    Global G_AL_DEBUG       = False
    Global G_AL_PRELIMITER  = True
    Global G_AL_MERGE       = 0.3
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 31st October 2022 at 15:40.
StainlessS is offline   Reply With Quote
Old 20th November 2022, 15:14   #610  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,316
New version, see first post.

@StainlessS
Can you check if this new version still have the issue of "not being able to get UserId" on your "insane" script ?
__________________
My github.
jpsdr is offline   Reply With Quote
Old 20th November 2022, 19:29   #611  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Thanks, will do but not right now, doin' significant re-write.


EDIT:
Quote:
insane" script
The script is maybe a prototype to find something that works prior to conversion to C/CPP.
(I'm currently tryin' to figure out how it works - you get more stupid as you get older.)
[ SHUT-UP! FranceBB. ]
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 20th November 2022 at 19:45.
StainlessS is offline   Reply With Quote
Old 26th February 2023, 12:35   #612  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,316
New version, see first post.
__________________
My github.
jpsdr is offline   Reply With Quote
Old 20th November 2023, 21:56   #613  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,316
New version, see first post, but nothing big...
__________________
My github.
jpsdr is offline   Reply With Quote
Reply


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 21:12.


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