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 22nd May 2008, 16:05   #21  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,393
Quote:
Originally Posted by grumpygamer View Post
erm...
love your debate but what is your suggestion?
-gg
Get RemoveDirt, use
Code:
prev = source.selectevery(1,-1)
next = source.selectevery(1,1)
source.SCSelect(next,prev,source,dfactor=2.0)
, try dfactor = 1.0 ~ 5.0
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 23rd May 2008, 01:19   #22  |  Link
Comatose
Registered User
 
Join Date: Dec 2007
Posts: 639
Awesome :3

The only problem is I'm not sure how to use SCSelect to actually do something with this =/ how can I tell when a scene begin/end was detected?

Thanks

Last edited by Comatose; 23rd May 2008 at 01:25.
Comatose is offline   Reply With Quote
Old 23rd May 2008, 19:30   #23  |  Link
grumpygamer
Registered User
 
Join Date: Feb 2008
Posts: 56
thanks i'll try and see
-gg
grumpygamer is offline   Reply With Quote
Old 28th May 2008, 01:01   #24  |  Link
grumpygamer
Registered User
 
Join Date: Feb 2008
Posts: 56
Incredible! IT WORKS! YOU ARE A LIFESAVER!
Sorry for Capsing but I really wanted to say that out loud!
Thanks, thanks thanks!!!!!!!!!!!!
This solution should be more visible for other people too: couldn't you copy paste the code somewhere else too??

Anyway thanks again!! Awesome!!
-gg
grumpygamer is offline   Reply With Quote
Old 11th March 2012, 15:21   #25  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 738
I have the same problem in the bottom of the image (sometimes in the top). As already mentioned, this is due to old video editing. It comes in makeovers before and after.

I tried the suggestion Didée and does not work. Any ideas?
GMJCZP is offline   Reply With Quote
Old 11th March 2012, 16:51   #26  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,393
Short of seeing a sample to examine why it does not work: you can of course edit all scenechanges manually.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 12th March 2012, 14:42   #27  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 738
Hi Didée:

Unfortunately it is difficult for me to upload any video now.
It's like the pictures of the first post, but mostly the defect appears on the bottom of the image in the scene change.
What I can say is that I used freezeframe as you have no idea, lol.
I could upload a photo, I do not know if that will do.
GMJCZP is offline   Reply With Quote
Old 12th March 2012, 15:08   #28  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,152
What you see for instance in the first post is just the film edges of a negative cut.
I suggest manual work in Photoshop (and if jumps occur: manual frame alignment of the cut too), this is what I did on most of my restoration work in such case...
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're working on that issue. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 12th March 2012, 16:22   #29  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,393
Perhaps you need the equivalent of an "exclusion band", or something.

Code:
prev = source.selectevery(1,-1)
next = source.selectevery(1,1)
source.LetterBox(32,64).SCSelect(next,prev,source,dfactor=2.0) # not using top-32/bottom-64 pixels for the decisions
... or maybe it's something entirely else. The motor mechanic can't tell you what's broken when he can't look at the engine.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 12th March 2012, 23:07   #30  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 738
Quote:
Originally Posted by Emulgator View Post
What you see for instance in the first post is just the film edges of a negative cut.
I suggest manual work in Photoshop (and if jumps occur: manual frame alignment of the cut too), this is what I did on most of my restoration work in such case...
Sip, So I use freezeframe and when not resolved in this way turn to Photo-Paint and ImageSplice. But out of curiosity wanted to know if there was a "magic formula".

Quote:
Originally Posted by Didée View Post
Perhaps you need the equivalent of an "exclusion band", or something.

Code:
prev = source.selectevery(1,-1)
next = source.selectevery(1,1)
source.LetterBox(32,64).SCSelect(next,prev,source,dfactor=2.0) # not using top-32/bottom-64 pixels for the decisions
... or maybe it's something entirely else. The motor mechanic can't tell you what's broken when he can't look at the engine.
The key would be to concentrate the attention of a script or plugin in a given area of the screen and detect a drastic change in its structure, but only in that portion in comparison with the rest of the image.
Maybe I'm asking too much of Avisynth and you, Didée. I will try your home remedy.

Last edited by GMJCZP; 12th March 2012 at 23:20.
GMJCZP is offline   Reply With Quote
Old 13th March 2012, 18:47   #31  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 738
Didée, the improvement is incredible!

With dfractor = 4.0, in the sample I used, eliminates most of the defects. If is increased to 5.0 removes more but slightly destabilizes the image, in fact, is increased slightly video size with respect to dfractor = 4.0. Interestingly in one case, the defect rather than being eliminated, for example, the frame 770 became 769, the new frame 770 is corrected, apparently both is swaped.
Also noted of 1064 frames that the sample had happened to be 1063, a frame was lost.
Adding your remedy (and there are other arguments originally, of course) the time processor for the sample of 1063 frames (really was 1064) became 2:55 seconds to 4:55 seconds (more or less).

What about results?

Last edited by GMJCZP; 13th March 2012 at 18:58.
GMJCZP is offline   Reply With Quote
Old 18th March 2012, 15:32   #32  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 738
Any comments or suggestions?
GMJCZP is offline   Reply With Quote
Old 19th March 2012, 18:50   #33  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,606
i would say don't put too much hope in it. All that script does is to first find the scene change, and then replace the scene change frame with its previous or next frame, depending on the calculated difference, so there will be chances of failure where the calculated result doesn't go along with the actual source, and you'll have to live with that.
lansing is offline   Reply With Quote
Old 19th March 2012, 19:50   #34  |  Link
Chyrka
Registered User
 
Join Date: Oct 2011
Location: Kyiv, Ukraine
Posts: 25
I think, using of FreezeFrame is very reliable decision. Of course, manual defining of frame numbers for each scenechange is too slow, but in simple cases with two bad frames directly on the scenechange can be automatized with using any script for scenechange detection.
Chyrka is offline   Reply With Quote
Old 19th March 2012, 22:51   #35  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 729
It's not so bad if you use yatta. You need xvid 1st pass log (load it in tools, "s from file") or a run of ymc with scxvid. Then you can just jump to next section, freeze using hotkeys and repeat.

Doing it automatically can lead to errors - xvid's scene detection misdetects a lot (object passing through in front of camera, flashes). Moreover, it might be better to not freeze scenechanges if there is motion/panning/zooming...
mandarinka is offline   Reply With Quote
Old 20th March 2012, 04:10   #36  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 738
Sip, freezeframe + image editor is the most solid.

Hopefully Didée or another guru to give us some light in this regard.
GMJCZP is offline   Reply With Quote
Old 20th March 2012, 17:40   #37  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,606
Quote:
Originally Posted by GMJCZP View Post
Sip, freezeframe + image editor is the most solid.

Hopefully Didée or another guru to give us some light in this regard.
don't even bother with the freezeframe manual fix by yourself alone. I tried once, took me 2 hours to gone through 10 minutes of video time, and then i just give up.
lansing is offline   Reply With Quote
Old 21st March 2012, 04:11   #38  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 738
Lol.

I was reading the manual version of MVTools2 of Firesledge, and noticed that there is a function with a name like SCSelect of RemoveGrain, do not know if there is to do something, I think his name MSCSelect or something.
GMJCZP is offline   Reply With Quote
Old 26th March 2012, 14:13   #39  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 738
Well, now I can now say that there is something:

source = last
prev = BackwardClense (source, cache = -1)
next = ForwardClense (source, cache = -1)
source.SCSelect (next, prev, source, dfactor = 6.0) # dfactor> = 6.0, to avoid artifacts

Using now ForwardClense and BackwardClense resolve the problem of lost frame, moreover, it is faster. Should be used before any Denoiser, especially if Mo-Comp.
This method is taken of RemoveDirt (see the manual RemoveDirt 0.9).

However, the detection rate of known defect in the bottom of the screen is good but does not detect all cases, so I present for consideration an alternative method or beta:

source=last
super = MSuper(source)
vectors = MAnalyse(super, isb = false)
compensation = source.MCompensate(super,vectors)
# prepare blurred frame with some strong blur or deblock function:
blurred = compensation.Deblock(quant=51) # Use DeBlock function here
badmask = MSCDetection(source,vectors)
mt_merge(compensation,blurred,badmask)

Again, using a method based on a manual, in this case taken by Firesledge MVTools 2.6.0.

The downside of this method is that it produces serious artifacts (how about it?), but in return, if you play with the values ​​of thSCD1, thSCD2, thSAD and thSAD2 for MCompensate (I'm a newbie), the detection rate is higher.

I think the key is to provide a better motion estimate toSCSelect , or combine both ideas into one, or create a mask to focus attention on the top and bottom of the screen, like the idea of Didée, LetterBox.

Last edited by GMJCZP; 26th March 2012 at 14:32.
GMJCZP is offline   Reply With Quote
Old 1st April 2012, 05:09   #40  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 738
Formalizing the idea:

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)
}

Last edited by GMJCZP; 25th May 2021 at 18:19. Reason: Update information
GMJCZP is offline   Reply With Quote
Reply

Tags
anime

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


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