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. |
29th March 2015, 17:27 | #1 | Link | |
Registered User
Join Date: Feb 2015
Posts: 31
|
VHS video?
Hi guys,
I'm using the basic VHS script of John Meyer and the ConditionalDenoise script of Kevin Atkinson aiming clean the image of my VHS videos. However, even using these scripts the video still shows many errors. Specially the horizontal waves (lines [white lines]). I'm posting the video and the script that I'm using below. Please, I really appreciate your comments and ideas about how to solve this problem. Thank you very much! Watch the video (without any script) here: http://www.mediafire.com/watch/k7xyd...6buc/test2.m2v SCRIPT Quote:
|
|
29th March 2015, 17:39 | #2 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
I think that looks like physical tape damage, ie crumpled or creased VHS tape.
EDIT: I could well be wrong. Sorry, no solutions.
__________________
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; 20th August 2017 at 01:15. |
29th March 2015, 19:49 | #3 | Link | |
Registered User
Join Date: Feb 2015
Posts: 31
|
Quote:
Hi StainlessS, I already checked this VHS tape with a videotape technician. He said that it doesn't have any problem. The video was recorded in EP (extended play) mode. And it was recorded almost 20 years ago. |
|
29th March 2015, 22:36 | #4 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
I think you need to re-think a few things about your capture workflow before you start modifying your AVISynth scripts.
First, you have captured 4:3 video into a 16:9 container. That is the wrong thing to do, and it will result in your video being stretched. Depending on your capture chain, it may also degrade the resolution, although that is difficult to know for sure without examining every step of the capture. Second, if your capture card permits capturing to something other than MPEG-2, I would recommend using a lossless codec for capture, or at least use one that doesn't involve interframe compression. Put another way, I would recommend using a codec that compresses each frame on its own without needing any information from adjacent frames. MJPEG and DV are two that do lossy compression, but don't use adjacent frames, and MagicYUV, HuffYUV, and Lagarith are three which do lossless compression. The reason for my recommendation of not using MPEG-2 is that real-time compression using a codec which uses GOP compression tends to emphasize noise. The horizontal blurry lines you are seeing look like the result of the tape getting hot, possibly at the time it was taken. It was obviously reasonably warm when this video was taken. If you still have the tape, and can do a few tests, I would recommend queing up to this section, and then try manually adjusting the tracking control. While tracking errors usually show up as a series of floating noise bars, a slight tracking misalignment can result in those "wrinkled" and "warped" horzontal bars that you have in your video. Your capture doesn't seem to have any obvious time base issues, and otherwise looks pretty good, although it does look like some smoothing was done. Is this the raw capture, or have you already done some processing? Also, on your capture deck, did you enable the "edit" mode? This is either a front-panel switch or a menu item on your VCR. It is extremely important to set this switch or menu item correctly because otherwise the deck will process the video in order to reduce noise and other artifacts. This results in very soft video. You want to capture the tape with every bit of information from that tape, and then use the power of AVISynth to filter noise. The hardware filtering available in the analog days of the 1980s and 1990s was extremely crude and very destructive to detail. |
31st March 2015, 22:08 | #6 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
__________________
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 ??? |
31st March 2015, 23:36 | #8 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Loading old style C plugins.
EDIT: Looks like ConditionalDenoise might be related to ConditionalTemporalMedian http://avisynth.nl/index.php/External_filters#Denoisers which evolved into DeSpot (on same page).
__________________
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; 31st March 2015 at 23:43. |
1st April 2015, 01:29 | #9 | Link | |
Registered User
Join Date: Feb 2015
Posts: 31
|
Quote:
Hi John, This isn't the raw video. In this example I did the capture using a Philips 6 Head VCR (in compound video) and I passed through a DVD Record RH397H with all the filters ON. I also tried another capture using a Panasonic AG1980 VCR passing through a Svideo Record DVD Panasonic ES10 (in compound video) with all the filters ON. Afterwards I recorded it with a DVD LG RH397H. However the video got more white horizontal bars than the first try. Please, if it's possible, after reading your post new questions arise about it: What do you do to exam every step of the capture? How do you know that this example doesn't have any obvious time base issues? In your opinion. Is there one way to remove the horizontal bars from the video? Thank you very much John. I'm learning so many things with your posts. All your opinion and ideas are welcome. |
|
1st April 2015, 01:58 | #11 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
From CondTemporalMedian-0.93.zip here: http://www.kevina.org/temporal_median/
Code:
Conditional Temporal Median Filter http://kevin.atkinson.dhs.org/temporal_median/ Version 0.93 for AviSynth 2.5 September 27, 2003 Copyright (C) 2003 Kevin Atkinson (kevin.med@atkinson.dhs.org) under the GNU GPL version 2. This filter is designed to remove temporal noise in the form of small dots and streaks found in some videos. A common cause of this is dirty VHS heads but I have also seen small black or white streaks in broadcast material. The filter requires AVISynth 2.5, and My AviSynth C API Plugin version 0.14 or better. The required DLL "avisynth_c.dll" is included. The full version can be found at at http://kevin.atkinson.dhs.org/avisynth_c/. Two versions of my filter are provided a generic version CondTemporalMedian-gen.dll and an Integer SSE optimized version CondTemporalMedian-isse.dll. USAGE After the AviSynth C Plugin is loaded (by putting it in the Plugin directory or using LoadPlugin) the filter needs to be loaded using LoadCPlugin: LoadCPlugin("<path to >"). Basic Usage: ConditionalDenoise(clip, <parms>) OR ConditionalMedian(clip, <parms> The input MUST be YV12. ConditionalDenoise will attempt to identify noise and eliminate it while ConditionalMedian will simply apply a simple temporal median filter to the non-moving areas of the image. Parms for ConditionalDenoise are any of the following p1 (default 24) p2 (default 12) A pixel needs to be at different from its neighbors by at least 'P1' in order for it to be considered noise. The surrounding pixels must be different by at lease 'P2' in order for the pixel to be considered part of the same speck. pwidth (default 16) pheight (default 5) A speck can be no larger than PWIDTH x PHEIGHT Parms for both ConditionalDenoise and ConditionalMedian are: mthres (default 16) A pixel needs to be different from the previous frame by at least 'MTHRES' in order to be considered moving. This number should be larger than 'P2' in order to prevent noise from being identified by motion. mwidth (default 7) mheight (default 5) mp (default 11) These control the behavior of the the motion map denoising algorithm. interlaced (boolean) Whether to treat the video as interlaced or not. The default depends on id AviSynth thinks the video is Field based (ie interlaced) or Frame based. To instead show a motion map and noise that would of been eliminated use: ConditionalDenoiseMap(clip, <parms>, [show_chroma = false]) ConditionalMedian(clip, <parms>, [show_chroma = false]) The luma is changed as follows: 255 (White): Noise that will be removed 159: Noise that won't be remove because it might be motion 95: Motion map for the current image 63: Motion map for the next frame To just highlight the noise instead of removing it use ConditionalDenoiseMark(clip, <parms>, [mark_v = 255]) Where mark_v is the luma value to highlight the noise with TUNING THE PARMS In order for the filter to work right the various parameters MUST be set correctly. There is no good default values. The first parameter that needs to be set is interlaced, set it to true if your video is interlaced, false otherwise. Than pwidth and pheight need to be set. Set these to be slightly larger than the specks you want to eliminate. If your video is interlaced than height represents the height of an individual field. Thus, it will essentially be doubled. Than p1, p2, and mthres need to be set. In general, p1 > mthres > p2. If these are set too low than you may lose detail as small pixel variations might be mistaken as specks, thus losing detail, and more importantly, real specks might not be recognized as the size of the filter thinks the spec is might be larger than pwidth by pheight. ConditionalDenoiseMark, and ConditionalDenoiseMap might be helpful in setting these parameters. HOW IT WORKS The filter works as follows: 1) Find pixes that are different from its neighbors by at least P1. 1b) Enlarge outliers based on P2. 2) Determine the size of the specks and reject all those larger than PWIDTHxPHEIGHT 3) Find moving areas of an image by simply comparing each pixel to the previous frame and considering all those which are greater than MTHRES. 3b) Remove pixels determined as noise from the motion map. 4) Denoise the motion map by diffusing and then diluting. This is probably the most important step. 5) Only remove the specks in which there was no motion in the current or the next frame. The filter can also be configured to work as follows: 1) Find moving areas of an image by simply comparing each pixel to the previous frame and considering all those which are greater than MTHRES. 2) Denoise the motion map by diffusing and then diluting. This is probably the most important step. 3) Apply a simple temporal median filter on the non-moving areas of the image. NOTES It is integer SSE optimized using either GCC or Intel MMX/SSE builtins. Unfortunately Gcc versions before 3.3 does not use them very well. There for it is recommended that either GCC 3.3+ or Intel's compiler is used. Even GCC 3.0 and Intel's compiler do not generate optimal code when using MMX/SSE builtins, in particular GCC 3.3 interests a few unnecessary movq. Thus hand optimizing some of the code might be beneficial. COMPILING To compile this filter you will need to install Gcc and perhaps GNU Make. I used MinGw (2.0.0-3) with MSYS 1.09, Gcc 3.3.1. All of the required utilities can be found at http://www.mingw.org/download.shtml. Other configurations should work, but you may need to edit the Makefile. Once all the proper tools are installed and in the path, simply type: make from the MSYS shell and that is all that should be required. CHANGES Changed from 0.92 (Sep 27, 2003) Fix another nasty bug. Included non optimized version. Expanded the manual a bit Changes from 0.91 (Sep 10, 2003) Fixed nasty bug. In Despot, do not use the temporal blurring as it can prevent further usage of the plug. Despot (non-blur) only changes the frame where spots are detected, does not change other parts of frame. So long as temporal blurring not applied, then can do more than one DeSpot, with differing args for different spot sizes/colors etc. Temporal blurring will inhibit further detections. EDIT: Despot decides it is a spot if it only exists on a single frame, temporal blur, blurs entire frame and spreads spots over several frames and additional spots are therefore no longer detectable.
__________________
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; 2nd April 2015 at 12:17. |
1st April 2015, 04:26 | #12 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
Time base errors show up either as "flagging" at the top of the screen (horizontal bending of the top 10-15 scan lines, usually to the left), or as inconsistent starting point for each scan line which is easy to see when you look at vertical objects like fence posts (they will appear very ragged).
When capturing video, you want to turn off ALL filtering, and make sure you turn ON the edit switch. The edit switch makes sure that the VCR does not "enhance" the video in any way. The filtering that is done in VHS decks is designed to smooth out noise, but it kills detail. You will get far more detail by letting the VCR display every last detail, including the noise, and then using the far superior noise reduction that can be done with modern software. |
2nd April 2015, 08:48 | #13 | Link | |
Registered User
Join Date: Feb 2015
Posts: 31
|
Quote:
I followed your recommendation. I turned all the filters off. Then, I used the AVISynth script on the raw video. It really improved the quality of the video. However, still remains some white horizontal bars. Do you know one good script to remove it (if it's possible)? Thank you again! |
|
2nd April 2015, 12:19 | #14 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Re-post new sample (as per John's excellent advice).
__________________
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 ??? |
2nd April 2015, 16:13 | #15 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
White horizontal bars are probably going to be difficult to remove. If they are caused by tracking, you might be able to re-capture the bad sections while manually adjusting the tracking control. I have transferred lots of EP (6-hour mode) VHS tape where the automatic tracking in all my VCRs would not lock on to the signal (I always try finicky tapes in a second VCR). With these tapes, I got noise bars that drifted in and out of frame as the tracking control searched for perfect lock. I was able to manually tune the tracking, and then use this second capture to replace the sections of the original capture that had problems. The tracking problem is usually isolated to just certain sections of the tape.
Consult your VCR's manual for information on how to enable and adjust manual tracking. It is often accessed by pressing the channel up/down buttons on the front of the VCR itself. Pressing them both at the same time often is what is used to reset tracking to automatic. If the noise bars are actually on the tape, probably due to lousy tape (people didn't want to spend $20 on good VHS tape, and often purchased "bargain" brands that were made of really bad material) you might be able to figure out how to remove the noise bars using something like what StainlessS helped me with in this thread: Bad 1950s Kinescope - Hopeless? |
5th April 2015, 02:58 | #16 | Link |
Registered User
Join Date: Feb 2015
Posts: 31
|
Hi StainlessS, Here the new sample following the new advice: http://www.mediafire.com/watch/uequoz13bcxa2z9/Test.avi I could't convert this AVI video to yv12. Thanks for your help |
5th April 2015, 16:05 | #17 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Sorry NLPguy, I aint gonna download 500MB on my pre-pay 4G Mobile Broadband (MiFi, Sooooooo much better than a dongle).
I'll grab it sometime in next couple of days in pub for free EDIT: In fact I think I'll go to pub in a few minutes and get it.
__________________
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; 5th April 2015 at 17:40. |
5th April 2015, 16:22 | #18 | Link | |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
Quote:
EDIT: bar me? why? I don't think I deserve that Last edited by feisty2; 6th April 2015 at 07:25. |
|
5th April 2015, 16:39 | #19 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Yup, pure genius. When I was bored a few weeks/months ago, I took the opportunity to grab a copy
of "Elephants Dream" (y4m I think, or something like that) and also something about a giant bunny wabbit. (forgot the name). Oh yes, "Big buck Bunny". EDIT: mentioned clips in Avisynth Usage Sticky, "Consolidated list of test video clip resources", Here:- http://forum.doom9.org/showthread.php?t=135034 Gone fishing
__________________
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; 5th April 2015 at 18:17. |
6th April 2015, 01:33 | #20 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Feisty2 is a bit of a wayward young lad,
I'm just wondering if anyone else but me would love to give him a big cuddle. Of course he has some issues and is a bit $$$$ed up but then who aint. Question is, should Feisty2 be barred for life, OR, should he be given some sort of The Saviour kinda status. I'm all for barring him myself. EDIT: Added the smiley, just in case
__________________
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; 6th April 2015 at 02:56. |
|
|