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 8th October 2010, 16:27   #1  |  Link
MattW
Registered User
 
Join Date: Jun 2007
Posts: 5
Reducing Kinescope Moire

I have a film-to-video transfer of a kinescope recording which features Sam Cooke. Unfortunately, it suffers from unsightly moire patterning (see images). Do Doom9 forum members have advice as to what Avisynth tools or plugins to resolve the transfer defects? I've found that a vertical fast or Gaussian blur helps to reduce the moire patterning; however, it obviously noticeably blurs the picture. Is it possible to reduce moire without largely sacrificing video quality?

Edit: A small excerpt (6 seconds; 7.5 MB) of the footage (.m2v format) is available here. The segment is excerpted from a DVD, "Sam Cooke: Legend."




Last edited by MattW; 9th October 2010 at 20:11.
MattW is offline   Reply With Quote
Old 8th October 2010, 23:02   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,146
Dont know what it is but, I would hesitate, to call it moire.

Sample clip would very definitely help those that can help U.
__________________
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; 8th October 2010 at 23:07.
StainlessS is offline   Reply With Quote
Old 8th October 2010, 23:29   #3  |  Link
MattW
Registered User
 
Join Date: Jun 2007
Posts: 5
Quote:
Originally Posted by StainlessS View Post
Dont know what it is but, I would hesitate, to call it moire.

Sample clip would very definitely help those that can help U.
StainlessS,

In response to you reinforcing what I suspected, I have included a hyperlink to a 15-second excerpt of the footage (DV-AVI format) in my original post.

Last edited by MattW; 8th October 2010 at 23:35.
MattW is offline   Reply With Quote
Old 8th October 2010, 23:45   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,146
Still downloading, but might I suggest a smaller sample.
54 MB for 15 seconds is a lot, perhaps compression might help.

I'm on mobile broadband, and right now, after 7 mins I'm
65% though the download, not to mention cost of such.
would not normally have to wait this long but not good
connection today.

If you dont have a AVI lossless codec, suggest HuffYUV.

EDIT: also, can scrub the 1.5 Mb/s audio, aint useful.
__________________
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; 9th October 2010 at 00:03.
StainlessS is offline   Reply With Quote
Old 9th October 2010, 01:46   #5  |  Link
MattW
Registered User
 
Join Date: Jun 2007
Posts: 5
Quote:
Originally Posted by StainlessS View Post
Still downloading, but might I suggest a smaller sample. perhaps compression might help. If you dont have a AVI lossless codec, suggest HuffYUV.
I indeed attempted to compress the video with HuffYUV 2.1.1 via VirtualDub 1.9.9 after your suggestion of providing a video excerpt. However, the resulting file (15 seconds) was in excess of 100 MB. A shorter excerpt (3 seconds) was 38.5 MB.

Last edited by MattW; 9th October 2010 at 01:50.
MattW is offline   Reply With Quote
Old 9th October 2010, 18:47   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,146
OK, perhaps HuffYUV was not a good choice, (was suffering from mild
alcohol poisoning last night). Loading original "Internal DV Decoder"
codec clip into VD, select "No Audio", "Direct Stream Copy", to
another file. Compressing as results: ZIP=39MB, RAR=37MB,
7ZIP=36MB, suggest about 5 seconds should be ample and result
about 12-13MB.

Had a look at BMP in paint, pattern seems to repeat every 8 lines.
Dont really know what I would do with this, If it were my problem.
This thread:
http://forum.doom9.org/showthread.php?t=121197 mentions something
called Vertical Cleaner, have just downloaded and will have a play with it.

EDIT: Yes absolutely correct, some kind of moire I think.
__________________
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; 10th October 2010 at 01:02.
StainlessS is offline   Reply With Quote
Old 9th October 2010, 19:49   #7  |  Link
2Bdecided
Registered User
 
Join Date: Dec 2002
Location: Yorkshire, UK
Posts: 1,673
If it came from a DVD, you just use DGindex to snip a portion of the original MPEG and upload that. Much smaller.

If it came from somewhere else, letting us know where and how might help with the restoration.

EDIT: 2-2-2-4 pulldown?!

The moire / aliasing is horrible. I wonder if fft3dfilt can lock onto the pattern in creates? NeatVideo can, but it leaves some strange things at the edges of objects.

It should be re-scanned from the film - preferably at higher resolution, and then downscaled appropriately, avoiding moire! I'm guessing this isn't an option. Shame - sounds like a great performance.

Cheers,
David.

Last edited by 2Bdecided; 9th October 2010 at 20:14.
2Bdecided is offline   Reply With Quote
Old 9th October 2010, 20:09   #8  |  Link
MattW
Registered User
 
Join Date: Jun 2007
Posts: 5
Quote:
Originally Posted by 2Bdecided View Post
If it came from a DVD, you just use DGindex to snip a portion of the original MPEG and upload that. Much smaller.
Thanks for the suggestion, David. Helping a novice (to say the least) is always appreciated. I excerpted a small segment (six seconds, 7.5 MB) with DGindex (download link). I have amended my original post to provide a link to the new excerpt. The segment is from excerpted from a DVD (Sam Cooke: Legend).

Last edited by MattW; 9th October 2010 at 20:11.
MattW is offline   Reply With Quote
Old 10th October 2010, 01:34   #9  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 4,629
One approach might be to use mp4guy's Destripe function on 90 degree rotated fields (the function was intended for vertical bands). Here is the original thread
http://forum.doom9.org/showthread.php?t=154863

It would be better to PM him and ask for his expert advice, but here is my hack attempt. There are still some residual "bands", so maybe you can play with the settings to improve it.

You might want to use other filters to denoise a little bit better and address the dirt & scratches (maybe use descratch() , removedirtmc() and/or related functions ) , maybe fix the flickering as well

These screenshots have been deinterlaced for display purposes, but the script leaves it interlaced (presumably for DVD)


video sample
http://www.mediafire.com/?ng56lqo5pl8t1jn


Original


Script



Code:
mpeg2source("Doom9 Excerpt (2nd Version).d2v")
assumetff()
separatefields
greyscale()
turnleft
DeStripe(3,0,100)
DeStripe(2,0,800)
DeStripe(1,1,800)
DeStripe(2,0,400)
DeStripe(1,1,400)
turnright
a=last

f1=a.SelectEven().MCTemporalDenoise(settings="medium",strength=200).LSFMod(strength=60)
f2=a.SelectOdd().MCTemporalDenoise(settings="medium",strength=200).LSFMod(strength=60)
Interleave(f1,f2) 
Weave()
SmoothLevels(18,1.1,235,0,255,chroma=100)



#thr is strength, rad is "how big are the (whatevers)" offset is "how far apart are they" rad goes from 1 to 5, offset from 1 to 4, thr from 1 to bignumber
function DeStripe(Clip C, int "rad", int "offset", int "thr")
{

	rad = Default(rad, 2)
	offset = Default(offset, 0)
	thr_ = Default(thr, 256)


	Blurred = Rad == 1 ? C.Mt_Convolution(Horizontal=" 1 1 1 ", vertical = " 1 ", u=1, v=1) : C
	Blurred = Rad == 2 ? offset == 0 ? C.Mt_Convolution(Horizontal=" 1 1 1 1 1 ", vertical = " 1 ", u=1, v=1) : C.Mt_Convolution(Horizontal=" 1 0 1 0 1 ", vertical = " 1 ", u=1, v=1) : Blurred
	Blurred = Rad == 3 ? offset == 0 ?  C.Mt_Convolution(Horizontal=" 1 1 1 1 1 1 1 ", vertical = " 1 ", u=1, v=1) : offset == 1 ?  C.Mt_Convolution(Horizontal=" 1 1 0 1 0 1 1 ", vertical = " 1 ", u=1, v=1) : C.Mt_Convolution(Horizontal=" 1 0 0 1 0 0 1 ", vertical = " 1 ", u=1, v=1) : Blurred
	Blurred = Rad == 4 ? offset == 0 ?  C.Mt_Convolution(Horizontal=" 1 1 1 1 1 1 1 1 1 ", vertical = " 1 ", u=1, v=1) :  offset == 1 ? C.Mt_Convolution(Horizontal=" 1 1 1 0 1 0 1 1 1 ", vertical = " 1 ", u=1, v=1) :  offset == 2 ? C.Mt_Convolution(Horizontal=" 1 1 0 0 1 0 0 1 1 ", vertical = " 1 ", u=1, v=1) : C.Mt_Convolution(Horizontal=" 1 0 0 0 1 0 0 0 1 ", vertical = " 1 ", u=1, v=1) : Blurred
	Blurred = Rad == 5 ? offset == 0 ?  C.Mt_Convolution(Horizontal=" 1 1 1 1 1 1 1 1 1 1 1 ", vertical = " 1 ", u=1, v=1) :  offset == 1 ?  C.Mt_Convolution(Horizontal=" 1 1 1 1 0 1 0 1 1 1 1 ", vertical = " 1 ", u=1, v=1) :  offset == 2 ?  C.Mt_Convolution(Horizontal=" 1 1 1 0 0 1 0 0 1 1 1 ", vertical = " 1 ", u=1, v=1) :  offset == 3 ?  C.Mt_Convolution(Horizontal=" 1 1 0 0 0 1 0 0 0 1 1 ", vertical = " 1 ", u=1, v=1) : C.Mt_Convolution(Horizontal=" 1 0 0 0 0 1 0 0 0 0 1 ", vertical = " 1 ", u=1, v=1) : Blurred
		Diff = Mt_Makediff(C, Blurred)

	THR=string(thr_)
	MedianDiff =  Rad == 1 ? MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 1 0 -1 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : Diff
	MedianDiff =  Rad == 2 ? offset == 0 ?  MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 1 0 -1 0 2 0 -2 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 2 0 -2 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : MedianDiff
	MedianDiff =  Rad == 3 ? offset == 0 ?  MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 1 0 -1 0 2 0 -2 0 3 0 -3 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : offset == 1 ? MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 2 0 -2 0 3 0 -3 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 3 0 -3 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : MedianDiff
	MedianDiff =  Rad == 4 ? offset == 0 ?  MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 1 0 -1 0 2 0 -2 0 3 0 -3 0 4 0 -4 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : offset == 1 ?  MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 2 0 -2 0 3 0 -3 0 4 0 -4 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : offset == 2 ?  MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 3 0 -3 0 4 0 -4 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 4 0 -4 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : MedianDiff
	MedianDiff =  Rad == 5 ? offset == 0 ?  MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 1 0 -1 0 2 0 -2 0 3 0 -3 0 4 0 -4 0 5 0 -5 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : offset == 1 ?  MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 2 0 -2 0 3 0 -3 0 4 0 -4 0 5 0 -5 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : offset == 2 ?  MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 3 0 -3 0 4 0 -4 0 5 0 -5 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : offset == 3 ?  MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 4 0 -4 0 5 0 -5 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : MT_Luts(Diff, Diff, mode="med", pixels = " 0 0 5 0 -5 0 " ,  expr = " X Y - X Y - X Y - abs 1 + * X Y - abs 1 + "+THR+" 1 >= "+THR+" 0.5 ^ "+THR+" ? + / - 128 +", u=1,v=1) : MedianDiff
		ReconstructedMedian = mt_makediff(Diff, MedianDiff)
			Mt_AddDiff(Blurred, ReconstructedMedian)

Return(Mergechroma(Last, C, 1))
}
poisondeathray is offline   Reply With Quote
Old 10th October 2010, 05:17   #10  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,146
Hi MattW,

Find below a rough & ready plugin, it lightens up the dark lines and darkens down the
light lines, far from brilliant and a bit basic but does improve a little. Perhaps it might
prove useful before using the DeStripe script. Anyway, cant do any harm to take
a gander. I only spend about an hour or two on it, so it is not anything special.

Name Test.dll

Test(range=6,lighten=true,darken=true)
#range 1 and above

Anyway, it does remove some of the lining without blurring but does not
seem to touch it in other places.

get here:
EDIT:- Link Removed.

Let me know when/if you download, I dont want to leave it for general consumption.

EDIT: Dont expect anything anywhere near as good as the DeStripe script.
__________________
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; 10th October 2010 at 19:11.
StainlessS is offline   Reply With Quote
Old 10th October 2010, 05:58   #11  |  Link
MattW
Registered User
 
Join Date: Jun 2007
Posts: 5
Quote:
Originally Posted by StainlessS View Post
Let me know when/if you download, I dont want to leave it for general consumption.
I have downloaded the plug-in and will test it tomorrow morning. Thanks!
MattW is offline   Reply With Quote
Old 10th October 2010, 15:13   #12  |  Link
The Scientist
Registered User
 
The Scientist's Avatar
 
Join Date: Nov 2006
Location: UK
Posts: 275
@poisondeathray
Wow, screenshot differences are very impressive.
The Scientist is offline   Reply With Quote
Old 10th October 2010, 19:17   #13  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,146
MattW,

Was in a hurry to get some shuteye last night, was still working on it about 5:00am.
Looking at it today, maybe not terribly good, does reduce lining in some places but
introduces some lining were there was none originally. I shall have a little more
play with this, am reluctant to just give up on it.
If I get anything better, Ill let you know.
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 10th October 2010, 20:19   #14  |  Link
Usedocne
lurkster
 
Join Date: Jul 2009
Location: D9|D10
Posts: 123
@poisondeathray

David Copperfield just called, said something about a magic wand going missing?
Usedocne is offline   Reply With Quote
Old 11th October 2010, 14:20   #15  |  Link
Floatingshed
Registered User
 
Join Date: Nov 2008
Posts: 314
Isn't this simply a single field kinescope? If so it is not an interference pattern of any kind it is the 240 lines that make up the original picture. It is most certainly not Moire.
Floatingshed is offline   Reply With Quote
Old 11th October 2010, 14:48   #16  |  Link
2Bdecided
Registered User
 
Join Date: Dec 2002
Location: Yorkshire, UK
Posts: 1,673
Quote:
Originally Posted by Floatingshed View Post
Isn't this simply a single field kinescope? If so it is not an interference pattern of any kind it is the 240 lines that make up the original picture. It is most certainly not Moire.
I think it is a single field kinescope (we call them drop-field telerecordings over here!) - but if you look at it (especially the video) I think the result does have what I'd call moire - i.e. the 240-lines on film "beat" with the 480-lines on the DVD in a way which creates some artefacts at a new frequency. Those bands aren't 240-lines - more like 1/4 that. MPEG encoding doesn't help either.

poisondeathray's result does look like magic - Corel Photopaint's Remove Moire filter does something similar (if you downscale vertically 4x first!). Sadly not much detail left!

Cheers,
David.
2Bdecided is offline   Reply With Quote
Old 19th October 2010, 06:51   #17  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,350
I really can't do much better then what poisondeathray already achieved, if any better at all. poisondeathray already put to good use the best solution I can currently think of for this class of problems. It is possible to get more complete removal with fewer obvious artifacts, but blurring goes way up, which I doubt is acceptable. Usually I wouldn't contribute to a thread with such an unhelpful reply, but I was asked and I don't want to leave the impression that there is any better solution that I am aware of.

If anyone is wondering why the results here are not directly comparable to the other thread; it is because the artifacts are far far larger, and of much greater magnitude. To such an extent that I am surprised some of the tricks used in the DeStripe function continue to work at all.
*.mp4 guy is offline   Reply With Quote
Old 19th October 2010, 10:52   #18  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,044
defreq () or any similar tool that works in frequency not spatial domain.
pandy 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 19:38.


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