Identifying artifacts, fixed with video filters?
3 Attachment(s)
I recently began capturing VHS again, which has been an on-again/off-again project for the past couple of years. I think my hardware and software chains are alright, following the guides here. But when it comes to processing I'm at a bit of a loss. To begin with I'm having some difficulty with the terminology. I've attached some excerpts from my most recent cap with the artifacts in question.
In the first video, what are the alternating vertical rainbow bands just right of center? It isn't called 'rainbowing' afaik but as a result I don't really know what to do with it, or if anything can be done. In the second video, is this - the white streaks rolling down - what is popularly referred to as 'dropout noise'? In an earlier thread lordsmurf mentioned a 'complex temporal capture chain' that can deal with this, and I think I saw someone mention a kind of 'averaging method' that potentially could - but the artifacts featured in the before/after screenshot there didn't look precisely like the ones I'm talking about. Note that these are capped from a frighteningly moldy tape which I subsequently cleaned up following this guide. (Most of which is OK - these parts were from the beginning and end of the tape. The tape was also stored improperly - wasn't entirely spooled on either side - and the section where it was stopped at is also pretty dubious. The selections here were chosen to avoid personally identifying anybody.) Many of the tapes I'll have to deal with immediately are in similarly bad shape, and if errant sections like this are not salvageable, we'll be OK, even if it isn't ideal. But I'd like to know for sure that there is nothing to be done (my suspicion) before writing it off. Separately: I've noticed the recommended method here to deal with head-switching noise is cropping and adding borders. But in case one can crop without modifying the aspect ratio (iow as long was one crops 3 vertical for every 2 horizontal lines) and crops are also done at mod 4, what is lost by then resizing back to (in case of NTSC VHS) 720x480? I guess a resize would soften things a bit but is this really so appreciable? I guess I'll do some tests to find out but it would be nice to have input from the gurus here :) |
try this for your rainbow for a starter
Code:
AVISource("rainbow_no-audio_shortened.avi") |
4 Attachment(s)
Well, some things you can fix, some you can't. We've all had our share.
Quote:
3:2 is the pixel aspect ratio for square-pixel 720x480 NTSC, but not for encoded anamorphic, which is 12:11 encoded pixel aspect ratio for 4:3 NTSC. I don't know why people have to fill frames with small borders. At 4:3 on a wide panel the borders blend in with black anyway. Resizing doesn't seem to be worth it to me, but make up your own mind whether further degradation of something that already looks like garbage matters to you. I note that people don't worry about borders when movies on cable TV or DVD/BluRay don't fill the screen entirely. The flicker in your rainbow sample (it's not rainbows) is from gross oversaturation of the V channel, with mistracking making it worse. Red exceeds RGB 255, so it looks discolored and even worse when played back in RGB used by all playback devices. The fade-in from black (actually, it's from dark gray at about RGB 28, not black) looks weird with block noise and hard gradients, likely due to using those NLE transition effects with interlaced material when it should have been progressive (that image is a resized color photo, isn't it?) then later would be encoded as interlaced if necessary. Some NLE's do a cleaner job than others with that sort of thing. It's a very soft image to begin with, tough to work with. Rips and dropouts aren't the only problem. Besides invalid chroma levels there's also vertical jitter (frame hops). Denoisers and anti-dropout filters really hate that sort of thing and don't perform at their best. I assume you've repacked the tape several times to even up feed reel windings for smoother motion into the tape path. You gave no info on your playback capture chain, so can't advise about that. The rip cleaner I used in the scripts below is from several forums, including this one. The modded version I used is for video that's either deinterlaced or uses SeparateFields(). In both cases I deinterlaced, then re-interlaced later. The text of the anti-rip median filter is attached to this post in its progressive version as FixRipsP.avs. You can paste it into the bottom of a script or save it as an .avs file and import it with Avisynth Import() function (http://avisynth.nl/index.php/Import). The version for interlaced material is attached as FixRipA.avs. Which one to use depends on the video. The progressive version tends to remove too much detail during interlaced motion. For either version you'll need extra plugins (masktool2, mvTools2, RGtools (the updated version of RemoveGrain), and DePan. If you have the QTGMC deinterlacing package you probably have many of these. The cleanup I did on "rainbow_no-audio_shortened.avi" took some experimentation to come up with the right sequence and settings for the filters. I used the 16-bit dither package and GradFun3 to try to clean up some of those fade-up bad gradients. The dither package requires its own plugin versions which I loaded from a separate plugins folders in Avisynth. In the scripts posted here you have to modify path statements to match locations in your system. You could probably load the rainbow clip results into VirtualDub to fix up the amount of red you want, but be careful about saturation levels. Use a tool like ColorMill and the ColorTools 1.4 histogram to check red channel levels. If you oversaturate again the flicker will come back to haunt you. Code:
Import("D:\Avisynth 2.5\plugins\FixRipsP.avs") Code:
LoadCPlugin("D:\Avisynth 2.5\plugins\yadif.dll") |
1 Attachment(s)
Quote:
Quote:
Quote:
And yeah, I know that we're dealing with anamorphic encoding here. Regardless I thought that maintaining the pixel aspect ratio when cropping would be important if one is going to then resize back up to another resolution in that aspect ratio, in order to avoid subtly distorting the result. In any case, it was a minor point - like you said, it's not terribly noticeable, so we'll see. Thanks also for setting me straight re mod/4, which according to the chart appears to only be necessary for interlaced YV12: Attachment 7626 Anyway... Quote:
Quote:
Quote:
Quote:
Quote:
Code:
ChromaShift(C=-2,L=-4) Code:
SeparateFields().SelectEvery(4,0,3).Weave() Quote:
Code:
LoadCPlugin("D:\Avisynth 2.5\plugins\yadif.dll") Code:
SeparateFields() Code:
ChromaShift(C=-2) Code:
MergeChroma(aWarpSharp2(depth=30)) Code:
Crop(12,0,0,-10) Other than all of that: can you confirm what the terminology is to describe these things? Is the first example just 'flicker'? (I always thought that this referred to a sort of strobing light effect?) Is the second example a tracking error or a dropout? What causes the 'rips' that the attached scripts fix? Are they always called 'rips'? Quote:
Thanks for your detailed response, much appreciated! |
Quote:
Quote:
Videophiles and pros would preserve the original core image content as much as possible, for both archival and geometric reasons. Users differ. Adding black pixels is less trouble and angst than resizing, IMHO. But they're your videos. Quote:
Quote:
Quote:
Quote:
I don't know whose histogram you're using, but in the original avi, G and B peaked about RGB 200 and red just barely hit RGB 255 at the end. That's not the same thing as red stampeding up the right=hand wall in the original. Code: Quote:
When you view the output of an avisynth script in Virtualdub you can add VDub filters to the output at the same time. But remember that when doing so you should use ConvertToRGB32(interlaced=true or false) from YV12 video. I didn't use any VDub filters. The output from the scripts was saved with Lagarith as YV12. Quote:
Quote:
Quote:
Quote:
SeparateFields() works OK for horizontal chroma shift, not OK for up or down. You might also notice that the FixRipsP routine doesn't want interlaced fields. The FixRipsA version for interlaced video uses SeparateFields() internally. Quote:
Quote:
Quote:
|
Are the rainbows only in the first several seconds at the start of a recording? https://www.repairfaq.org/REPAIR/F_vcrfaq6.html
I believe the "garbage" on the left border is being added by the TBC. |
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Ultimately you're doing trial and error and going through frame-by-frame to figure out the right values to shift by, right? Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
Uh-oh, lots of questions and another long one. Sorry for the delay. Answering your posts, in no particular order:
Quote:
There can be problems with applying transition effects like dissolves and fades using interlaced sources. The effect if applied with interlaced video applies the same fade or dissolve to both fields at the same time. When the video is deinterlaced or inverse telecined, the same effect is now duplicated on multiple frames instead of just one, so it can look a little weird and seldom goes back together in the same way when reassembled. Many people process images for slide shows in different ways, usually as progressive double-rate source, then interlace later. That's for picky people unless they don't expect to reprocess the results later. Animation goes through all sorts of convolutions: created at 15fps progressive then adding duplicate frames to get 25 or 30fps. Some are 23.976fps originals with pulldown for various playback formats. And you find all sorts of sloppy conversions that are impossible to repair. Quote:
Quote:
Some videos are nightmares when it comes to this. Referring to re-capture, I have a long-term project of a godawful and aging early 1990's tv broadcast of a movie that's not in a decent print anywhere. I made 6 full captures and several partials using two different players. The originals are on an external drive. I'm still today pulling segments from different captures, with different filters and settings are needed for each segment. This takes forever. Good thing most of my old tapes weren't that bad, but many were. Quote:
BTW, I'll be crossing that bridge for real in about a month. :) Quote:
Quote:
Quote:
Below are links to previously short MP4 videos from two uncut lossless captures, with a link to the finished version. Capture 1: VCR = Panasonic AG-1980, AVT-8710 tbc. Capture 2: VCR = Panasonic PV-S4670, Panasonic ES10 line tbc pass-thru, AVT-8710 tbc. Both capped with an ATI All in Wonder 9600XT with VirtualDub. The original tapes were recorded off bad cable Tv signals at slow and at noisy EP 6-hour speed in 1991 on a very cheap 2-head RCA VCR. Lots of chroma noise, comets, fuzz, smeared chroma on edges, weird borders. from capture 1: http://www.digitalfaq.com/forum/atta...living10_b1mp4 from capture 2, the very end deleted (all bad frames): http://www.digitalfaq.com/forum/atta...iving11_b1amp4 final version, denoised, color corrected. Still a few blips in the starting frames. http://www.digitalfaq.com/forum/atta...p_mva-finalmp4 The Avisynth script to combine the frames is in this post: http://www.digitalfaq.com/forum/vide...html#post47174 There are also lots of nightmare problem examples in that thread and some hot debate. You can learn a ton by browsing old threads, as most of us do. And the final has borders. I pan to rework some of this. Plug in the coffee maker. Quote:
Quote:
An old posted example from my previous life for using Csamp to read pixel values and curves to adjust color is here: http://www.digitalfaq.com/forum/vide...html#post38384 Tutorials for using a curves filter are at the download site (http://members.chello.at/nagiller/vdub/index.html) and in many free internet tutorials for using Photoshop Pro (example: http://www.cambridgeincolour.com/tut...hop-curves.htm). A thread with many examples of using histograms and other tools, in which you'll find a post about ColorMill and curves, and several other posts in the same thread: http://www.digitalfaq.com/forum/vide...html#post42315. Donald's Graft's HSI filter is pretty much self-explanatory by looking at it. Be carefiul, as very slight adjustment can often have strong effects. Avisynth has several color and level adjustment filters, you'll spend a week fooling with them. ColorYUV, Levels, Tweak, RGBAdjust. They're more difficult to use, but they're essential. Working with Virtualdub in RGB is great for tweaking color problems that you find in YUV, which should usually be corrected first before moving to RGB. Avisynth's Histogram function has many options for analysis in YUV. |
What changes have you made from lordsmurf's filter for FixRips?
|
2 Attachment(s)
I changed the opening lines of the script to accept a clip that is either interlaced or non-interlaced. The "A" or interlaced version accepts an interlaced clip and uses "SeparateFields() and Weave() internally to work with interlaced material. The "P" or progressive version accepts a non-interlaced clip which has been either deinterlaced with a deinterlacer (QTGMC, yadif, etc.) or non-interlaced by using SeparateFields() before calling the .avs "P" function. Thus, the "P" version simply eliminated SeparateFields() and Weave() from the code of the original version.
You have the original, which was posted by lordsmurf as "studio1b.avs" in this post: http://www.digitalfaq.com/forum/vide...html#post45915. Earlier in this current thread I posted an "A" mod for interlaced video in post #2, and a "P" mod for non-interlaced video in the same post. But I found some typos in both scripts, so I'm attaching two revisions below. The revisions work a little better, the old ones might have problems with some videos. The new versions are "FixRipsA2.avs" and FixRipsP2.avs, attached. You can call FixRipsP2 and send it a progressive video in this manner: Code:
Import("path/to/Avisynth/plugins/FixRipsP2.avs") Code:
Import("path/to/Avisynth/plugins/FixRipsP2.avs") Code:
Import("path/to/Avisynth/plugins/FixRipsA2.avs") To use lordsmurf's original posted script you must be working with non-progressive video and copy the entire original script as part of your code, either as a complete script in itself or placed in a suitably logical part of your code. The original versions from lordsmurf and other sources have an opening section along with three internal functions (MinBlur, Median2, and TMedian2), which must be included somewhere in your script. In FixRipsA2.avs and FixRipsP2.avs the three internal functions are an integral part of the .avs scripts, so they don't have to be copied again in your code. If you browse the A2 and P2 versions you'll see that the first several opening lines are different in each version. |
Quote:
|
Hello ! Thank you for those wonderful scripts ! I've tested P2 on some footage and it did magic, but sometimes on fast moving objects we can see some artefacts (like motion artefacts). Do you know why ?
I've also noticed that the denoise also destroy some pictures like for example if you have birdes which are only few pixels, they can disappear. As the script seems very complicated do you know if it is possible to adjust some parameters to reduce artefacts (fast moving objects) ? Thank you for your help ! |
Quote:
Short version: You can't have everything. I've often had to make two versions of really godawful video, one processed with an industrial-strength pile driver of a cleaner and another with a less destructive filter that's easier on less-damaged areas, or even some frame by frame spot patching over several frames or frame groups. Then I'd take the best of each version and combine them using something like RemapFrames (http://avisynth.nl/index.php?title=R...es&redirect=no). Does this take a long time and some nail-biting? Yes. Sometimes you take your losses or live with the originals. And some things just can't be fixed. |
Hell sanlyn, I totally agree with you about replacing some frames with frames from a "less filtered version". The thing is that the script is soooo complicated to me that I don't understand how to create a simple/light/non-destructive version for parts where the interpolation filter creates bad frames :(.
|
Usually one would require 3 separate scripts, rather than go bananas trying to do everything in one swoop. Script #1 processes and saves version 1, script #2 processes and saves version 2. Then script #3 opens version 1 and version 2 and combines sections or even individual frames from each, and creates and saves version 3.
Some time go I had different captures from the same damaged tape. Each time the bad tape played, a different video head would pick up a different clean interlaced field among all the damaged frames and fields. About 8 seconds of video required multiple scripts and intermediate files. The video was a telecined movie, but inverse telecine removed some good frames and fields and kept some bad ones. So I had to keep all the fields, good and bad, because some fields were good in one capture but bad in the other. Then I had to clean/filter each capture and create an Excel spreadsheet that listed the images from each file in two columns. Each Excel column showed an X for a bad image and a number for good ones. Add to that, the filtered captures had a different number of frames because some frames in one capture or another would be dropped or duplicated. Then I wrote a script to select the good fields from each capture and combine them into a third result that included all the frames for the entire movie sequence, both good and bad. Only the best of two sets of images were selected and overlaid onto the third incoming file, to crete a new output file of only-good images. The last step was to open a capture that contained all the original audio for the full 8-plus seconds and overlay that sound track onto the finished file. |
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.