Quantcast Encoding from Huffyuv? - digitalFAQ Forum
  #1  
02-01-2016, 09:19 AM
Motleymongoose Motleymongoose is offline
Premium Member
 
Join Date: Jul 2015
Posts: 23
Thanked 0 Times in 0 Posts
I am now capturing beautiful Huffyuv video in avi on a great system. Thank you lordsmurf.

I am now ready to transfer all this great footage over to various formats so that I can view it and share it with others. Digging around in the forum I came across the following:

"I would capture Huffyuv, then encode out an interlaced MPEG-2 @ 15mbps (Blu-ray spec) archive. Perhaps even MPEG-2 422@HL encode. Then create an H.264 stream to share, probably using QTGMC on that copy to deinterlace. It's more work, but long-term easier to work with. I'd only save Huffyuv for anything that later needs to be restored or heavily edited (not just scissors editing).

Read more: Home video digitizing project, any tips?

First question. What program should I use to encode to all of these different formats?

Second question. Because I am new to all of this terminology, could I get a translation in lay mans terms what what each of these formats are used for?

Third question. QTGMC?

I would like to be able to multiple things with the captured video. I want to be able to watch the captured video unedited on my tv. I would like to be able to burn blu-ray disks to share with family. I would also like to watch this same video on my iPad or any other portable device. And finally I would like to at some point be able to cut and paste all or portions of the captured video into Final Cut Pro X for editing.

Any help would be greatly appreciated,
Motleymongoose
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
02-01-2016, 12:00 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,448
Thanked 1,075 Times in 895 Posts
Congratulations, and good work. Your questions cover a lot of territory!

Quote:
Originally Posted by Motleymongoose View Post
I am now capturing beautiful Huffyuv video in avi on a great system. Thank you lordsmurf.
I assume you're capturing VHS.

Quote:
Originally Posted by Motleymongoose View Post
I am now ready to transfer all this great footage over to various formats so that I can view it and share it with others.
What, no VHS cleanup? VHS is pretty noisy stuff, even with the best of capture gear. Encoding will waste data bits on noise instead of content. We can't advise you about any of that restoration work -- we've seen no sample of your captures and have no idea what problems you might have, major or minor if any. NLE's like FCP, Adobe Premiere, etc., are not restoration tools. They're editors (cut and join, timeline, pretty good for color correction). FCP and the Mac system don't support many lossless codecs (BitJazz SheerVideo is one, ProRes another], but not huffyuv, Lagarith, or several others in more widespread use. The UT Video lossless codec works on Macs, but not in FCP. I'm afraid FCP prefers its own propriety formats and codecs.

Why FCP? There are countless "edit" apps for Windows that can do the same thing the way most people use them and they can handle a vast number of codecs installed on your system.

If you expect to use the libav codecs you have more patience than most of us, LOL! Last I heard they aren't supported by FCP. Most Mac users never heard of any of this stuff, which is where Mac is nowadays with video processing. Maybe the times have changed recently. Libav is used for encoding/decoding, not for cleanup.

Quote:
Originally Posted by Motleymongoose View Post
First question. What program should I use to encode to all of these different formats?
For Windows I'd suggest the all-in-one TMPGEnc Mastering Works encoder, which outputs MPEG(DVD), MPEG4(MPEG and h264/AVC) for BluRay and AVCHD, h264 encodes for mp4 and mkv, and a few others. DVD and BluRay (BluRay can encode standard definition and HD formats alike) have strict formatting and encoding specs which TMPGEnc enforces to ensure you don't encode something that players can't work with (this is true of most good quality DVD/BluRay encoders). Windows can accept many authoring programs for DVD and BluRay discs, and many are free. h264/mp4 is popular for web streaming. All of the formats mentioned encode to YV12, the industry standard. Most encoders will make that conversion for you from lossless files, but some will not. Many free encoders are available for Windows. TMPGenc uses the x264 encoder for h.264. They've been around for a long time and produce good results.

Whether for DVD, BluRay or the web, digital video has luma and chroma level restrictions. Those can be checked and fixed in Avisynth. Ignoring those standards results in encoders and tvs and websites that process out-of-spec levels and color in a way that obscures shadow and bright detail and often makes unwanted color changes. Unfortunately most VHS players pump up the output to look good on a CRT, but the result is known as illegal output levels.

If you burn BluRay discs to share with others, they must have a BluRay player or a smart TV or other external player/server that can handle BluRay. DVD is more universal, practically anything can play it. Don't short change MPEG: if it's good enough for Hollywood and the broadcast industry and BluRay, it should be good enough for most of us.

The MPEG high bitrate 15Mbps idea is good for archiving and gives a very clean encode, but it isn't valid for DVD. Standard definition BluRay/AVCHD can handle very high bitrates in either MPEG or h264. Mp4 is a favored 'net streaming format, but some home players can't recognize mp4; BluRay players are required for viewing mp4 at home.

Quote:
Originally Posted by Motleymongoose View Post
Second question. Because I am new to all of this terminology, could I get a translation in lay mans terms what what each of these formats are used for?
I gave a brief summary above, but it's impossible to duplicate here all the info that Google has for these formats, even from Wikipedia alone. The TMPGEnc app gives brief but informative info on each format in its output list. TMPGEnc has a free trial. It works pretty much the same way as other GUI encoders.

Quote:
Originally Posted by Motleymongoose View Post
Third question. QTGMC?
QTGMC is a deinterlacer with excellent denoising (which can be disabled or turned down if you don't want it). It requires YV12 colorspace and Avisynth. It can run in Avisynth scripts in VirtualDub. Huffyuv doesn't support YV12, but you can use Lagarith to save working files as lossless YV12. Lagarith is as fast as huffyuv and is often used for YUY2 capture instead of huff. Lagarith is not supported by Mac. Mac can use UT Video lossless codecs but FCP can't.

VHS source is interlaced and should be encoded that way. For mp4, web use is deinterlaced. QTGMC is the best tool for it, with no competition in the quality dept. But note that if any of your VHS tapes are recordings of old movies or tv shows, those sources originated on film. Movies are telecined, not interlaced. The Avisynth utility TIVTC is used to remove telecine. I know of no NLE at any price that can un-telecine video as well as TIVTC, nor do they deinterlace as well as QTGMC. Some big name NLE's do horrible deinterlacing.

I don't care for videos on iPhones or tablets except for a few internet downloads, so someone will have to advise you there. As far as I know, it's almost always progressive video.

Quote:
Originally Posted by Motleymongoose View Post
I would like to be able to multiple things with the captured video. I want to be able to watch the captured video unedited on my tv.
External playback devices and TV's don't support lossless, unencoded video. This is true whether they're huffyuv or not, and that goes for many other codecs including DV. They accept a limited number of formats and codecs. External devices are not as full-featured or codec rich as PC media players.

I use lossless media in all processing, including timeline NLE's, and don't encode anything until the end of corrections and processing. This is what lossless media is designed for. DVD, BluRay, h264/mp4, etc., are final delivery formats not designed for further breakdown.

I'm certain other members will have more info or notes. I don't use Macs for video, so Mac and FCP owners can advise further.
Reply With Quote
  #3  
02-01-2016, 12:29 PM
Motleymongoose Motleymongoose is offline
Premium Member
 
Join Date: Jul 2015
Posts: 23
Thanked 0 Times in 0 Posts
Yes, I'm sorry, I am capturing VHS. I didn't even think about clean up because the quality is so much better than what I captured in the past. I would be happy to post a clip. I am not sure how to do that. What tool do you recommend for clean up?

I am not apposed to doing everything on a Windows machine. I just know that after all the post capture processing, any editing for "movies" I will be doing on my Mac in fcpx. I know that program and I understand the limitations. All the uncut cleaned up content will be output on Windows. Sounds like that is the best option. Is there anyone that has had success inputing a particular format into fcpx?
Reply With Quote
  #4  
02-01-2016, 12:54 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,448
Thanked 1,075 Times in 895 Posts
The primary cleanup tools for VHS captures in Windows are Avisynth and VirtualDub, both free, with over 400 cleanup tools available (also free). QTGMC and TIVTC are two such tools. Without a sample, there's not much anyone can say. An unaltered lossless AVI cut of 8 to 10 seconds in huffyuv can be done in VirtualDub. Cut out parts you don't want except for the few seconds of sample, then save with "direct stream copy". That length and file size should be small enough for posting in the forum. In a forum post, click the "advanced mode" button if it isn't already opened that way and look for the "manage attachments" icon below the reply window. You'll get an upload window, nothing to it. Uploads are slower than downloads, so give yourself a little time.

I used a Mac and FCP a while back but had to give up on it for restoration. All I could do was make cuts and encode, and some color correction. With typical VHS video, that's a severe limitation.

Going from Mac codecs to Windows isn't much of a problem for Windows. It's going the other way that's the problem. Mac users will have to advise. Lordsmurf has done a lot of exports from Windows to FCP, but all the prep work is done in Windows. I'm sure he has an answer for you.
Reply With Quote
  #5  
02-04-2016, 10:13 PM
Motleymongoose Motleymongoose is offline
Premium Member
 
Join Date: Jul 2015
Posts: 23
Thanked 0 Times in 0 Posts
sanlyn,
Thank you very much for your help to this point. Here is a sample of the captured VHS video. I have been doing some research on the various tools that you have provided. I have a lot to learn. I hope that you will continue to tutor me in the ways of video cleanup. I also hope that you will be patient with me. I am very excited about the the possibilities.

Motleymongoose


Attached Files
File Type: avi Motleymongoose_sample.avi (39.47 MB, 70 downloads)
Reply With Quote
  #6  
02-04-2016, 10:33 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 8,477
Thanked 1,392 Times in 1,224 Posts
@mongoose:

I encode with MainConcept Reference (payware) or Avidemux (freeware).
- Avidemux 2.5 for MPEG, 2.6 for H.264.
- MainConcept does both.

MPEG = DVD, Blu-ray, broadcast, HQ SD archives
H.264 = distribution format only, best deinterlaced, mainly for HD content and streaming

QTGMC is high quality deinterlacer in Avisynth.

Regarding terms: Muddle through it. If we catch you using the wrong terms, most of us will kindly correct you, so you can better understand and research.

Looking at the sample, chroma offset is smeared into a bleed. Was this a Canopus ADVC capture, by chance? At a glance, it looks like typical 4:1:1 chroma smearing.

@sanlyn:

TMGPEnc software encodes MPEG quite poorly.

High bitrates reduce the need to denoise. A 15mbps stream won't choke and create artifacts from actual detail and grain noise on tapes. Only really worry about chroma noise, chroma offset, and more serious visual problems. Save the detailed NR for compressing to streaming.

@both

I use Mac, Windows, and Linux. Each has strengths and weaknesses. Mac is fine for encoding, as it has both MainConcept and Avidemux are available. But for VirtualDub or Avisynth, you'll want Parallels or VMware with Windows inside. Wine doesn't work for these. Using Perian on the Mac, you can access Huffyuv files.

I've done all post-capture on Mac in Parallels in the past, but restoring works better natively in Windows. It's a speed thing, and a CPU instruction thing. Mac can't really emulate (the hardware) for heavy video tasks well. But it can be done.

As sanlyn mentioned, I've done a lot of FCP authoring to DVD in the past.

- Did my advice help you? Then become a Premium Member and support this site.
- Find television shows, cartoons, DVDs and Blu-ray releases at the TVPast forums.
Reply With Quote
  #7  
02-05-2016, 09:34 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,448
Thanked 1,075 Times in 895 Posts
Quote:
Originally Posted by lordsmurf View Post
@sanlyn:

TMGPEnc software encodes MPEG quite poorly.
To a certain extent and with certain input under certain conditions, yes. But it seems "poorly" is kinda rough. I use TVMW mostly for h.264, and TVMW's MPEG engine only for very high bitrate BluRay. TVMW doesn't do so well at lower bitrates. For standard MPEG I would have suggested HCenc or TMPGenc Plus 2.5 (the latter is no longer sold. Tough luck, bargain hunters). Or the owner can do it the geek way with command-line ffmpeg and/or x264. I'd hesitate to advise beginners to leap straight into MainConcept Pro packages. You know what happens when they do: they spend really big bucks on it but use the package like a $19.95 encoder downloaded off CNET. Too bad the MainConcept encoders in most retail NLE's are so cut down from the original.

Quote:
Originally Posted by Motleymongoose View Post
Here is a sample of the captured VHS video.
Thank you. Nice color in the sample. It looks rather dim overall, though. Even at that, as lordsmurf noted earlier, there's chroma smear and bleed (obvious in the over-punched red). It looks murky mainly because luminance is low, barely reaching into middle gray in the center of the visible spectrum.

The attached YUV histogram below tells the luminance story. Luma is in the top row of the graphic. In the red area below it you can see red "stretching" into territory beyond the other chroma values.



The YUV histogram above is an Avisynth feature, captured to the clipboard while running an Avisynth script in VirtualDub and cropped from the main preview image. At the left hand side, apparently the player or capture card seems to be clipping darks at RGB16 (thin white spike at the left, which would include any black borders). When viewed in RGB, the Blue channel is clipped at the bright end (not surprising with that bright sky, and rather common), and Red starts climbing the right-hand wall of RGB histograms, indicating oversaturated Red.

Below, the original frame 162 is on the left. At right, the same frame after raising luminance gain in Avisynth and giving brighter values a bigger boost in RGB with Virtualdub's levels filter.



The AVisynth filter I used to pump gain into brighter levels above middle gray is called ColorYUV. Note that the usual basic "brightness" control wouldn't be the correct tool here: brightness raises black levels, not bright levels as you'd think.

I didn't get into more denoising or other work, the subject being luminance. The only other fix was cleaning up the borders in Avisynth without resizing the frame. But I should mention that geometric distortion and motion smear are visible. If you continuously play the sample you'll see the thin metal braces in the fence on the back wall doing a "hula" from side to side as the camera moves. Also, in the lower right the darker poolside seems to be "floating" in a different direction than other sections, the texture detail in the back wall twitches up and down, and the red in the ladder shimmers. Not easy to pinpoint the cause, but we've seen examples here recently with other capture setups that were much worse. If your JVC has a Digital R3 control, you might try turning it off. DNR seems rather aggressive, as thin details like the fence braces along the back wall are starting to disappear.

The attached sample_Levels_stdDVD.mpg was encoded to DVD standard with the free HCenc encoder. Many free encoder apps use HCenc. I don't remember if Avidemux uses it.


Attached Images
File Type: png frame 47 YUV.png (14.3 KB, 372 downloads)
File Type: jpg frame 162 - before - after.jpg (81.2 KB, 371 downloads)
Attached Files
File Type: mpg sample_Levels_stdDVD.mpg (4.32 MB, 27 downloads)
Reply With Quote
The following users thank sanlyn for this useful post: lordsmurf (02-05-2016)
  #8  
02-05-2016, 11:08 AM
Motleymongoose Motleymongoose is offline
Premium Member
 
Join Date: Jul 2015
Posts: 23
Thanked 0 Times in 0 Posts
To the original statement of am I using a Canopus AVDC capture, the answer would be no. I am using the rig that lordsmurf built for me. It has the AVT-8710 between the JVC S-VHS HR-S7800 used for playback. Do you know off hand if my VCR has Digital R3 control? What is DNR?

This is very good information. I am trying to keep up with all of it. Knowing a little more about my setup, can I make adjustments during capture that would improve the chroma bleeding? The histogram is very helpful. Lordsmurf knows what capture card I am using. I am surprised it is not performing up to par. I know he checked everything out. What am I doing wrong?

Because I am unfamiliar with virtualdub and avisynth for that matter, is there a way at looking at the histogram and making adjustments during capture. I would like to capture test samples, make adjustments and then recapture better quality from the beginning. Is that possible? Sounds like I need a lesson in scripting virtualdub.

Am I also correct in assuming that this capture is in need of deinterlacing?

Also, lordsmurf, perian is no longer supported. Is it still OK to use the last supported version?

What did you mean by "Save the detailed NR for compressing to streaming"?

Thanks for all of the good information and help. This is awesome.

Motleymongoose
Reply With Quote
  #9  
02-05-2016, 01:05 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 8,477
Thanked 1,392 Times in 1,224 Posts
@sanlyn:

Nice cleanup.

I've just never been a fan of any all-in-one type of anything, when it comes to video. I want, and often need, granular control at all times. Avidemux for freeware MPEG/H.264 encoding, or MainConcept for pay. I've never really liked HCenc, and I hate command-line encoding.

All TMPGEnc accomplished by discontinuing the old Plus 2.5 version is losing more money to piracy. If people want that exact version of that software, it's going to happen. However, I think it's usefulness has disappeared as other software got better (VirtualDub, Avisynth, Avidemux, etc). Anyway, it was soft and prone to blocking, compared to modern encoders.

@mongoose:

To be honest, I forget what anybody is using. In a rush, and when tired, I'll often forget who's who. But I remember you now.

That's an ATI AIW card, and I know it was behaving perfectly, so it's just camera-based blurring of the color on the tape. It's not caused by the capture card. That was common on homemade camcorder tapes. It's on some of our old family tapes, too. It is color bleeding, and tends to be harsher on bright color borders (red especially). Sometimes it can be fixed in post, sometimes not.

sanlyn gave a very thorough examination of the colors! I should probably use histograms more often.

I never care about "supported". I care about if it works. If Perian installs, use it.

No, never deinterlace a master/archive capture. You throw away 50% of the image quality with deinterlacing. It's only something that should be done when required (certain restoration techniques, or streaming needs). Never the master copy, only another copy. These are computer files, after all, and no rule says you can only keep one!

Save NR (noise reduction) work, to combat tape grain, only for streaming. This assumes a high bitrate MPEG capture/encode, for non-DVD. For DVD, you must again do some NR to appease the encoding gods, for fear they will smite you with artifacts!

The histogram will only help if you have a proc amp or proc amp controls. I don't recall if that exact ATI AIW card allowed "live" changes during captures in ATI MMC. Most do not. That feature is very erratic, so I never worry about it. VirtualDub proc amp controls may or may not cause dropped frames.

- Did my advice help you? Then become a Premium Member and support this site.
- Find television shows, cartoons, DVDs and Blu-ray releases at the TVPast forums.
Reply With Quote
  #10  
02-05-2016, 02:05 PM
Motleymongoose Motleymongoose is offline
Premium Member
 
Join Date: Jul 2015
Posts: 23
Thanked 0 Times in 0 Posts
So to clarify, I got the best capture that I am going to be able to do? I will clean what I can in post? What sanlyn did is the best that can be achieved on this master capture?

Sanlyn, would you help me with the cleanup process? Like I said, I know nothing about the powerful tool virtualdub.

Does this also mean that different captures may require different cleanup based on what is being shot? All of my VHS video was shot on one camera. Btw, I still have that camera and it works.

Motleymongoose
Reply With Quote
  #11  
02-05-2016, 11:58 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,448
Thanked 1,075 Times in 895 Posts
Quote:
Originally Posted by Motleymongoose View Post
Do you know off hand if my VCR has Digital R3 control?
It does. See page 40 of the user guide: LPT0349-001A_JVC_7800.pdf.

Quote:
Originally Posted by Motleymongoose View Post
What is DNR?
In contrast to noise filters that try to clean one frame at a time, Dynamic Noise Reduction filters analyze noise patterns over multiple frames and decide what's noise and what's not-noise. Depending on how they are set up, DNR filters can be applied lightly, moderately, or more strongly. Because strong DNR filters average many objects over many frames to achieve their purpose, the can result in ghosting and trailing image effects. There are more effective filters called spatio-temporal, which combine ther attributes of both types. Today's dnr filters are more sophisticated than those in many VCR's or DVD recorders and are less detructive -- but that's a generalization, as pro-style VCRs come with different DNR implementations.

Quote:
Originally Posted by Motleymongoose View Post
Lordsmurf knows what capture card I am using. I am surprised it is not performing up to par.
It appears to me to be working normally. VHS capture has several common problems, but each tape can add its own unique glitch. As lordsmurf implied, the distortions I mentioned are most likely rooted in the camera's shutter type. I ran across a tape that had a continually shifting sidewalk winding through a rose garden -- and a retail tape, at that! Then there's my sister's old VHS camera videos, a constant source of surprise (or headache, which would be more accurate). One old tape explodes with bright, hot-spot highlights, then another tape is so dim I can barely recognize my own relatives.

Quote:
Originally Posted by Motleymongoose View Post
Because I am unfamiliar with virtualdub and avisynth for that matter, is there a way at looking at the histogram and making adjustments during capture.
VirtualDub capture has a capture YUV histogram that works in Preview mode only. It won't display during capture (or you'd likely have dropped frames). The VDub capture histogram looks like this:



The data in the red area is data outside the RGB 16-235 range. The left side is darks, the right side is brights. Note that black borders in an image will bleed into the left-hand red side. You'll never get VHS absolutey perfect, but the point is to browse thru quick portions of tape, take some readings, make adjustments as best you can, and tweak afterward. AIW capture cards and a few others have some basic image filters in their capture drivers, which you can access in VDub capture using "Video..." -> "Levels..." You should also crop off black borders and head switching bottom noise to keep them from throwing off your readings -- and DO NOT FORGET to UNDO cropping by returning all of its settings to zero. Just unclicking the "Crop" menu item won't undo it, as I discovered after capturing 2 hours of tape at the wrong frame size.

VDub capture also has menu items for "extend luma" or "extend black point", noise filters...Make sure all those extras are turned off. While it's sometimes OK to lower saturation a bit if you see lots of bleeding, trying to get a perfect color balance from VHS capture is an exercise in masochism. VHS changes color balance every few seconds and with every new camera shot. The more filtering you do, the more you risk dropped frames and other capture problems. Usually, brightness (black level) and contrast (bright level) are enough.

Quote:
Originally Posted by Motleymongoose View Post
Am I also correct in assuming that this capture is in need of deinterlacing?
Again, I echo lordsmurf and other advanced users: deinterlacing always has a price. Some people say, well, you should deinterlace for PC viewing. Really? If none of the media players on your PC will deinterlace properly, or if your CPU is too lame or your TV too poorly made to handle it, you seldom get better performance whether you deinterlace or not. Interlaced and telecined playback are done to match motion handling and frequency of screen repainting to your TV and PC monitor. Deinterlacing doubles the frame rate, doubles the number of frames, and doubles the size of fields into frames: if your player setup can't handle the original frame rate and fewer frames, don't expect smoother performance by doubling everything and drawing on twice the resources for playback. SOme people get around this by deinterlacing and then dropping alternate frames, throwing away half of the original motion resolution. Deinterlacing is for the internet.

There are times in post-processing when very high quality deinterlace or telecine removal is required for repairing defects. There are prescribed means for doing this (which many ignore, and which is why you see much badly mangled video on the internet). After the repair is done, original performance is restored by controlled methods for restoring interlace or telecine. But video is so varying that you can't be dogmatically absolute -- Some video sources are so poorly interlaced or otherwise borked, one has little choice but to break it down as the lesser of two evils.

As for using histograms in general, here are 2 good intros with great images on how to use what are called "RGB parade" histograms that show three color channels. The links are Photoshop pages for still cameras, but remember that the graphics principles are the same for motion video. Video is really a stream of still images.
Understanding histograms Part 1 and Part 2
http://www.cambridgeincolour.com/tut...istograms1.htm
http://www.cambridgeincolour.com/tut...istograms2.htm

Quote:
Originally Posted by Motleymongoose View Post
Sounds like I need a lesson in scripting virtualdub.
Avisynth is run via .avs text script files. You can get very complicated with it, or you can work on more basic levels. Avisynth and VirtualDub are two different programs. It just so happens that Virtualdub can execute Avisynth scripts and save Avisynth's output.

Quote:
Originally Posted by Motleymongoose View Post
So to clarify, I got the best capture that I am going to be able to do?
LOL! With that question you could start a new thread that would go on for years. it's a decent and workable capture with good color, levels a bit dim and not clipped at the dark or bright end (that's a definite plus), no major frame damage or horrible noise, and better than some of the stuff you find in some very recent restoration threads. To get "The Best", well...if you could start with a $2000 player that still works, some of the old ATI-chip based $1500 capture cards....I think you see what I'm getting at. Like most people here, do the best with what you have, learn its ins and outs and limitations.

Quote:
Originally Posted by Motleymongoose View Post
So to clarify, I got the best capture that I am going to be able to do?
Quote:
Originally Posted by Motleymongoose View Post
What sanlyn did is the best that can be achieved on this master capture?
Many could get better, or worse. There is such a thing as the point of diminishing returns. And you can ruin video by overdoing it.

Quote:
Originally Posted by Motleymongoose View Post
Does this also mean that different captures may require different cleanup based on what is being shot?
To some degree or other, usually yes.

The best way to get a handle on these apps and techniques is to use them, coupled with looking at or posting samples and learning from them. Both programs and their filters and add-ons are pretty well documented.

I have a long day coming up tomorrow but will try to draw up some scripting samples and cover a few other bases later tomorrow or early next day. I'm sure other readers have their own ideas as well. I don't think anyone here knows it all. I sure don't.


Attached Images
File Type: png VDubHistogram.png (18.4 KB, 390 downloads)
Attached Files
File Type: pdf LPT0349-001A_JVC_7800.pdf (1.72 MB, 14 downloads)
Reply With Quote
  #12  
02-07-2016, 09:20 PM
Motleymongoose Motleymongoose is offline
Premium Member
 
Join Date: Jul 2015
Posts: 23
Thanked 0 Times in 0 Posts
Here is a sample capture with my equipment with the Digital R3 turned off. Does it look better or give the results that you expected?

I am looking for any good "manuals" for virtual dub. The website has removed a lot of the documentation.

Thanks,
motleymongoose


Attached Files
File Type: avi digitalfaq sample R3.avi (74.69 MB, 15 downloads)
Reply With Quote
  #13  
02-07-2016, 09:57 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,448
Thanked 1,075 Times in 895 Posts
Just downloaded the new sample at the last moment on the way to pick up a relative at the airport (how can a flight be 3 hours late with nobody getting fired ? ?). Will have a better look in the a.m. and have more notes to post on processing the previous sample.
Reply With Quote
  #14  
02-07-2016, 10:26 PM
msgohan msgohan is offline
Free Member
 
Join Date: Feb 2011
Location: Vancouver, Canada
Posts: 888
Thanked 201 Times in 175 Posts
Quote:
Originally Posted by Motleymongoose View Post
I am looking for any good "manuals" for virtual dub. The website has removed a lot of the documentation.
I don't think the website ever had anything more than what's there now, did it? But VirtualDub includes a help file with more information than the website.
Reply With Quote
  #15  
02-08-2016, 04:18 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,448
Thanked 1,075 Times in 895 Posts
Quote:
Originally Posted by Motleymongoose View Post
Here is a sample capture with my equipment with the Digital R3 turned off. Does it look better or give the results that you expected?

I am looking for any good "manuals" for virtual dub. The website has removed a lot of the documentation.

Thanks,
motleymongoose
The new sample looks pretty clean -- a bit soft, but that's better than tons of noise. Still looks rather dim. I see the sme distortion problems with R3 turned off. For this tape I'd leave it on: when it's running it helped smooth out a little line twitter on that railing behind the pool. I'll post some more details later.

Quote:
Originally Posted by Motleymongoose View Post
would you help me with the cleanup process? Like I said, I know nothing about the powerful tool virtualdub.
Many members here and yours truly would give all the help we can, even if I don't have all the answers (no one person does, AFAIK). I know from experience that a great way to get a handle on post processing and encoding is through real samples (especially samples of video that look much worse than yours, and we've seen plenty of those!), and browsing through the capture and restoration forums. Of course you have to start with good ol' user guides, but you have three advantages: (a) This stuff is often common sense and a matter of applying the right tools. (b) It's mysterious at first, but only for a brief time, and you only have to learn this stuff once. (c) Once learned, it's highly repeatable. And I should add (D): Experienced forum people can help with specific questions.

Before you can get real specific you should have a quick look at some basics.

VirtualDub help is petty good, but you'll likely use only the same few features over and over.

Apparently you already have VirtualDub (that's certainly a start, LOL!). There are a ton of VDUb filters around. Before you start plunging into hundreds of downloads, here's a specific tip: A VDub filter is a .vdf file that you copy into your VirtualDub plugins folder. The .vdf's are all you need. Don't download a big .zip file into your plugins and unzip it there. You'll likely overwrite a number of small help files with similar names if you do it that way, besides loading unused junk into your plugins. On my PC on a second hard drive I have a folder named VDub_downloads. I make a subfolder for each .zip or filter download. I often have relevant web pages and articles stored in their respective subfolders. Once you unzip a filter download, copy only the .vdf filter into your plugins. Some plugins ship with help files or Read-Me's.

I'm working on a few notes and demos for your new sample and will show some VirtualDub operating tips. I should have this sample stuff ready for posting later. Meanwhile if you want a look at a couple of VirtualDub plugin source sites, try browsing http://www.infognition.com/VirtualDubFilters/. Another older site that used to belong to a guru named Neuron2 is still being hosted, but could shut down anytime -- this site was an old standby for some very popular VDub filters: http://www.oocities.org/shawnroy03/v...b_filters.html.

Some of the VDub filters I used for your project were posted earlier in digitalfaq, at these links:

1. http://www.digitalfaq.com/forum/atta...dub_filterszip . The plugins contained in that .zip are:
ccd (aka CamcorderColorDenoise, cleans chroma noise (rainbows) and often cleans border stains)
ColorMill (Color correction)
Exorcist (anti-ghost filter)
GradationCurves (aka Curves, similar to those in Premiere Pro, AfterEffects, Vegas, etc., for color work)
HueSatInt (D.Grafts' hue-saturation-intensity filter. Rather specific, but very handy at times).

2. http://www.digitalfaq.com/forum/atta...-time-csampzip. Contains a non-Vdub standalone freebie (Csamp.exe)...no installer, just unzip and copy the tiny .exe to your desktop. It reads RGB pixel values from any desktop window or app. An .rtf file inside the .zip has more specifics. Windows has a built-in rtf reader; just double-click the rtf file. Handy for help with color correction and analysis. The project sample I'm working on will show how to get info from this little gizmo. It is not a VDub filter, so don't put it in plugins.

3. I don't know why trevlac's ColorTools histogram package hasn't been posted (maybe it has, I just can't find it). It's attached below as ColorTools_plugin.zip. The old home page is here: http://trevlac.us/colorCorrection/colorTools.html. Caution: this plugin won't work in Win7 unless you're in XP-Sp3 Mode. Just one more reason why many still use XP.

AVisynth takes some getting accustomed to. But if stubborn and klutzy me could get into it, anybody can. You have to download the installer first, if you haven't yet. Rev2 version 2.60 (May2015): http://sourceforge.net/projects/avisynth2/.

Avisynth installs a program group in your program listing along with a link to its built-in help files. Sometimes you get a smidgeon more detail in articles in the AVisynth web wiki at http://avisynth.org.ru/docs/english/. The contents include docum,entation on several hundred functions and filters. How many would you use? Normally a dozen at most, so don't don't break into a sweat. Anyone who can use all of them is way beyond most users here.

There are usage and install guides around, some a bit old but little has changed in the installer. http://www.afterdawn.com/guides/arch...nth_page_3.cfm has some installer tips. One of those tips is to make a bunch of file association defaults: the only file association you should check is to associate .avs files with Notepad, so that if you double-click an .avs file it will open in Notepad. Many Avisynth guides tell you to run your first scripts in Windows Media Player. Well...WMP doesn't work so well these days, in many ways. Much more hassle free to run scripts with VirtualDub.

The afterdawn installer page has a list below the article with more links about Avisynth usage.

As with Virtualdub, Avisynth plugins are copied into the Avisynth plugins folder. There are three types of plugin files that are used with Avisynth: autoloading .dll's, autoloading .avsi files, and non-auto loading .avs scripts. Never fear, there's an easy way to load .avs plugins into a script. Note that because .avs can be a type of official plugin, you shouldn't save your personal home-made .avs scripts in the plugins folder. Most people store their own scripts in the same folder with their video project.

Some Avisynth plugins are simple, others are monsters that require a ton of support files. Again., never fear: the documentation that comes with the big guys tells you what you need. More simple filters also have docs that (usually) cover everything you need to know. Yeah, you do get some ancient plugins from long-gone geeks with docs in Russian or French, but likely you won't encounter those unless you get into some really godawful videos that probably can't be fixed anyway.

Most popular Avisynth plugins are listed here http://avisynth.nl/index.php/External_filters and some older ones here http://www.avisynth.nl/users/warpenterprises/. Clicking one of download links will either download something or will take you to a download page with lots of useful techy details. Avisynth can be used at a very basic level, or you can get real nerdy with it if you like. Most of the time you'll use the same filters again and again, when you need them.

Don't get into a mad rush with Avisynth plugins. The project I'm preparing now uses only built-in Avisynth functions and some VirtualDub filters.


Attached Files
File Type: zip ColorTools_plugin.zip (75.4 KB, 20 downloads)
Reply With Quote
The following users thank sanlyn for this useful post: Goldwingfahrer (02-08-2016)
  #16  
02-09-2016, 08:25 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,448
Thanked 1,075 Times in 895 Posts
Information Overload #1

VirualDub isn't your typical mass consumer editor (thank goodness), so it's a little freaky at first. You'll soon get a feel for the app's tools that you'll use most often, and you'll develop your own workflow and preferences. I run Avisynth scripts in Virtualdub. It's easy to see changes and filter effects -- for me, anyway, and I can load VDub filters to tweak Avisynth's output at the same time that I run the script.

To create an Avisynth script (an .avs text file), if you haven't tried it already: start by opening a plain text editor. I use Notepad. Caution: DO NOT leave "Word Wrap" turned on in Notepad. To make sure it's turned off, click the "Format... -> " menu item, and in the Format dialog make sure Word Wrap isn't ticked on.

Type a few lines of your script and click "File..." -> "Save..." The first time you save a file a Notepad dialog window asks for a location and filename. Navigate to the area where you want to save this .avs script (the same folder that has your video project is a good place). At the bottom of the Save dialog window find the entry space for "Save as type:". Click the downward arrow in that input panel and choose "All Files" (see the green arrow in the image below). Then give your file a name and type the .avs file ending at the end. Click "Save" and continue. This is a plain text file but you don't want it saved with a ".txt" file ending.



When I first saw your sample it looked dim and washed out but brigher than the first one. I wrote a script to open that No-R3 file with Avisynth for a look at the YUV levels histogram. Here is the script:

Code:
AviSource("E:\forum\motleymongoose\digitalfaq sample R3.avi")
Crop(8,0,-8,-8)
ConvertToYV12(interlaced=true)
Histogram("Levels")
I opened this script on VirtualDub by clicking "File...", then "Open video file...". Don't use the "open script" menu item -- that's for something entirely different. Note that VirtualDub sees Avisynth output as a video, which it is.

Lines in the script are executed in the order in which they appear, top line first. When you open this script, you should see this in the Virtualdub window:


The left-hand panel in the image above is the Input Panel. It shows the first frame of your sample, with the YUV histogram attached to the right of the frame. The partial panel at the right of the Input panel is part of the Output Panel.

This is what the .avs script is doing:

AviSource("E:\forum\motleymongoose\digitalfaq sample R3.avi")
AViSource() opens many AVI containers, good for huffyuv, Lagarith, DV-AVI, Xvid and other codecs, as long as the codec is installed in your system. It won't open mp4, mkv, mpeg or other such files -- there are specific plugins for those. At this point the losslessly compressed file has been decompressed and fully decoded. If you save this output as uncompressed you'll have a really big file. But we can fix that in VirtualDub's output.

Crop(8,0,-8,-8)
I don't want the black borders or bottom-border head switching noise to affect the histogram. So I use the Crop() command to cut off pixels listed in the order of left side, top, right side, bottom. So I cut off 8 pixels from the left, none from the top, 8 from the right, and 8 from the bottom. This does remove small bits of the real image, but that's no problem at this point. The crop is only temporary, as you'll see later. Colorspaces like YUY2, YV12, RGB, etc., and interlaced or non-interlaced frames have crop limitations. These are explained in the Avisynth help article for the Crop() function (at http://avisynth.nl/index.php/Crop, and in Avisynth's installed Help). You don't have to do this if you don't want to, but black borders can often be deceptive in histograms.

ConvertToYV12(interlaced=true)
The YUV histogram I want to see works only in YV12 color. Your sample is YUY2, so I use Avisynth's specified converter for changing the colorspace. Never fear, Avisynth does this correctly -- a great many editors don't, some of them big-name guys. Here, you must specify that the video is interlaced.

Histogram("Levels")
Your YUV video has three data channels: Y (luminance), U (blue), and Red (V). The data in each channel is shown in the histogram. There's a long history about why YUV is stored this way: Wicki's have tons of internet articles about it. The top channel (white) is "luma", the middle channel is U (blue), the bottom channel is V (Red). The colors do blend into each other from end to end. You might ask, Where does Green come in? Well, see, green is derived from geeky incomprehensible math that subtracts U and V from total luma. Nice thing about this scheme is that you don't have to worry about it.

Continued, next post.


Attached Images
File Type: png Save As.png (42.9 KB, 348 downloads)
File Type: jpg Open video with YUV histogram.jpg (66.9 KB, 349 downloads)
Reply With Quote
The following users thank sanlyn for this useful post: koberulz (03-13-2017), Turok81 (08-07-2017)
  #17  
02-09-2016, 09:11 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,448
Thanked 1,075 Times in 895 Posts
Information Overload #2

Now that we have this magnificent script (!) for viewing some details in your video, we can draw some conclusions. For one thing the pale appearance is described by luma, which in the histogram barely makes it past the midway point in the top (white) panel of the graph. Note that not all videos will fill a histogram from side to side; a night scene or foggy shot will have muted values. But this shot is bright daylight (you can see that by the daytime shadows and bright highlights in the image).

The image below is an unfiltered copy of frame 257, but resized and with 3 borders removed. You can see that it looks washed out, lacking brilliance and snap.



The image below displays two histograms created from this frame. One is the YUV histogram from Avisynth (left), the other is an RGB histogram from the ColorTools plugin in VirtualDub (right). Both histograms explain a lot. There aren't any high-value brights or low-value darks. The dark side of both histograms is at their left side, the brights are at their right side. The middle point of values in the 0-255 spectrum is at RGB 128, in the middle of each horizontal panel.



Both of the above histograms have side markers that are significant. In both histograms the left side marker or colored panel maps to equivalent RGB values below RGB 16, the right side border maps values greater than RGB 235. RGB 16-235 is known as the "safe range" for YUV video. Usually you want to keep values inside that 16-235 safe area in YUV. When values spill into the side borders, you risk clipping of dark or bright data. It's like a bucket that holds only so much water: overfill the bucket, and stuff spills out and gets lost.

And now for a gross oversimplification: The RGB display in many editors expands the darkest and brightest YUV values. That's just the way it works for monitors and TVs, folks, which display video as RGB. If you have a YUV range of 16-235, it gets expanded in RGB to 0-255. If your YUV video already has RGB 0-255 values, what's an RGB device going to do with the excess when 0-255 gets expanded? RGB displays will just cut off illegal data or have a big hassle displaying accurately. In practise, low RGB values like RGB 0 (real black) really don't look so great. Kinda grim. RGB 255 is a very bright white: get a guy in a white suit at RGB 255 and he'll look like a glowing eyesore. RGB 235 is actually pretty bright, as you'll learn while you work.

A note here: if the image of frame 257 looks especially bright or snappy to you, your monitor isn't calibrated. There are several ways to adjust a monitor to known display standards. Some monitors are OK out of the box, but most are not. If you set up a video to look darker on a monitor that's too bright, it's guaranteed to look weird to a lot of other viewers.


Fixing it up:

What I wanted to do with the video was add some natural sparkle to it without blowing up your monitor. I began that process by changing the .avs script and using built-in Avisynth commands. So here is how the script was modified to work with the video in its normal state:

Code:
AviSource("E:\forum\motleymongoose\digitalfaq sample R3.avi")
#Crop(8,0,-8,-8)
#ConvertToYV12(interlaced=true)
#Histogram("Levels")
Notice that every line except the top line has a "#" in front of it. The "#" marks everything following it in that line as a comment. Avisynth ignores comments. As far as Avisynth goes, anything following "#" on a line doesn't exist. Another way of un-enabling the code is to simply delete the three lines that follow AviSource(). But I often keep old commented lines in a script in case I have to backtrack to clean up my stupid mistakes.

So I modified this script and added to it, as follows:

Code:
AviSource("E:\forum\motleymongoose\digitalfaq sample R3.avi")

#Crop(8,0,-8,-8)
#ConvertToYV12(interlaced=true)
#Histogram("Levels")

Crop(4,0,-4,-6).AddBorders(4,2,4,4)
ColorYUV(gain_y=30,off_y=-5,cont_y=40)
ColorYUV(cont_v=-40)
ConvertToRGB32(interlaced=true,matrix="Rec601")
AviSource("E:\forum\motleymongoose\digitalfaq sample R3.avi")
You have to keep this AviSource line intact or you won't have a video to work with -- in which case Avisynth will say so in no uncertain terms before it just stops dead and leaves you staring at a couple of blank windows in VirtualDub. Obviously, you have to open video before doing anything. The next three lines after this statement are commented-out and ignored.

Notice that the path and filename shown in AviSource() are the path and filename for your video's location in my PC. You'll have to modify that path statement to find the video in your system. The path statement inside the parentheses begins and ends with double-quotes.

Crop(4,0,-4,-6).AddBorders(4,2,4,4)
Here we have a new replacement for the earlier Crop statement. The side borders in your sample aren't black; they're just a bit lighter than RGB16 when viewed. The bottom border is noise that you can do without. Cropping in YUV has to be in even numbers of pixels. If this video were YV12 instead of YUY2, you couldn't crop 6 pixels from the bottom. That's because of the way chroma is stored in YV12, which restricts you to cropping in terms of 4 vertical pixels at a shot. But this is YUY2, so cropping off 6 will work, and 6 is an even number. We want to maintain the original image proportions and frame size, so add 4 pixels to the left and 4 to the right -- but now you need 6 pixels of height to restore the frame height. I added two black pixels at the top and 4 at the bottom (which equals 6, of course) and made the image look more centered vertically.

ColorYUV(gain_y=30,off_y=-5,cont_y=40)
ColorYUV is a dandy filter that let's you play Houdini with luma, chroma, contrast, and all that. ColorYUV has a bunch of parameters that do different things. It's all documented in the Aviynth Help page. In this case I want to push luma gain forward toward the brighter side of the histograms: what gain_y=30 does is multiply video data values (i.e, stretches values from the bottom outward -- or shrinks inward, if given a negative number). This will raise darks just a bit as well, so off_y=-5 is a negative offset that shifts all values a few points back to the darker side so that we can keep the lower midrange from looking too lightweight, which can affect one's perception of "depth" in an image. Cont_y=40 adjusts overall contrast: in ColorYUV the contrast stated as a positive number stretches values from the middle outward, making brights brighter (and in my experience it also makes darks a tteensy bit darker at the same time). A negative value does the opposite, drawing values inward toward the middle. Not all "contrast" controls work quite the same way.

You could use different values, but if you observe the action of these values in Avisynth you have to keep your eye on the RGB 16-235 YUV range and -- especially -- note that if you push midrange and bright values too far you'll get "hot spots" on highlights, and the pool's blue water will simply change to a big glob of boiling blue with no ripples.

How does one make these changes and view the effects conveniently without starting the whole process all over again? If you're running in VirtualDub, keep a window open in Notepad with the script at hand. Make your script changes. Then in VirtualDub Click "File..." -> "Reopen video file" (or click F2 on the keyboard), and voila! VirtualDub's display will update. If you do this about 15 or 20 times, however, you often run out of memory and have to shut down and start over. Can't have everything.

ColorYUV(cont_v=-40)
Red is badly oversaturated. Reducing V (red) contrast by using a negative contrast value reduces saturation in that channel. There are better ways to do this, but this is quick and available right now. Reduce it too far and your video will turn blue-green (cyan).

ConvertToRGB32(interlaced=true,matrix="Rec601")
I'm going to hand Avisynth's output to VirtualDub for RGB filters. Tell Avisynth to make the transition correctly with the statement shown, and be sure to stipulate interlaced=true. A lot of editors really screw this up and give you no control over it.

The above script makes visible but not massive changes. Could use some tweaking, but I wanted to use VirtualDub controls so I could work in more precise areas of the spectrum than YUV will allow. But the script does indeed make measurable changes, shown in the YUV and RGB histograms below:



Not a totally awesome change (and let's hope so, too, or we'll look like a typically bad YouTube post). But in the histograms above you can see that the darks have moved several RGB points to more realistic looking darks, and the brights moved about 25 RGB points brighter. You'll also see some little "gaps" in the white luma bands, narrow unpopulated vertical slits, because many values have been "stretched" from the original. You can stretch only so far. If you want to avoid gaps altogther (almost) use 16-bit dithering filters and other tricks in Avisynth. But that's moving way, way ahead. These gaps won't make much difference here. In RGB you still see the color "peaks" at the right side of the luma and color bands, indicating brights clipped in the camera from the bright water and sky, and sun glare from pool walls and whatnot. A polarizing filter would have been a great help for this shot.

In a later post I'll cover the details of the VirtualDub filters I used. For now, take a look at the final VirtualDub output frame and its RGB histogram, below:



Red Green and Blue have values now up to RGB 240 (brightness gain of 60 RGB points on average). Of course the YUV histogram wasn't changed. I'm not one to push things too far, as the final video plays brightly and looks more believable. But you can always tweak to your heart's content.

Next time, a look at the VirtualDub filters. It's dinner time here.

Continued, next post.


Attached Images
File Type: jpg frame 257 original cropped.jpg (37.9 KB, 351 downloads)
File Type: png frame257 original crop YUV-RGB.png (29.7 KB, 352 downloads)
File Type: png frame 257 Adjust YUV-RGB.png (31.2 KB, 352 downloads)
File Type: png frame 257 RGB adjust.png (450.8 KB, 348 downloads)

Last edited by sanlyn; 02-09-2016 at 09:23 PM.
Reply With Quote
The following users thank sanlyn for this useful post: Turok81 (08-07-2017)
  #18  
02-09-2016, 10:20 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 8,477
Thanked 1,392 Times in 1,224 Posts
I'm saving this for a guide.

- Did my advice help you? Then become a Premium Member and support this site.
- Find television shows, cartoons, DVDs and Blu-ray releases at the TVPast forums.
Reply With Quote
The following users thank lordsmurf for this useful post: sanlyn (02-10-2016)
  #19  
02-10-2016, 01:37 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,448
Thanked 1,075 Times in 895 Posts
Information Overload #3

Wish this was shorter and didn't have typos, but....

I used some old-standby VirtualDub filters to tweak Avisynth's output while the script was running. If your Avisynth filter load is fairly fast, scrolling back and forth to check added filter effects isn't difficult. With really slow filters like QTGMC or MCTemporalDenoise at default settings, you just have to be patient -- or comment-out the lines for those slow filters while you get the results you want.

What if your original Avisynth results look just fine? You're home free: no need for more work or RGB. Just save the Avisynth output in VDub as losslessly compressed, then head for your encoder.

In case you don't remember, the AVisynth script that I was running in VirtualDub for RGB filters is this script from the earlier post:
Code:
AviSource("E:\forum\motleymongoose\digitalfaq sample R3.avi")

#Crop(8,0,-8,-8)
#ConvertToYV12(interlaced=true)
#Histogram("Levels")

Crop(4,0,-4,-6).AddBorders(4,2,4,4)
ColorYUV(gain_y=30,off_y=-5,cont_y=40)
ColorYUV(cont_v=-40)
ConvertToRGB32(interlaced=true,matrix="Rec601")
As the script shows, the Avisynth results are imported into VirtualDub as RGB. I then loaded 4 filters one at a time. Through trial and error based on experience from working with videos like this, I set up the filters one by one, opened and closed them in the filter list and made changes until I settled on what I wanted. The 4 filters I loaded were:

-CamcorderColorDenoise ("CCD" for short)
-Levels (built-in)
-ColorMill
-gradation curves (aka "Curves")

When they're loaded in Virtualdub the Filters window looks like this (the image shows the Filters dialog with the CCD settings window open):



I used CCD first to clean chroma noise, specifically the orange stain along the right-hand border. I moved the filter's slider until I had the strength setting I wanted (24), just enough to make the orange stain barely visible. I don't like using this type of filter at high power because they can often remove subtle color shadings that you want kept.

The Filter list has a check box for each filter. Uncheck the box to turn the filter off. Sometimes you do this so you can replace it with another filter or the same filter with different settings. Sometimes you change your mind about using that filter but you want to keep the settings.

The next filter was the built-in Levels. Notice that there aren't any "Brightness" or "contrast" controls. Sometimes they work, but mostly they don't. You can use them, but filters like Levels and Curves inflict less damage and are easier to control. A "brightness" filter would just make everything brighter, which often ain't what you want.

The filter dialog for the Levels filter looked like this:



The internet has a ton of tutorials about using a Levels control, found in big boys like Photoshop Pro, Premiere Pro, etc. VirtualDub's is a simplified version, but it still still works. I added three blue arrows to the image. The rightmost slider controls the value of brights. The middle slider handles what people like to call gamma, or the middle part of the spectrum centered at RGB 128. The leftmost slider controls black levels. Each slider works only in its assigned range -- the rightmost white level slider doesn't affect blacks, and so forth. Ordinary brightness and contrast controls don't work in exclusive ranges, they affect the entire image.

In the Levels dialog, clock on "Show Preview" to activate the buttons at the bottom of the window. You'll see a preview window pop up to the right of the dialog so you can check the effects. Just above the bottom buttons is an area labeled "Output Levels". It's doubtful you'll ever use this area, so forget it's there. Often it does more harm than good, seriously clamping (clipping) blacks and whites. Higher up there's an "Input Levels" area. This is the area you want. In that area are three numeric readouts: here, the values shown are adjusted to 3 (black), 0.986 (midrange), and 244 (whites). Their default values when the filter first opens are respectively 0, 1.000, and 255.

This critter looks strange if you're accustomed to cheapo editors without such controls. You use sliders to make settings. Here's how they work:

The rightmost white level slider is set at 255 by default. If you move that slider to the left, what it's doing is setting new, brighter values for the bright colors. As you move to the left, you'll see the right-hand end of the histogram move to the right toward the pointer -- values at the bright end are pulled toward the pointer at the bright end, bringing darker brights closer to the desired brightness levels. I stopped at 244, which looked bright enough. You could slide it a little more to the left if you want more brilliance. I stopped just short of seeing the ripple details in the blue water start to gray out. The whiteness slider's effects decrease as the it approaches the upper midrange; it has no effect on blacks.

The brights looked OK but the black end looked a little tame. That black garbage can in the pool's corner was a bit bright, and the lighter "blacks" or dark colors looked a bit light as well. So I clicked the leftmnost slider (blacks) and moved it to the right. When you move that slider toward the right, it "pulls" darks down toward the pointer at the black end. I stopped at a black value of 3, just enough to maintain some shadow detail in that black can.

What about the middle pointer? Actually, it adjusts automatically when you move the other pointers in order to maintain a balance in the midrange. If you move the middle pointer to the right, you'll "pull down" some of the upper midrange and the image will look darker. If you move the middle slider to the left, you'll pull darker colors to the right toward the middle pointer, making the lower midrange values brighter. In this case the auto correction seemed about right so I left it as-is.

The levels filter isn't always what you want. It can make bright colors look rather "hot" when overused.

ColorMill: This filter is similar to the color wheels in many high-priced apps, but it uses sliders instead of wheels. With it you can pinpoint three ranges: darks, mids, and brights. You can also pinpoint color ranges. The image below is the ColorMill dialog, in this case with the "saturation" controls selected at the bottom and all three saturation ranges set at 7 (use the preview window to check the results):



There are buttons at the bottom of the dialog that you can ignore, the sharpener being one. There's a Preprocess and a post-process, neither of which matters (use either), and you can ignore "Bad Source". "Keep brightness" is an oddball. If you adjust a bright color, ColorMill auto adjusts the other two colors to maintain the same brightness (In RGB, brightness and color are stored in the same pixel. YUV stores brightness (luma) and chroma separately). Keeping it on, however, can sometimes change the color balance too much in the brights.

ColorMill has many functions that you select in the left-hand panel. These, too, work in value ranges. Until you get into some color basics (Not that difficult -- the internet has hundreds of free Photoshop and Premiere basic tutorials that are very effective), you won't know what some this stuff means. Like, what is "sOR REAL HSV"? Well, HSV usually means Hue-Saturation-Intensity. Small corrections there go a long way, but you won't often need them. The best way to learn what this filter does is to pick some functions and start moving sliders. You'll get the idea soon enough. The hues in your sample are actually pretty close to OK, so you won't be doing much of that for this clip. The main problem is levels.

One ColorMill adjustment I made was to raise the MIDDLE POINT. Recall that the RGB midpoint is RGB 128. If things look too washed out or darkin the middle ranges (this range includes includes skin tones, among other things), you can lower or raise the assumed midpoint a few notches. It's a lot like the middle slider in the Levels control.

Each filter in the chain is a tweak of the one that comes before it. In color correction parlance this is called Primary Correction, Secondary Correction, and, well, "more" Corrections if you want them. Mounting 10 color filters will corrupt colors. Take it easy.

The last filter is Gradation Curves ("Curves"). Give Adobe $800 and you can get one. The VDub edition is free. As with all of these filters, I made very mild corrections -- just enough to keep from getting overdone effects. This is what Curves looks like when I used it:



Curves was introduced in two video forums but it has its own website. There's a nice tutorial at http://members.chello.at/nagiller/vd.../tutorial.html. Without adjustments, the default diagonal line is straight from the bottom left to the upper right corner. Changing the shape of that line by adding those little round "control buttons" forms the shape you want. The top of the graph is the brights, the middle is the mids, the bottom is blacks. In the image I added some RGB values along the left hand side to show which parts of that grid handle which values.

Move parts of that line to the right, it darkens the affected value range. Move parts of the line to the Left, it brightens. In the image above, I moved the RGB (overall level values) to slightly brighter in the brights and mids but left the darks as-is.

Example: to darken darks and brighten brights at the same time and give an image greater "contrast", move the bottom part of the line toward the right (darker), keep the middle of the line in the middle of the graph, and move the top of the line toward the right (brighten), then anchor the line with buttons in each corner. What you will have is a line shaped like an S-curve, which is where the filter's name comes from.

You can do some cool things. I had an image with a bad midrange blue smudge in the shadow areas of a woman's face. I went into the "Blue" section of the filter and made a notch filter that lowered the intensity of that blue smudge without affecting other areas. Such a notch filter is shown below:



In the next post I'll show how to load these filters automatically and how to save this filtered video in VDub's output.

Yes, this is all new for many readers, for sure. Get yourself a copy of Vegas Pro and you have similar stuff with a lot of other goodies. Sad to say, most people buy pricey NLE's and use them like a $35 Walmart special, a big waste of $$$.

In case you're wondering: yes, it's easier once you get into it. Reading about it takes longer than doing it.


Continued, next post.


Attached Images
File Type: png Filter List with CCD open.png (216.8 KB, 353 downloads)
File Type: png Levels.png (45.0 KB, 347 downloads)
File Type: png ColorMill.png (64.5 KB, 416 downloads)
File Type: png Curves.png (65.9 KB, 413 downloads)
File Type: png Midrange Blue Notch Filter.png (39.7 KB, 349 downloads)
Reply With Quote
The following users thank sanlyn for this useful post: koberulz (03-13-2017)
  #20  
02-10-2016, 01:55 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,448
Thanked 1,075 Times in 895 Posts
Information Overload #4

Rather than have you figure out the filter settings yourself, I attached a Virtualdub .vcf file. A .vcf file saves filter and some other settings from your project so that you don't have to struggle with them again. It's a simple text file, readable in Notepad. But don't make changes or you're in trouble.

Downloadthe .vcf to your video project folder, not to VirtualDub plugins. With your sample clip open in VirtualDub, click "File..." -> "Load processing settings...". Navigate to the location of the .vcf file, select it, and click "Open". The filters will load with the settings I used, in the order shown earlier. NOTE: You must have all four .vdf filters in your VirtualDub plugins folder, or it definitely won't work.

Attached is sample_noR3.mpg encoded to DVD from the Avisynth script and the VDub filters discussed. One could do more, but it's a decent visual improvement IMO.


Now, how do you save this filtered critter? I saved mine as lossless YV12 compressed with Lagarith. Huffyuv doesn't work with YV12. Encoding to DVD or most h.264 formats uses YV12 anyway. You can save it as huffyuv YUY2 if you wish, but you have to tell VirtualDub output what you want. You can download Lagarith here: http://lags.leetcode.net/codec.html. It's a small fast installer that puts the lagarith dll in your systems folder and tells the registry where Lagarith is located. It can be uninstalled in the Control Panel. Or use huffyuv.

By default, VirtualDub outputs video as uncompressed RGB. That would be 3 times bigger than a lossless compressed file. You won't encode to RGB anyway. First, click "Video..." -> "color depth...". You'll see a two part dialog window. On the left-hand side you'll see "Autoselect" as the decompression format. It's the default. Leave it that way. It's for input, not output. On the right-hand side under "Output format to compressor/display", select "4:2:0 planar YCbCr (YV12)". If you want YUY2, then select the YUY2 entry above it. Click OK to close the window.

For Lagarith lossless YV12: Under "Video.." -> "Compression...", select "Lagarith Lossless Codec". When it's selected you'll see a "Configure" button near the right bottom. Click "Configure" and select "YV12" from the dropdown list. Click OK, then click OK again to close.

For huffyuv lossless YUY2 (make certain you selected YUY2 for output in the previous "Color depth" menu !!): Under "Video.." -> "Compression...", select your version of huffyuv. You won't have to fiddle with the configure button, huffyuv will figure it out. Click OK, then click OK again to close.

Lastly, under the "Video" menu, make sure "full processing mode" is selected. If it's not tuned on, none of the RGB filters will execute. Then click "File..." -> "Save as AVI". Give the file a location and name, and presto! It's done. The .avs script will run, the RGB filters will run, and the output will be saved.

More:

We obsessive types are never done. I wanted to do a little more cleanup of that no-R3 sample. You don't have to do this, and in retrospect additional work in Avisynth didn't make a huge improvement. But some of the results are clearly visible. If nothing else, the script below will serve as an advanced example of cleanup. There's nothing exotic about the plugins used, they are all in common use. In VirtualDub I used exactly the same RGB filters that I described above.

I took the original script shown earlier and added a few things:

Code:
AviSource("E:\forum\motleymongoose\digitalfaq sample R3.avi")
Crop(4,0,-4,-6).AddBorders(4,2,4,4)
ColorYUV(gain_y=30,off_y=-5,cont_y=40)
ColorYUV(cont_v=-40)
ConvertToYV12(interlaced=true)
AssumeTFF().QTGMC(preset="medium",border=true)
FixChromaBleeding()
RemoveSpotsMC()
Santiag(2,2)
MergeChroma(awarpsharp2(depth=30))
LimitedSharpenFaster(edgemode=2, strength=75)
AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()
ConvertToRGB32(interlaced=true,matrix="Rec601")
Yeah, more complicated. You already know about the first 4 lines that end with "ColorYUV(cont_v=-40)". I guess the rest needs explanation.

ConvertToYV12(interlaced=true)
This time, the YV12 conversion is not commented out. You need YV12 for the plugins that follow.

AssumeTFF().QTGMC(preset="medium",border=true)
AssumeTFF() is used because many plugins assume the same default field order that Avisynth assumes, which is BFF (Bottom Field First). But your video is standard NTSC Top Field First (TFF). Using the wrong field order can wreck a video. QTGMC is a prize deinterlacing plugin. It separates the interlaced fields, interpolates them into full-sized frames, does some denoising, and outputs twice the number of frames at twice the frame rate. Never fear, we'll put things back in their original order later. You don't always have to deinterlace, but some filters won't work with interlaced video. Fortunately, QTGMC does the work with far less loss than inferior deinterlcers, including the one in VirtualDub and some high-end NLE's. The QTGMC option used is preset="medium", which is faster than QTGMC's default preset. In this case I had to add borders=true to avoid top border flutter which happens with some videos.

FixChromaBleeding()
This is an .avs plugin that attempts to clean up blue and red oversaturation and color bleed. There are other such filters, but this one is easy to use and gets visible results.

RemoveSpotsMC()
A motion-compensated spot remover. Yeah, your clip didn't have many spots but it has several "rips" or slender black horizontal ripples in several frames. Play the video and watch the posts on the upper left to see a couple of them. It softens the video a bit (not much). There are others that can do similar work. This one is an .avs plugin.

Santiag(2,2)
This is an anti-alias plugin used here to clean up some rough edges with tiny mice teeth and some splits in vertical lines. Those could probably have been avoided in the first place with R3 turned on. The (2,2) value is a mild strength setting.

MergeChroma(awarpsharp2(depth=30))
MergeChroma() is an Avisynth bullt-in function. awarpsharp2 is a .dll plugin that requires other support files, as some of the other filters do. aWarpSharp2 is used to tighten up color bleed and ghosting around edges. We want to work only with the color component here, so we tell Avisynth to merge the chroma filtering from the plugin with the luminance from the original video. This prevents oversharpening everything in sight.

LimitedSharpenFaster(edgemode=2, strenghth=75)
Another old standby, attempts to sharpen without creating halos and other nasty effects. This, too, is an .avs script plugin. edgemode=2 stays away from sharpening obvious edges, as they already
look sharp enough; instead, it sharpens finer detail. strength=75 cuts the sharpening strength to one-half of the default.

AssumeTFF().SeparateFields().SelectEvery(4,0,3).We ave()
You will see this string of code in so many AVisynth scrpits, you'll do what I did: save the line in a text file of sample lines and just paste it in. There are really 4 steps here, separated with periods. AssumeTFF() likely isn't needed because it's been stated earlier, but I just use it as a security blanket. SeparateFields() creates new fields from the deinterlaced video. SelectEvery(4,0,3) looks at every 4 fields and selects the first and last field. This doesn't make sense if you don't know that frames and fields are numbered starting with 0, not with 1. So the fields it looks at in the group of 4 field are fields 0, 1, 2, and 3. Weave() interweaves the selected fields together into a new interlaced video at the proper 29.97fps. Thus the video has been re-interlaced.

ConvertToRGB32(interlaced=true,matrix="Rec601")
You already know what that means.

The result is attached as sample_noR3_versionB.mpg

First thing to look at is the reduced red bleed in the pool's ladder. There's also some reduced blue spill along the edge of the darker pool floor on the lower right. Not a complete fix, as this is a problem with just about every VHS tape in the world, even retail tapes.

Neither of the mpg's completely smoothed some of the edge twitter in the capture. Digital R3 probably helped in the earlier clip. Just goes to show that sometimes Digital R3 is suitable for some tapes, but maybe not for others.

Both of these original captures, besides being rather dim, look like overexposed videos. The bright blue water just doesn't look right. That effect might have been the fault of glaring brights, for which you'd need a polarizer filter.

If you're still breathing....

Continued, next post.


Attached Files
File Type: vcf sample_noR3_vdub.vcf (3.8 KB, 9 downloads)
File Type: mpg sample_noR3.mpg (10.73 MB, 15 downloads)
File Type: mpg sample_noR3_versionB.mpg (9.58 MB, 15 downloads)
Reply With Quote
The following users thank sanlyn for this useful post: Mikey32 (09-01-2018), yukukuhi (04-28-2018)
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
The best quality H.264 encoding software I have used premiumcapture Encode, Convert for streaming 9 08-28-2015 04:20 PM
Edit MP3s without re-encoding? Reading Bug Edit Video, Audio 4 10-23-2012 10:39 AM
Getting MPEG2 artifacts with DVD encoding from AVI/HuffYUV source bbartley9 Encode, Convert for discs 22 08-31-2010 03:55 AM
Faster encoding... Superstar Encode, Convert for discs 5 11-05-2009 07:25 PM
Encoding Question Tom_n_Jonna Encode, Convert for discs 1 10-29-2005 10:56 AM

Thread Tools



 
All times are GMT -5. The time now is 05:17 PM