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

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th June 2011, 08:38   #1  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,545
Fixing Horizontal VHS Tracking Noise

Source: http://www.megaupload.com/?d=U9WSKQQL

Processed clip: http://www.megaupload.com/?d=SYX3MMQL

Mask: http://img10.imageshack.us/img10/175/inpaintmask5.png

Code:
SetMemoryMax(700)
v1=avisource("batsource.avi").converttorgb24()
#v2=converttorgb24(v1).crop(0,0,0,-13).addborders(0,0,0,2,$008000)
#v3=converttorgb24(v1).crop(0,470,0,0).addborders(0,1,0,0,$008000)
#v4=Stackvertical(v2,v3)
v5=imagesource("E:\inpaintmask5.png",start=0,end=0,pixel_type="RGB24")
greycinpaint(v1,v5,init=4,iter=10,threads=1)
converttoyv12()
I'm trying my best to eliminate the constant tracking noise at the bottom of the clip. The best solution I could find so far is using greycinpaint. Unfortunately, it's really really slow. I'm wondering if they're are faster solutions or perhaps even ones that are more ideally suited for this problem.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.
Revgen is offline   Reply With Quote
Old 13th June 2011, 11:38   #2  |  Link
2Bdecided
Registered User
 
Join Date: Dec 2002
Location: UK
Posts: 1,673
You are lucky to have such a small problem area, with stable video above and below.

When I've tried this with my videos, where the bottom 9 lines are basically junk, the inpainting was sometimes wrong, and often temporally unstable. This was really distracting. So I just blacked those lines out. Which is at least faster

Is that inpainting algorithm faster if you don't feed it the whole frame?

Cheers,
David.
2Bdecided is offline   Reply With Quote
Old 13th June 2011, 13:33   #3  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
Crop all sides (for PC) or black them (for tape/DVD). This area is a spare one and should not contain any information. It is also not shown on TVs because of overscan.
__________________
Born in the USB (not USA)
Ghitulescu is offline   Reply With Quote
Old 13th June 2011, 15:28   #4  |  Link
2Bdecided
Registered User
 
Join Date: Dec 2002
Location: UK
Posts: 1,673
It's not shown on TVs (even modern ones) if you feed an SD signal.

But if you were to feed it from a PC, or upscaled via HDMI etc, then it would be visible on many modern TVs.


It won't contain captions etc, but it obviously contains valid picture information, trashed by the VHS head switching.

Cheers,
David.
2Bdecided is offline   Reply With Quote
Old 13th June 2011, 15:34   #5  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
Quote:
Originally Posted by 2Bdecided View Post
... it obviously contains valid picture information, trashed by the VHS head switching.
AFAIK these lines contain some duplicated info, and since it's not shown anyway, it shouldn't harm to remove the whole overscan. When the VHS was invented no HDMI, no PCs and no flatscreen TVs existed. My Pio doesn't show any underscan irrespective of the source, if it was once analog. Also PIP shows the overscanned image.
__________________
Born in the USB (not USA)
Ghitulescu is offline   Reply With Quote
Old 13th June 2011, 17:23   #6  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,545
@2Bdecided Yep, the area is only 3 pixels high, with usable information above and below, so the inpainting works pretty well. It's not faster if I crop it. The only way to make it faster is to use SetMTMode or reduce the "iter=x" parameter. It's still very slow regardless of what I do, I'll probably just have to accept that. I use an HTPC so removing it is necessary.

@Ghitulescu Cropping isn't the answer for me. I want to see as much of the picture as possible.

Thanks for the ideas, but it looks like this is the ideal solution for me so far.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.

Last edited by Revgen; 13th June 2011 at 17:26.
Revgen is offline   Reply With Quote
Old 13th June 2011, 17:51   #7  |  Link
2Bdecided
Registered User
 
Join Date: Dec 2002
Location: UK
Posts: 1,673
Quote:
Originally Posted by Revgen View Post
It's not faster if I crop it.
Unless that's a typo, it's really weird if crop and inpainting are the same speed. Maybe there's a huge speedbump elsewhere?!

Cheers,
David.
2Bdecided is offline   Reply With Quote
Old 13th June 2011, 17:51   #8  |  Link
2Bdecided
Registered User
 
Join Date: Dec 2002
Location: UK
Posts: 1,673
Quote:
Originally Posted by Ghitulescu View Post
AFAIK these lines contain some duplicated info
No, they don't.
2Bdecided is offline   Reply With Quote
Old 13th June 2011, 18:07   #9  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
Quote:
Originally Posted by Revgen View Post
@Ghitulescu Cropping isn't the answer for me. I want to see as much of the picture as possible.
I cannot see the clip on my linux, but if it originated from a commercial source (and their team did its job) you won't loose anything from the picture. Cropping the overscan (or at least the "defective" part) it will render the image as seen on TVs and control monitors (set on overscan ), as the director wanted it.
__________________
Born in the USB (not USA)
Ghitulescu is offline   Reply With Quote
Old 13th June 2011, 18:38   #10  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,545
Quote:
Originally Posted by 2Bdecided View Post
Unless that's a typo, it's really weird if crop and inpainting are the same speed. Maybe there's a huge speedbump elsewhere?!

Cheers,
David.
I misunderstood what you said.

Yes, cropping is faster than inpainting.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.
Revgen is offline   Reply With Quote
Old 13th June 2011, 18:40   #11  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,545
Quote:
Originally Posted by Ghitulescu View Post
I cannot see the clip on my linux, but if it originated from a commercial source (and their team did its job) you won't loose anything from the picture. Cropping the overscan (or at least the "defective" part) it will render the image as seen on TVs and control monitors (set on overscan ), as the director wanted it.
The director made this film in 1926. I very much doubt he thought it would be shown on TV.

If you're using linux, you should be able to play the source with Mplayer.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.

Last edited by Revgen; 13th June 2011 at 19:23.
Revgen is offline   Reply With Quote
Old 13th June 2011, 20:23   #12  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
Since I'm a fan of silent movies, I can tell that there are more silents on DVD than on VHS. Instead of spending hours on converting an inferior format, why not spend some/few $ for the DVD version? Of course I might be wrong and your movie never appeared on DVD or in your region. And there are fan communities ready to swear that VHS versions have more seconds than the DVD one.

Concerning the picture "visibility", I'm not sure that you know you can't see the original frame even in a cinema the 35mm frame is matted to hide the imperfections at the margins, and to adjust the DAR to match the director's intent (a fullframe projection might reveal props, lousy microphones etc).
__________________
Born in the USB (not USA)
Ghitulescu is offline   Reply With Quote
Old 14th June 2011, 00:38   #13  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,545
Quote:
Originally Posted by Ghitulescu View Post
Since I'm a fan of silent movies, I can tell that there are more silents on DVD than on VHS. Instead of spending hours on converting an inferior format, why not spend some/few $ for the DVD version? Of course I might be wrong and your movie never appeared on DVD or in your region. And there are fan communities ready to swear that VHS versions have more seconds than the DVD one.

Concerning the picture "visibility", I'm not sure that you know you can't see the original frame even in a cinema the 35mm frame is matted to hide the imperfections at the margins, and to adjust the DAR to match the director's intent (a fullframe projection might reveal props, lousy microphones etc).
The silent movie in question is from a DVD. The master is a VHS. I didn't make it, but it came to me this way.

At this point it seems to me that you're making assumptions about the video. A video that you claim you haven't even watched. If I cropped the picture as you have suggested, than I'd be cropping out part of the clock at the 8 second mark. That would not look aesthetically pleasing to my eye.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.
Revgen is offline   Reply With Quote
Old 14th June 2011, 16:55   #14  |  Link
2Bdecided
Registered User
 
Join Date: Dec 2002
Location: UK
Posts: 1,673
There's the maximum area that can be exposed on the film without revealing the sprocket wholes, the "correct" area, the camera gate, the projector gate, the scan area on the telecine, and the area that gets through VHS unscathed.

At each stage, the picture area is reduced. If care if not taken to maximise what's preserved at each stage, you can end up with far less picture than the director originally intended!

Many vintage films are/have been telecine'd with a reduced area, visibly cropping important details, or even captions, when displayed on a TV with normal overscan.

Many older telecines seem to default to academy, cropping it to 1.33 (from 1.37), and zooming in quite a bit to hide any edge defects. Putting a silent film through this process without re-adjusting will lose even more of the original image (since the full silent film frame is larger than the academy frame).

EDIT: a picture is worth all those words...
http://www.widescreenmuseum.com/widescreen/filmdims.htm

Cheers,
David.
2Bdecided is offline   Reply With Quote
Old 14th June 2011, 19:32   #15  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
Quote:
Originally Posted by 2Bdecided View Post
There's the maximum area that can be exposed on the film without revealing the sprocket wholes, the "correct" area, the camera gate, the projector gate, the scan area on the telecine, and the area that gets through VHS unscathed.

At each stage, the picture area is reduced. If care if not taken to maximise what's preserved at each stage, you can end up with far less picture than the director originally intended!

Many vintage films are/have been telecine'd with a reduced area, visibly cropping important details, or even captions, when displayed on a TV with normal overscan.

Many older telecines seem to default to academy, cropping it to 1.33 (from 1.37), and zooming in quite a bit to hide any edge defects. Putting a silent film through this process without re-adjusting will lose even more of the original image (since the full silent film frame is larger than the academy frame).
As usual, you're almost all the time correct. However, all these are beyond my reach as a consumer, so I have to trust the transfer operator that s/he handles the film material in a correct manner.

Quote:
Originally Posted by Revgen View Post
The silent movie in question is from a DVD. The master is a VHS. I didn't make it, but it came to me this way.

At this point it seems to me that you're making assumptions about the video. A video that you claim you haven't even watched. If I cropped the picture as you have suggested, than I'd be cropping out part of the clock at the 8 second mark. That would not look aesthetically pleasing to my eye.
My PC runs linux and fails to have most codecs, due to licences and HDD space (server HDDs of affordable price are quite small in size ).

There is only one DVD that had a VHS master AFAIK, it's a series of documentaries concerning the WWI and WWII. There are also exploitation movies those only surviving master was a Umatic master tape, and of course the adult ones that have been filmed in VHS (or for this matter in S-VHS) originally. If one could telecine a film for VHS then the celluloid/nitrate (or safe copy thereof) is available, as the current code of practice requires that the transfer be made from a copy and not from the original itself.

Anyway the public archive contains a 16mm copy thereof encoded as MPEG-4 in case you may want it. http://www.archive.org/details/TheBat1926
__________________
Born in the USB (not USA)
Ghitulescu is offline   Reply With Quote
Old 15th June 2011, 00:23   #16  |  Link
Filker
Registered User
 
Join Date: Dec 2008
Posts: 39
Maybe it's faster to crop the frame into two images from the middle of the noise line use a border softner like bordercontrol:
http://www.geocities.com/siwalters_uk/bdrcntrl.html
and stack the top and bottom back again.

greycinpaint is slow as hell, maybe a logo remover will be faster with similar sophistication level.
Filker is offline   Reply With Quote
Old 15th June 2011, 07:48   #17  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
Quote:
Originally Posted by Ghitulescu View Post
There is only one DVD that had a VHS master AFAIK...
I must be misunderstanding this because I personally know of hundreds of retail DVDs made from VHS sources.
manono is offline   Reply With Quote
Old 15th June 2011, 16:56   #18  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,545
Quote:
Originally Posted by Filker View Post
Maybe it's faster to crop the frame into two images from the middle of the noise line use a border softner like bordercontrol:
http://www.geocities.com/siwalters_uk/bdrcntrl.html
and stack the top and bottom back again.

greycinpaint is slow as hell, maybe a logo remover will be faster with similar sophistication level.
Thanks for the bordercontrol suggestion. It's definitely faster than greycinpaint, but unfortunately this is a classic case of "getting what you pay for".

I don't mind paying the cost somewhat, say 3-4fps. Unfortunately, greycinpaint is so slow it goes at 0.40fps even with MT turned on.

I'll try some delogo scripts and see if they work better.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.
Revgen is offline   Reply With Quote
Old 16th June 2011, 01:59   #19  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
This does a fairly reasonable job:

Code:
Import("D:\avs\SCRIPT\S_ExLogo.avs")
Avisource("D:\avs\avi\batsource.avi")
ConvertToYUY2()	# For S_ExLogo()

S_ExLogo(0,466,-0,4,LOGOMODE=2)        # '-0' = Full width as in crop

#EDIT: S_ExLogo(0,467,-0,3,LOGOMODE=2)	# Probably better

return last
I did not spend more than 60 seconds setting it up,
but it looks ok. Might need to play with the vertical dimensions,
if crud is wondering about.
Should easily play in real time.

See here for the thread:-

http://forum.doom9.org/showthread.ph...light=s_exlogo

EDIT: Additional args to play with
LOGOMODE=0 # Initial logo position setup (2=normal use)
Amount=252 (default), # 256=fully opaque, reduce to show some of the damage
BLURMODE=4 (default Blur(1.0)), # =0 OFF, =5 Maximum .

Minimum height possible = 2
__________________
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; 16th June 2011 at 19:05. Reason: Additional
StainlessS is offline   Reply With Quote
Old 25th June 2011, 17:13   #20  |  Link
Gerry62
TV Guy
 
Join Date: Jun 2011
Posts: 46
Wow, Its pretty Clean compared to the rubbish prints I get to work on!

When did you convert it to 19.8fps? Id do all that After any cleaning work, more chance to clean more junk out.

What I'm more interested in, is how you will Clean the image, Got any scripts in mind?

Just to get the creative juices going, Here's a '10 second' clean I just did of the said clip, Remember I'm only new to scripting!

http://www.megaupload.com/?d=J1S5L9FN

Ive used one of the stock standard de-logo VDUB ones here.


I also believe in the 'theroy' that If a source is released on any format then it's utterly pointless to spent many hours trying to polish a turd, If it's 'out there' then it seems a waste to work on it. Not trying to be negative, but Ive many thousands of audio restorations under my belt, and when the customer hands you some crappy '101 strings' album that looks as if someone has eaten thier dinner from it, it's always handy to have a massive collection of 'good' copies. I mean, 2$ from Ebay, or 2 hours cleanig every click by hand... I know what I'd rather do!
Then again, you can't do that with Acetates and one shot 16inch TS discs

Last edited by Gerry62; 25th June 2011 at 19:23. Reason: Added clip
Gerry62 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 20:32.


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