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 Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st November 2022, 19:26   #1  |  Link
BabaG
Registered User
 
Join Date: Dec 2003
Posts: 253
RemoveDirtMC strength value vs resolution question

I'm using RemoveDirtMC for dirt removal on some 16mm film transfers. The material in question is extremely grainy b&w footage that was hand developed and has lots of dirt and scratches. For now, I'm ignoring the scratches and trying to get a handle on the dirt and grain.

I ran some tests and have gotten some pretty impressive dirt removal, though, at the cost of some morphing-like artifacts in fast moving objects. The resolution for the material I'm testing with is 1440x1080p. There is original transfer material at 2880x2160p but it's quite cumbersome to work with until I find an appropriate workflow.

I've seen online reference to a strength setting of 20-50 for RemoveDirtMC as being highly effective, though, that was for SD material. Settings in that range did very little on my material. Is there a range in which RemoveDirtMC accepts values? 0-100? 0-1000? 0-infinite?

Not knowing anything about a working range and finding my own experiments inadequate in the 0-50 range, I googled like mad but found nothing. After that I just started throwing numbers into a test script: 100, 1000, 2000, 5000, 10000. Funnily enough, 2000 seemed to work very well, with the exception of the aforementioned morphy artifacts.

Can anyone provide guidance on the ranges in which I should be working with this strength setting? I want to test further but don't know how to increment my tests, by 1 point, by 10 points, by 100 points. The process is quite slow so having a proper range in which to work would save a lot of stabbing around in the dark.

thanks,
babag
BabaG is offline   Reply With Quote
Old 1st November 2022, 22:15   #2  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
I assume you've read the two main film restoration threads started by VideoFred:

The power of Avisynth: restoring old 8mm films.

and

Capturing and restoring old 8mm films

It was in the first thread, I think, where I suggested using RemoveDirtMC because it did a remarkably better job with film dirt than did Fred's original method. As those two long threads progressed, I'm pretty sure that people discussed the need to increase the RemoveDirt settings when working with higher-resolution material. I suggest you search through those posts to see if someone suggested values. As I remember, they may have been some other settings that had to be changed as you went to higher resolutions. I was actually the person who found some problems, but it was a long time ago and may have been in another thread. I think I uncovered a bug of some sort, but then found a workaround. If I remember more, I'll post it.

Both Fred and I capture at reasonably high resolution, but then downscale somewhat in order to reduce the processing time. I have had a chance to compare some of my transfers done this way to the same 16mm film captured by a "Hollywood" post house using a Spirit transfer, and while their machine did a little better in the shadows, there was no perceptible difference in detail between their HD (or higher) transfers and my SD down-res'd results.

However, if you want to stay with HD (which is perfectly fine -- I'm not trying to say you shouldn't), then you will have two issues: the settings, and also stability. I am a big fan of using multi-threading and was able to achieve significant integer multiple increases in processing speed (3-6 times faster) with all the changes I made to Fred's script, with MT being the biggest change. I seem to remember some problem with multi-threading with higher resolutions, but that may have been with earlier versions of AVISynth which did multi-threading differently (using SetMTMode).

I assume you have played around with various settings. Are you asking your question because you are concerned about the artifacts you are getting? If so, those are generally the price you pay for the dirt removal. You will also find that you will lose certain details, like a thrown ball in flight. I do a lot of sports film restoration, and my "solution" is to do two restorations, one with large RemoveDirt values and one with small values. I then cut between them when I edit the final result in my NLE.

The morphing artifacts can also be minimized by making sure you have the right settings for the MVTools2 MAnalyze state.

Long ago I posted my "latest" film restoration script here:

https://forum.doom9.org/showthread.p...06#post1595606

The actual script is in the posts below that one.
johnmeyer is offline   Reply With Quote
Old 1st November 2022, 22:18   #3  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
Ah, here is that thread I started a decade ago. Given how long ago that was and given my age, I'm amazed I remembered anything at all.

MVTools2 artifacts, but only at high resolution


Read though it all, but make sure to read post #14.

Last edited by johnmeyer; 1st November 2022 at 22:20.
johnmeyer is offline   Reply With Quote
Old 1st November 2022, 23:15   #4  |  Link
BabaG
Registered User
 
Join Date: Dec 2003
Posts: 253
Thanks for the replies, John. I have skimmed much of those threads and read other parts in detail but haven't noticed settings ranges being noted. Not to say they aren't there but, at a certain point, it starts to be easier to run a bunch of tests than to carefully comb through 70+ pages of details only some of which I understand.

I just did a bunch of testing and found that there seem to be repeating patterns of ranges that have the same or similar affect on the image. For example:

59-255
1851-2047
3899-4095

All of the above ranges seem to do the same thing on my scene. I hadn't found the pattern when I did this but I bet there's another range that ends at 1023 and maybe another at 511. Values anywhere inside these ranges seem to have no affect on the dirt or artifacting. And, they all span a range of 196 points. No idea what it all means but I do find it interesting.

Thanks also for the MVTools link. Will definitely be looking at that. The artifact I'm currently trying to get a handle on is one in which the image graininess is well mitigated by the scripting but at seemingly random points seems to lose its grip and stop working, allowing the original frames to pass through untreated, then it snaps back on. Sometimes long intervals between these jumps, sometimes very quick and almost flickery. Seems like it is likely related to RemoveDirtMC as there is usually dirt in the frames where the grainess snaps back and forth.

edit:
Just looked at a test in which I ran my script with the RemoveDirtMC filter off and the garin snapping on and off didn't happened. Guess that means it's related to the dirt removal and not the degraining.

Thanks again,
BabaG

Last edited by BabaG; 1st November 2022 at 23:56.
BabaG is offline   Reply With Quote
Old 2nd November 2022, 00:40   #5  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
MVTools2 scene detection threshold is hard-wired in most of the scripts. You may need to change that. Also, try changing thSAD.
johnmeyer 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 09:58.


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