digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Restore, Filter, Improve Quality (https://www.digitalfaq.com/forum/video-restore/)
-   -   VirtualDub filters to improve color? (https://www.digitalfaq.com/forum/video-restore/6379-virtualdub-filters-improve.html)

sirbyron 02-14-2015 10:15 PM

VirtualDub filters to improve color?
 
1 Attachment(s)
Newbie to Vdub and filtering and was curious to know if there was anyway to improve color without the "shadow" effect as I call it. If you look around the band members and wherever color is rich, there's portions of unsaturated video. I added saturation to this via "hue/saturation/intensity" "colormill" and "graduation curves (mode hsv)".

Also , any other filters you can think of to help improve other areas you see would benefit would be greatly appreciated. It looks like to the left and bottom is monochrome.

Just fyi, I transferred from into computer as follows:

AG1980
TBC3000
Studio 1 Proc Amp
ATI AIW7500
Vdub AVI YUY2

...also marching uniform pants and drum major skirt should be dark blue .... drummers pants are black. (mentioning for what its worth in case it helps in giving me tips ;) )

sanlyn 02-15-2015 06:24 AM

Thank you for the sample. We would really prefer to work with unprocessed edits from original capture files. Your sample has been converted from interlace YUV to progressive, uncompressed RGB -- which is part of the color problem, aside from the fact that the video was captured at very high IRE (meaning that your black levels are far too high and is largely responsible for the washed-out look you mention). I was wondring why you didn;t use your Studio 1 proc amp to adjust IRE levels and make use of its handy IRE levels meter.

To get an unmodified AVI cut from your original YUV or YUY2 capture, open the AVI in VirtualDub, make your cuts, then save the new sample using "Video..." -> "fast recompress" instead of full processing mode. Please don't deinterlace the sample from your interlaced original.

In any case, you might have to correct some serious problems in YUV before you can work on color. Does your original tape play with the obvious chroma smearing seen here? Some discoloration seems to come from incorrectly converting interlaced YUV to RGB/progressive, but it could just be old tape problems.

You will likely have some brightness level difficulties caused by the original camera's Autogain -- notice that your brightness levels are darker at the start of the clip when the sky is in the image, then gets brighter as the camera zooms in without sky, then gamma decreases when the bright tuba and other whites gain prominence. This is a common problem with consumer autogain; sometimes it can be improved, sometime you just have to live with it.

One small item: the name of the VDub curves filter is the "gradation curve", not "graduation". Or as the pricier software calls it, simply a "curves" filter.
:)

edit;
Oops, I meant to say, "interlaced YUV" to "interlaced RGB". Sorry. However, there's a so-so and a better way of making that conversion for VirtualDub.
:wink2:

sirbyron 02-15-2015 11:13 PM

Quote:

Originally Posted by sanlyn (Post 36646)
I was wondring why you didn;t use your Studio 1 proc amp to adjust IRE levels and make use of its handy IRE levels meter.

Thanks Sanlyn. Well, I'm new to this stuff. I thought the blacks were too black too but I was reading the manual and it says to keep black levels so that the "7.5 LED is on and the 5 LED never comes on" I made sure it didnt ever hit 5 but maybe 7.5 is too much for this video. It also says in the manual that the gain will move around between 60 and 100. I tried adhering to these rules also. Maybe I need to use judgement over levels sometime or maybe am I doing something wrong?

Quote:

Originally Posted by sanlyn (Post 36646)
To get an unmodified AVI cut from your original YUV or YUY2 capture, open the AVI in VirtualDub, make your cuts, then save the new sample using "Video..." -> "fast recompress" instead of full processing mode. Please don't deinterlace the sample from your interlaced original.

Will try doing this tomorrow night. Yes, should have just made original clip but I wanted to show what was happening when I tried adding more color. Thanks for the suggestion.

Quote:

Originally Posted by sanlyn (Post 36646)
Does your original tape play with the obvious chroma smearing seen here? Some discoloration seems to come from incorrectly converting interlaced YUV to RGB/progressive, but it could just be old tape problems.

I was playing around in the filters to correct some chroma on those blue skies. In the original there is a lot of chroma in the sky portion of the video. Dont know if the forum allows links but if it does, here is a xtube vid I posted several years ago that shows some of what I'm dealing with. I did use Roxio software to do this and yes, I realize the tube has manipulated the heck out of the video but maybe you can get some idea. http://youtu.be/YbTt8giw9ag


Quote:

Originally Posted by sanlyn (Post 36646)
One small item: the name of the VDub curves filter is the "gradation curve", not "graduation". Or as the pricier software calls it, simply a "curves" filter.
:)

lol Thanks for correcting me on that! It was late and I'm still learning. :)

Ok .. I'll try to get a new sample posted tomorrow night sometime . Thanks!

lordsmurf 02-16-2015 05:34 AM

Quote:

Originally Posted by sanlyn (Post 36646)
then save the new sample using "Video..." -> "fast recompress" instead of full processing mode.

Why not "direct stream copy"? That's what I use. :unsure:

sanlyn 02-16-2015 06:23 AM

Yep. Direct stream copy works too.

@sirbyron: The first video sample appears to have been captured using composite cable. That's a guess, but that's what some of the chroma noise looks like. Use the s-video output on your AG-1980, not composite. Don't confuse "SVHS" with "s-video". SVHS is a tape format, just as VHS and DVD are formats. s-video is a type of data transmission that can be used with VHS, SVHS, DVD, etc.

What you say about the 7.5 and 100 IRE levels on the proc amp luma meter is correct, but not all scenes aor images will fill up all the lights. The meter is used to avoid dark crushing and bright clipping when scenes hit the extremes. Not all scenes will look that way. This is especially true of home made video and tape, where luma and color changes will vary from shot to shot, and even within scenes. The meter is used for monitoring and correction in worst-case scenarios. There will be lots of post-processing fixes anyway. No one ever made a VHS capture with "perfect" levels everywhere. Some tapes can be ornery, with some segment or other that is so out of whack with the rest of tape tape that it 's often recaptured with better settings and patched into the main video later. After a couple of caps you'll get a feel for what can be fixed later and what's just screwed up. Also, remember that black borders will often make the IRE 5 light 'blink" somewhat. If you see that IRE 5 or the "CLIP" lights are on or blinking all the time, it's trouble.

Losslessly compressed huffyuv or Lagarith will be around 1/3 the size of the same uncompressed clip.

sirbyron 02-16-2015 07:19 PM

1 Attachment(s)
I keep trying to save under the file names you both suggested but anything other than "Full Processing Mode" keeps giving me a green screen with audio. What am I doing wrong?

-- merged --

Ok ... somehow got the "green screen" issue fixed. Recaptured video and saved via "fast recompress"

@sanlyn: I did capture via Svideo. This is a second generation (maybe third) "SP" copy if that makes a difference..I'm sure it does. Really wish I had the original but that just cant be done. I bumped the settings on the proc amp by 1 notch (black and gain to the right one). On the previous edited sample the black was at O and the gain was pretty much zero .. maybe a hair to the right. This is pretty much the same way it comes out of my AG1980. Maybe a hair darker without the proc amp but not much. If I try going any brighter (turning gain or black to the right) it just washes everything out too much. I still see some very dark black areas but as I say, if I try getting rid of them, it washes everything out.

I hope I saved the file correctly. After I cut the areas I went as follows:

>Video>Compression>Huffy v2.1.1 (original setting was uncompressed RGB/YCbCr)
then:
>Video>Fast Recompress
then:
>File>Save As AVI

Hope this helps.

ALSO... Is it common to then take the saved file in VDub and then edit it more in another editor like Adobe or one similar? If so, do you recommend one or better yet a free one? Vdub has got a ton of stuff so I dont know if what I am asking even makes sense! Avisynth comes to mind. Like I say I am new to this but does Avisynth work pretty much like Vdub or more of a totally different application?

lordsmurf 02-17-2015 06:54 AM

Some serious hobbyists are a bit too anal when it comes to re-encoding. Yes, avoid it when you can, but some of them make an already-difficult project *more* difficult by trying to avoid more encode passes. Yes, it may save some time or space, but I'm more worried about human time, not CPU time. I'm not at all worried about space.

As long as re-encodes are lossless, it's fine. Video allows for quite a few re-encodes before damage takes place. The key is to learn what kind of re-encodes are okay, and which are not. Even high-end lossy encodes like ProRes422 are fine.

For example:
Capture
> Avisynth > VirtualDub, re-encode
> more VirtualDub, re-encode
> Premiere, re-encode
> MPEG-2 final encode

^ This is typical for tape work, and plenty fine if it stays in the lossless domain.

Frameserving to Premiere, for example, trying to avoid re-encodes, is a giant PITA. The project will take *much* longer that way!

Do pay attention to colorspaces. That's what gets you. ;)

sanlyn 02-17-2015 01:27 PM

4 Attachment(s)
Quote:

Originally Posted by sirbyron (Post 36691)
This is a second generation (maybe third) "SP" copy if that makes a difference..I'm sure it does.

It sure does. Great way to bork a video. Ouch!! But work with what you have, there's no other source.

Thanks for the new sample. However....

Quote:

Originally Posted by sirbyron (Post 36691)
I bumped the settings on the proc amp by 1 notch (black and gain to the right one). On the previous edited sample the black was at O and the gain was pretty much zero .. maybe a hair to the right.

Oh my. The opposite of what you should have done. The new sample is brighter. Remember, the black borders are going to stay near the left side of a histogram (that's where black is). Adjust "black" counter-clockwise or whatever to adjust blacks, then adjust gain to increase/decrease the brights. The two controls interact, so you often have to juggle a bit between them. With most tapes it'll never be perfect. Correct more later in post-processing. All you accomplished by turning up both controls was to brighten darks and brights alike, and make gamma correction all but impossible.

However, it should have been obvious in the preview window that the frame below (frame 166) and all the others are far too bright:
http://www.digitalfaq.com/forum/atta...1&d=1424199495

Histograms and other 'scopes make it very clear. Below, the left-hand image is the simplest of Avisynth histograms ("Levels" mode) is , the right-hand image is VirtualDub's ColorTools RGB histogram:
http://www.digitalfaq.com/forum/atta...1&d=1424199799

[above, left]: The left-ward pointing pink arrow on the left side shows the shaded "unsafe range" below RGB 16 -- OK for a black border to be in this area. The pink arrow pointing to the right of the graph shows the unsafe area over RGB 235 -- data in this area for frame 166 shows bright clipping. When brights are clipped, it's another term for "per5manently destroyed". The downward pink arrow in the middle of the Avisynth Levels 'gram shows that the blackest point for objects in the image are around RGB 40, way too high. Note that the highest peaks in the histograms (midpoints) are shoved to the right -- midpoints should usually be closer to the middle, dashed line. Flesh tones normally would be in the mid area.

[above, right]The RGB histograms show the black border at the far left. Midtones and everything else are shoved to the right. The up-pointing pink arrow shows where the black point lies, which is nowhere near "black". It's not just darks that are washed out, it's almost everything in the image.

Below, an RGB waveform monitor. In this type of display, darks are at the bottom of each channel, brights are at the top. The pink left-arrow points to RGB-0 black, which is where the video's black border is. Along the bottom of each horizontal channel, note the gap with no specs or other info along the bottom of the channels (darks are too bright). Four pink arrows point upward to the top of each channel, showing how luma and colors are shoved to the top and flattened out -- indicating hard clipping.
http://www.digitalfaq.com/forum/atta...1&d=1424200409

Attached is a video of the sample clip, showing another problem. Consumer camera autogain is the work of the devil. Causes no end of grief. As the video plays, you'll see on the right side how a histograms tracks level and saturation changes every time the camera moves. The histogram has a frame counter. At one point the histogram values zoom off to the right, outside valid video range. At the very end of the clip, note how the big peak in the middle (gamma) snaps visibly darker when the gal turns away and brighter objects take over.

You can correct some of this later with filters, but not all of it. Don't ever try to correct it with another autogain filter during capture -- it will just make it worse.

sanlyn 02-17-2015 02:39 PM

2 Attachment(s)
Quote:

Originally Posted by sirbyron (Post 36691)
ALSO... Is it common to then take the saved file in VDub and then edit it more in another editor like Adobe or one similar? If so, do you recommend one or better yet a free one? Vdub has got a ton of stuff so I dont know if what I am asking even makes sense! Avisynth comes to mind. Like I say I am new to this but does Avisynth work pretty much like Vdub or more of a totally different application?

Edit and make other mods in just about anything, but keep it lossless huffyuv or Lagarith until the final encode. Most free editors don't offer much in the line of features, and none offer VirtualDub's color filters except for the big "pro" guys from Adobe and SONY, etc.

Avisynth is a scripted utility. Scripts are most easily run in VirtualDub (for me, anyway). There are currently several threads in progress that use Avisynth. I had to use Avisynth to make levels corrections and other cleanup with these samples, with most of the color attempts in Virtualdub.

The captured samples are, basically, overexposed. This means more than just a bright picture and makes many corrections look weird because you're using filters to try to overcompensate for capture errors. Trying to stretch distorted luma and chroma almost always look, well, overworked.

original frame from sample-b. It should have been obvious during capture that the image is too bright. And take note of the lighting in this image. It's late afternoon sunlight from off right, so the lighting itself should look at least slightly warmish, some areas would be tinted with Fall colors. Autocolor on the camera twisted the histogram around rather crudely -- and, yeah, the color balance changes slightly but visibly during the zoom. Pretty tough to work with.
http://www.digitalfaq.com/forum/atta...1&d=1424205238

Overwroughrt effort at correction, involving 6 Avisynth plugins and three chained gradation curves:

http://www.digitalfaq.com/forum/atta...1&d=1424205366

Where you end up will be a matter of (a) personal preference, (b) using the right tools, (c) learning to work with histograms, and (d) patience. Much better to get as close as you can during capture and avoid a lot of hard work.
:wink2:

lordsmurf 02-17-2015 06:17 PM

That's probably oversaturdated some.
The blacks are little too crushed. Is your monitor IPS and calibrated?
Align the chroma.
Did you remove that black comet (magnetic dropout)?
Yes, crude, but good sample of where the color can go. VHS has many possibilities.

I really need to get that guide for Avisynth usage done. I may try to do that this weekend finally.

sanlyn 02-17-2015 08:27 PM

Quote:

Originally Posted by lordsmurf (Post 36780)
That's probably oversaturdated some.

Yep. I thought so too, later. Official Standard Operating Procedure:
1. work 'til it looks about right.
2. come back half a day later and check.
3. go to step 1.

Quote:

Originally Posted by lordsmurf (Post 36780)
The blacks are little too crushed.

They're crushed in the original. See darkish gray "patches" in earlier image.

Quote:

Originally Posted by lordsmurf (Post 36780)
Is your monitor IPS and calibrated?

Yes. both of 'em. Corollary #5 to Official SOP: don't work in bright light.

Quote:

Originally Posted by lordsmurf (Post 36780)
Align the chroma.

ChromaShift(c=-6,u=-2,L=-4)
MergeChroma(awarpsharp2(depth=30))
MergeChroma(awarpsharp2(depth=20))
(Tried dehalo's and some masking too, but some edges are just too ragged to hold up).

Quote:

Originally Posted by lordsmurf (Post 36780)
Did you remove that black comet (magnetic dropout)?

Yes. A few thinned-out, short pale whities survive here and there. Mostly gone.
http://www.digitalfaq.com/forum/atta...1&d=1424225543

Quote:

Originally Posted by lordsmurf (Post 36780)
Yes, crude, but good sample of where the color can go. VHS has many possibilities.

LOL, if see it again 2 days from now it'll look different again.

Quote:

Originally Posted by lordsmurf (Post 36780)
I really need to get that guide for Avisynth usage done. I may try to do that this weekend finally.

Great! A fairly rough draft will likely do. As soon as it's posted, 2000 readers will want to change it anyway.

Thanks for the feedback. As usual, lordsmurf keeps us slackers on the ball.

lordsmurf 02-17-2015 08:32 PM

Quote:

Originally Posted by sanlyn (Post 36799)
1. work 'til it looks about right.
2. come back half a day later and check.
3. go to step 1.

Yep. :congrats:

Quote:

Yes. both of 'em. A lesson neglected: don't work in bright light.
And let you eyes adjust afterwards! Learn from my mistakes. ;)

Quote:

Great! A fairly rough draft will likely do. As soon as it's posted, 2000 readers will want to change it anyway.
If the readers have good advice, I'm always open to it. :)

sirbyron 02-17-2015 10:01 PM

1 Attachment(s)
Well, first off thanks again to you both. I'm really "slowly" learning stuff here and love it. ;)

The edited still looks super Sanlyn! ...maybe a "tad much saturation" but hey .. I like it. I didnt know about the "colortools" plugin and the histogram. Heard of it before but didnt know exactly what it was. I did run several passes through and checked it before I uploaded it here. Is this one ok before going on to the processing round? As much as I tried working to get those dark blacks out, I just couldnt. I turn it one way and they get worse along with every other dark shade turning black (meters at 5 and even worse). Then turn the other way and they dont really even change much. The video just gets too white like the first "sampleb", even when trying to adjust the gain with it. Is it just the tape condition causing this or am I still doing something wrong? I dont see how though as much as I've been working it.

I dont have Avisynth so I couldnt run that histogram. Ok, let me know about this one. Thanks.

sanlyn 02-18-2015 07:53 AM

1 Attachment(s)
Thanks for the new Sample C and your patience. Looks better and will be easier to work with. So, from this capture I get a clearer idea that the original tape is pretty well washed out to begin with. We've seen worse -- a dupe tape-to-tape made at the wrong IRE setting is pretty common. But the image below shows that brights have better detail and colors don't look as weird:

http://www.digitalfaq.com/forum/atta...1&d=1424265081

Doesn't look that much different than earlier, but nevertheless it is. I guess you learned a little about the proc amp as well, seems that you used settings that pulled darker detail down to a workable level and kept brights from blowing away in that big spike during the zoom. Good work. The RGB histogram ain't perfect, but it's a better starting point and can be fixed in post processing. Crushed blacks and clipped brights, though, would be irreparable.

A note on these histograms. There are a whole slew of histogram types. They all show the same thing, just in different ways. The histogram shown here is common. It breaks down each color and the overall brightness level, making things a little more intuitive. YUV histograms are used to show how video data in a YUV colorspace is stored. Most RGB histograms show video data as displayed on a PC or TV. The type of YUV data storage in VHS/DVD/BluRay uses a colorspace that can contain a wider range of contrast and chroma levels than sRGB (PC's) or TV-RGB. When converting from YUV to RGB, YUV values that exceed RGB 0-255 (RGB 16-235 for TV) will get clipped in RGB. So, that conversion should be managed with some care. Avisynth has simple DOS-like conversion filters and settings that do it properly. It's usually the case that bad levels in YUV can best be corrected in Avisynth using the original YUV data. I do most color work in RGB (VirtualDub, After Effecfts, etc.), but I use Avisynth for prep work. TMPGenc's encoders have excellent color filters that work in YUV and RGB.

I guess you see Avisynth mentioned all over the place. Don't be intimidated. It can be used on a super-arcane geek level, but also on a more basic level for simple but often essential tasks that otherwise must be managed with high-priced stuff that most of us mere mortals can't afford. Many hobbyists on the planet use it and -- surprise, surprise -- so do many pros. An Avisynth script is simply a text file that can be opened in VirtualDub like a regular video, and VirtualDub can be used to monitor Avisynth's output so you can see exactly what's going on.

I'll work with this Sample C critter today. I'm capturing a tape right now on another PC. So I guess today is another day for multi-tasking!

Quote:

Originally Posted by sirbyron (Post 36804)
I dont have Avisynth so I couldnt run that histogram. Ok, let me know about this one. Thanks.

It's actually simple. Might not seem that way at first, but folks do it all the time. The Avisynth text script opens the AVI, and somewhere in that script you add this statement:
Code:

Histogram(mode="Levels")
The Histogram function can be set for other modes that display different kinds of 'scopes. Avisynth's help file on that function or command explains it all. Not all that complicated.
:wink2:

sirbyron 02-18-2015 11:47 PM

Quote:

Originally Posted by sanlyn (Post 36815)
I'll work with this Sample C critter today. I'm capturing a tape right now on another PC. So I guess today is another day for multi-tasking!

Thanks! I'm getting in pretty late so tomorrow night I'll read through this post some more. Lots of good info I am soaking up here and much appreciative! ;)

So I guess I need to "download" an Avisynth file(program) to use it?

sanlyn 02-19-2015 08:03 AM

Quote:

Originally Posted by sirbyron (Post 36837)
So I guess I need to "download" an Avisynth file(program) to use it?

It has a learning curve, depending on how deeply you want to get into it. Give yourself time. There are several versions. Stick with 32-bit only (there's a 64-bit version but hardly any 64-bit filters, so don't even go there).

The very latest version is RC1, but it hasn't been around long enough for a final judgment. The preferred download for newbies (which includes all of us perpetual newbies, I think!) is Avisynth 2.6.0 Alpha 5. They're all listed here: http://sourceforge.net/projects/avis...lpha_Releases/ . Look for "AVS 2.6.0 Alpha 5 [130918]" near the top of the list. Create a new folder in your PC -- call it "AVS26" for short -- so you can keep it in that separate folder. Don't worry, you'll soon have some subfolders in that main folder.

Click on the link to AVS 2.6.0 Alpha 5 and you go to a new page to download "Avisynth_130918.exe" into your new folder. This is the installer, which is pretty straightforward. When it runs, take the defaults, but further down in the default list you can check an item to associate .avs scripts with Notepad -- which means that if you have an avs script in your computer and you double-click, it will open in Notepad. Don't associate it with other stuff like media players.

The default install location is "C:\Program files\Avisynth 2.5". If you're using 64-bit Windows, the default is "C:\Program files (x86)\Avisynth 2.5). Yes, it likely says "2.5" instead of 2.6, but that's a convenience for those who have 2.5 versions already on their computer. If the default location says "2.6", accept it and don't worry about it. The default drive location is your C: drive, but you can change that (mine is installed in "D:\Avisynth 2.5" in case I lose my operating system but want to keep my Avisynth plugins folder separate and intact). If you have no other drives or partitions, then C: is your only choice. Wherever you install it, that drive and location will be a registry entry, so don't move or rename that installed folder.

The Avisynth program folder will be rather small one with a handful of files and a couple of subfolders. One thing you won't see there is something called "Avisynth.exe" because there's no such file name. The main engine for Avisynth is Avisynth.dll, which will be in your Windows system32 or Windows SYSWOW64 in 64-bit systems. Don't save your home-made .avs scripts in Avisynth's folder. Most people keep their scripts in a folder with their video project.

In your Windows program listings you'll see a program group for Avisynth. There's a subfolder in that program group for the online documentation. The same documentation is on the 'net at the Avisynth Wiki (http://avisynth.nl/index.php/Getting_started).

First script: First timers are told they can make the simple "version" script and run it in a media player. Well, that depends on the player and the system. Just use VirtualDub to run .avs scripts to avoid a hassle. You'll do it that way most of the time anyway. Yes, you can use other apps -- for example, there's an After Effects plugin for Avisynth.

If you want to open one of your videos with Avisynth in VirtualDub, make a script for it in Notepad. In Notepad be sure to use "Format" -> and turn off Word wrap. When you save the script, look at the bottom of Notepad's window for the "Save as type" entry panel. Change it from "Text documents (.txt)" to "all files". Then save the script with whatever name you want, but be sure to add ".avs" at the end of the file name so that Windows won't automatically append ".txt" to the name.

To run the script, open VirtualDub, go to "File..." -> "Open video file...", find the .avs script, and open it. Voila!

If you have a problem, it's usually a typo. You can leave VirtualDub open, open the script in Notepad in a separate window, make changes, then in VirtualDub use "File..." and the open dialog again to re-run it.

I used this script to open your sample C just to watch it without doing anything:

Code:

AviSource("E:\forum\sirbyron\Chs1981Samplecc.avi")
Note the path statement in quotes. That's where your video is located on my 'puter. Change that drive and path statement to match the location of the video in your system.

If you wanted to prepare that YUY2 video for use with VDub's RGB filters, you should do it this way:

Code:

AviSource("E:\forum\sirbyron\Chs1981Samplecc.avi")
ConvertToRGB32(matrix="Rec601",interlaced=true)

Again, don't forget to change the path to match your system. The AviSource() and "ConvertToRGB32()" functions are built-in Avisynth commands, so no extra filters are needed.

To view that YUV histogram I mentioned, you'll have to add a few lines:

Code:

AviSource("E:\forum\sirbyron\Chs1981Samplecc.avi")
ConvertToYV12(interlaced=true)
Histogram(mode="levels")
ConvertToRGB32(matrix="Rec601",interlaced=true)

You can bypass that YV12 and Histogram change by deleting them -- Or, to keep it around for later use you can comment-out the two lines. A comment is indicated by "#". Comments are not executed. I show the # in blue here:

Code:

AviSource("E:\forum\sirbyron\Chs1981Samplecc.avi")
# ConvertToYV12(interlaced=true)
# Histogram(mode="levels")
ConvertToRGB32(matrix="Rec601",interlaced=true)

While you have that script open in VirtualDub, stop it on any frame. Leave VirtualDub open as-is, and in Notepad, change the script to the following and save it:

Code:

AviSource("E:\forum\sirbyron\Chs1981Samplecc.avi")
ColorYUV(off_y=-8)
ConvertToRGB32(matrix="Rec601",interlaced=true)

In VirtualDub use "File..." -> "reopen video file". After a second or two the same frame will display and will show the darker frame as adjusted in the script.

ColorYUV() is a built-in filter. Have fun. :wink2:

sirbyron 02-19-2015 09:01 PM

Quote:

Originally Posted by sanlyn (Post 36842)
Code:

AviSource("E:\forum\sirbyron\Chs1981Samplecc.avi")
ColorYUV(off_y=-8)
ConvertToRGB32(matrix="Rec601",interlaced=true)

In VirtualDub use "File..." -> "reopen video file". After a second or two the same frame will display and will show the darker frame as adjusted in the script.

ColorYUV() is a built-in filter. Have fun. :wink2:

Ahh.. Very interesting changing the ColorYUV values around. Dont really know what I'm doing yet but as I change the value + or - certain degrees I see it does brighten and darken the clip. Will continue to experiment and try reading up on some scripts.

Just to make sure I am understanding correctly... The first line of the code will be the file location and the last line will always be "ConvertToRGB32(matrix="Rec601",interlaced=tru e)" when opening up the file in Vdub. Anything in between these lines is an edit script or a "viewer ... ie histogram".

So I would never alter the "ConvertToRGB32(matrix="Rec601",interlaced=tru e)" line if I always edit my videos as I am currently doing? Just for curiousity, what does matrix="Rec601" mean?

As I understand it, anything done in Vdub is "after" it is being edited in Avisynth? In other words, if it were a chain it would be:
1) Avisynth opens up. (Inside of Vdub)
2) Edits are performed in Avisynth using scripts
3) Avisynth Converts to RGB (per script in code)
4) Then Vdub takes it from there to perform more edits.

Ok.. enough for the brain tonight. I'll read up on some Avi scripts.

Quote:

Originally Posted by sanlyn (Post 36842)
Overwroughrt effort at correction, involving 6 Avisynth plugins and three chained gradation curves:

On the sample b you worked on, you mentioned "plugin". Is this the same as a script? And were the 3 gradation curves in Vdub?

Also wanted to ask... are the "TMPGenc's encoders" for the final output file? Or are they additional editing encoders?

And just visited 'Smurfs post on Avisynth scripts here ... cant wait: http://www.digitalfaq.com/forum/news...-avisynth.html Thanks Lordsmurf!

Ok... starting on the "fun". :)

lordsmurf 02-19-2015 11:12 PM

I hate color correcting in Avisynth, and almost never do it.

I'd rather use:
- VirtualDub, especially Color Mill
- Adobe Premiere, and I use CS4

For me, Avisynth is only used for specific errors that are not as easily done in Vdub or Premiere.

Script-based corrections take forever. This really is a GUI workflow.

sanlyn 02-20-2015 07:09 AM

Quote:

Originally Posted by sirbyron (Post 36856)
Ahh.. Very interesting changing the ColorYUV values around. Dont really know what I'm doing yet but as I change the value + or - certain degrees I see it does brighten and darken the clip. Will continue to experiment and try reading up on some scripts.

The sample script above contains what you'd call stock tools (functions) with commonly used settings. I'd do most color work in VirtualDub, After Effects, or often with TMPGenc encoders' color filters. Filters like ColorYUV are generally used to fix invalid video levels in the original colorspace before moving on. http://avisynth.nl/index.php/ColorYUV

Quote:

Originally Posted by sirbyron (Post 36856)
Just to make sure I am understanding correctly... The first line of the code will be the file location and the last line will always be "ConvertToRGB32(matrix="Rec601",interlaced=tru e)" when opening up the file in Vdub. Anything in between these lines is an edit script or a "viewer ... ie histogram".

Well...Not exactly, but close. The first line isn't always "AviSource" -- but, naturally, if you want to do anything in Avisynth, you first have to open the video. A script is executed line-by-line, in order as they appear in the script. Most Avisynth filters run in YUV; you want to stay in that colorspacxe until time for something else.

AviSource is a function that accesses a video source. You have to tell AviSource the filename and location. The stuff in parentheses is the value we give a function to work with (technically known as the "argument", but we just call it parameter, value, setting, etc.). AviSource opens specific video types. It requires that the video's codec is installed on your PC. If your source files are compressed with huffyuv, and huffyuv is in your system, you're safe so far.

AviSource can also open many DV-AVI files. It assumes you have a proper DV codec installed, or it gets really upset. Other internal and external functions open other formats: DirectShowSource, FFMS2, NicAudio, QTSource, MPEG2Source, etc.

Quote:

Originally Posted by sirbyron (Post 36856)
So I would never alter the "ConvertToRGB32(matrix="Rec601",interlaced=tru e)" line if I always edit my videos as I am currently doing? Just for curiousity, what does matrix="Rec601" mean?

You can alter that line if necessary. If the file isn't interlaced, you don't need "interlaced=true". The default interlace value is false. "Rec601" is an RGB 16-235 color matrix for conversion and scaling between color systems. There are other possibilities. You might not need VDub filters, so you wouldn't need RGB conversion. Avisynth's developers have optimized those conversions, something that many apps -- including some very big names -- don't do properly.

Quote:

Originally Posted by sirbyron (Post 36856)
As I understand it, anything done in Vdub is "after" it is being edited in Avisynth? In other words, if it were a chain it would be:
1) Avisynth opens up. (Inside of Vdub)
2) Edits are performed in Avisynth using scripts
3) Avisynth Converts to RGB (per script in code)
4) Then Vdub takes it from there to perform more edits.

You can apply VDub filters to incoming results from Avisynth -- in fact, while the results come in. But it does slow the overall process, maybe a little, maybe a lot. Some Avisynth industrial-strength filters are so pokey you'll go bonkers trying to tweak your VDub stuff and waiting for a frame to refresh. You can save Avisynth output to another lossless AVI, then open in VDub later.

Quote:

Originally Posted by sirbyron (Post 36856)
On the sample b you worked on, you mentioned "plugin". Is this the same as a script? And were the 3 gradation curves in Vdub?

"plugin" = "filter". You put your VirtualDub filters in your VirtualDub "plugins" folder, right? Same with Avisynth. VirtualDub filters have .vdf file names. Avisynth has .dll, .avs, and .avsi. Many Avisynth filters are actually scripts, for techy reasons best known to their developers.

Quote:

Originally Posted by sirbyron (Post 36856)
Also wanted to ask... are the "TMPGenc's encoders" for the final output file? Or are they additional editing encoders?

They're standalone encoders for final output. Ye olde TMPGenc Plus 2.5 is still a good MPEG encoder with nice color filters. Newer versions have more edit functions but basically they're encoders. Another good MPEG encoder (free) is HCenc, which takes its input from AVisynth.

Don't forget: lots of documentation is installed by Avisynth. Go to "Start" -> "All programs" -> "Avisynth 2.5". Expand that program group and click on "Avisynth documentation". On the first page, at the top left you'll see a top banner labeled "OVERVIEW". Just under that is a small grid with the letters "a b c d" to z. Click on a letter to see the grim details about functions whose names start with those letters. You'll never use most of those functions. The page's left-hand margin lists other goodies, like how to use "#" and "\" and other tricks. The same content is available at this website: http://avisynth.org.ru/docs/english/.

Don't try to grasp everything. You can get worn out quickly. Let it "drip" in as it's needed. You definitely will not need 100% of this stuff, not by a long shot.

Been busy here lately, but I'm working on your sample C and will post soon. Maybe others will come up with something as well.

sanlyn 02-20-2015 12:03 PM

2 Attachment(s)
Okay. What follows might be tough, ir easy, but you have to start somewhere.

Working with crappy video requires heavy hitters from Avisynth. People will have different idfeas about exactly how to handle something, but one of the essential tools in Avisynth is QTGMC. It comes as a script ending in .avsi, and it's a long, long piece of text. It does a lot of work. Mainly it deinterlaces, but also denoises. It can generate some repairs, too. To do all that it depends on a several support files (plugins), most of which are standalone filters in their own right.

There are three types of Avisynth plugins:
- A .dll file, which Avisynth can find automatically when it starts.
- An .avsi text file, a script that Avisynth can find when it's needed.
- A plain .avs script, which you have to load manually with the Import() function.

All plugins belong in Avisynth's plugins folder. Many plugins download as a package containing multiple files, such as the plugin itself and some documentation. Don't downlodd these directly into Avisynth plugins. Make yourself a folder on your PC and call it "AVS" or "filters" or whatever you want. Inside that folder, make subfolders for every Avisynth filter that you download (you'll soon have utter chaos without those little subfolders, as you will discover today!). Download the package to a subfolder you create for it, then unzip it in there. All you need to copy into Avisynth's plugins will be the plugin itself. Don't put html's, read-me's, or other stuff in the plugins folder. When you later find more info on that filter, you'll have a place where you can keep and quickly find your notes.

Many cleanup filters work only with deinterlaced video. Never fear; you can reinterlaced later. For VirtualDub color work, it can usually be interlaced. There are many Avisynth deinterlacers, but for repair and sharp output you need QTGMC. No substitute, really. So we may as well start with that.

I started work on Sample C by trying to clean some color corruption. This is almost always done in Avisynth in the video's initial colorspace, which for sample C is YUY2. You'll have to change that colorspace for some filters, but there's a proper way to do it.

I started with this deinterlaced frame (370). Its original interlaced frame number is 185. To help you s ee what's being worked on, I added color saturation to the orighinal frame. Eventually you'll have add saturation anyway:
http://www.digitalfaq.com/forum/atta...1&d=1424455265

Four pink left-pointing arrows indicate chroma smear, bleed, and displaced color (chroma shift). In the lower right, note that the curved logo on the podium seems to have 5 color bands -- there should only be 4 -- and the "C" has some blue bleeding into it. The left border has some cute pink and blue lines we can do without. If you later sharpen this junk, it looks worse.

Below, after running some Avisynth plugins. It'll never get completely clean, but this will do for a start. Can do more later in RGB for better color.
http://www.digitalfaq.com/forum/atta...1&d=1424455329

In the next post I'll show the script I used and how to load the filters.

sanlyn 02-20-2015 01:30 PM

1 Attachment(s)
OMG, another long post. Sorry,people.

The script below was used for initial chroma cleanup as shown in the previous images. I'll explain the filters and how to get them. Those used here are attached below. All of them are in standard use everywhere. You'll see them often.

Code:

Import("D:\Avisynth 2.5\plugins\chubbyrain2.avs")

AviSource("E:\forum\sirbyron\C\Chs1981Samplecc.avi")
Crop(14,0,0,-10).AddBorders(2,0,0,2)
ConvertToYV12(interlaced=true)
AssumeTFF().QTGMC(preset="medium",EZDenoise=1)
ColorYUV(off_y=-14)
Cnr2("xxx",4,5,255)
ChromaShift(c=-8,u=-2,L=-4)
chubbyrain2()
MergeChroma(awarpsharp2(depth=40))
MergeChroma(awarpsharp2(depth=20))
ConvertToRGB32(matrix="Rec601",interlaced=false)

Like all first efforts, this is a trial run. Can be adjusted later.

Import("D:\Avisynth 2.5\plugins\chubbyrain2.avs") imports the script of an .avs plugin. The developer spent time on this, so don't change anything. All the import statement does is bring a copy of the plugin into Avisynth. It's easier than copying the text of the plugin yourself.

Note that I have some path locations in this script that you'll have to adjust to match the locations in your PC. My Avisynth program folder is at D:\Avisynth 2.5, but yours is probably in C:\Program files\Avisynth 2.5, or whatever.

Also note that your avi sample will have a different location in your system.

Crop(14,0,0,-10).AddBorders(2,0,0,2): Let's cut off most of the black borders to keep from affecting some of these filters. I cut off 10 pixels from the left, none from the top, none from the right border, and 10 from the bottom border. There are crop restrictions depending on colorspace (at this point in the script your video is YUY2). AddBorders adds some black border pixels to the left side and the bottom. Why? Because the script will soon convert the colorspace to YV12 and all dimensions for YV12 must be mod-4 for cropping. (mod-4 = equally divisible by 4). The resulting frame size will be 628x472. We can adjust that again later. Note that this statement involves two steps, separated by a period.

ConvertToYV12(interlaced=true): Most filters that follow the Crop statement require YV12 color.

AssumeTFF().QTGMC(preset="medium",EZDenoise=1): Okay, well, here's the big fella. It's set to "medium" defaults, so its about medium-fast. Or medium-slow, however you want to look at it. It requires a dozen support plugins, all of which are in the attached plugins .zip. They're also available in the doom9 forum. QTGMC will deinterlace this clip, doubling the frame rate and the number of frames. Reason: the filters that follow it require progressive video. So if you look at "File Info" in VirtualDub it will say 746 frames @59.940 fps. AssumeTFF() ("Top Field First") is an Avisynth function. Otherwise it would assume BFF, which is wrong for this video.

ColorYUV(off_y=-14): Reduce the brightness of all pixels by about 14 points. Will be adjusted later. The sample frames posted earlier are from the brightest point in the sample.

Cnr2("xxx",4,5,255)
ChromaShift(c=-8,u=-2,L=-4)

chubbyrain2()

These are chroma cleaners. They're included in the .zip file, each in their own folder inside the .zip. The text string that's fed to cnr2 is a recommended setting for crappy VHS. It can be adjusted. Chubbyrain2.avs requires an additional plugin (BiFrost.dll), which is also in the .zip. ChromaShift.dll will shift the position of colors using a semi-transparent mask and other tricks, in this manner: C=-8 shifts all colors 8 points to the left, u=-2 shifts the blue channel 2 pixels to the left, L=-4 shifts all colors 4 pixels upward. We'll do more of this in RGB later.

MergeChroma(awarpsharp2(depth=40))
MergeChroma(awarpsharp2(depth=20))
Two rounds of this filter to help with smeared chroma. The sharpener itself tends to tighten edges, depending on how much area around the edges we want to work with ("depth"). There are other settings that can get pretty hairy, but keep it simple for now. "MergeChroma" is an Avisynth function. What it does is take the results of the awarpsharp2 filter and apply only the chroma filtering to the existing video, leaving the original "y" (luma) channel as-is to preserve more detail.

ConvertToRGB32(matrix="Rec601",interlaced=false): I guess you know what that does, done here only for viewing. We'll do more YUV work later. Note that "interlaced" is false (because the video is now deinterlaced), so I could just as well have written "ConvertToRGB32(matrix="Rec601". But I like to keep the interlaced thing in there just to make me feel comfy.

The attached .zip contains 4 folders: aWarpSharp2, Cnr2, ChubbhyRain2, and QTGMC. It will unzip into separate folders, and inside each folder are the filters. QTGMC has 3 subfolders and instructions in each subfolder, so be sure to look at the "read Me" stuff and "Where to put these files". Anything with .dll, .avsi, or .avs should be copied into the Avisynth plugins folder. The rest stays put. QTGMC has a couple of "Windows system" dll's that DO NOT BELONG in Avisynth. They are not Avisynth plugins, but you better have 'em around. The subfolder with those two dll's tells you where they go. Most of QTGMC's support plugins can be used alone, and are used by many other filters.

First time around, there are bound to be problems. Nothing that can't be solved. If you get errors, post the exact text of the message.

And don't worry yet. The tough part will be color in VirtualDub.

sirbyron 02-20-2015 11:16 PM

Got everything loaded and working, no problems! :salute:

This is a big help and i am most grateful. Had to familiarize myself with Avisynth "plugins" vs "functions"... that threw me for a few secs.

Quote:

Originally Posted by sanlyn (Post 36890)
Crop(14,0,0,-10).AddBorders(2,0,0,2): Let's cut off most of the black borders to keep from affecting some of these filters. I cut off 10 pixels from the left, none from the top, none from the right border, and 10 from the bottom border. There are crop restrictions depending on colorspace (at this point in the script your video is YUY2). AddBorders adds some black border pixels to the left side and the bottom. Why? Because the script will soon convert the colorspace to YV12 and all dimensions for YV12 must be mod-4 for cropping. (mod-4 = equally divisible by 4). The resulting frame size will be 628x472. We can adjust that again later. Note that this statement involves two steps, separated by a period.

I understand this for the most part except that if you cut 10 from the left, why does it say "14"?
I understand mod-4 = equally divisible by 4. I am thinking 2 + 14 = 16 (which is still divisible by 4) and -10 + 2 = -8 (also divisible by 4).

I dont think the zip file had the Cnr2 plugin. I found it and downloaded it though. No prob. Thanks for that zip file. Made things a lot easier. :wink2:

Quote:

Originally Posted by sanlyn (Post 36890)
Reason: the filters that follow it require progressive video. So if you look at "File Info" in VirtualDub it will say 746 frames @59.940 fps. AssumeTFF() ("Top Field First") is an Avisynth function. Otherwise it would assume BFF, which is wrong for this video.

So is it TFF because its interlaced, then the QTGMC plugin deinterlaces it and it becomes progressive?

Quote:

Originally Posted by lordsmurf (Post 36860)
I hate color correcting in Avisynth, and almost never do it.

I'd rather use:
- VirtualDub, especially Color Mill
- Adobe Premiere, and I use CS4

For me, Avisynth is only used for specific errors that are not as easily done in Vdub or Premiere.

Script-based corrections take forever. This really is a GUI workflow.

Yeah...if possible I do like using the Vdub filters..really like Color Mill from what I've experimented so far. I do need to get me a good program also such as Adobe Premiere, etc. Scripts are a pain but if they correct my ole crappy tapes better I guess I can learn them .... as best as I can anyways! lol.

Ok..Saturday no work so I get to spend some time at home here on the video.

sanlyn 02-20-2015 11:45 PM

Ooops, You caught me red-handed in a typo. The correct numbers for Crop in the script are (14,0,0,-10), so it's 14 pixels off the left side instead of 10. It could have just 12, but there's 2 pixels of solid junk on the side that flutters during play. Anyway, typos do crop up (pardon the term) after you change a script 37 times, LOL!.

Actually the video isn't TFF because it's interlaced. It is interlaced using Top Field First as its field structure. That's in contrast with Bottom Field First (BFF), which is usually for DV. An interlaced frame will play 2 fields each second; the field priority of TFF or BFF tells your playback system which field is supposed to play first.

Any color work done in YUV will be only to secure valid and stable video levels. Those are general prep corrections before getting into RGB and VirtualDub or into other RGB apps for something more precise. Touchy color correction is difficult if not impossible in YUV -- but touchy invalid levels correction is difficult if not impossible in RGB.

It would be an understatement to say that the tape you're working with is thoroughly ruined. The original camera's autogain and autocolor has made, in this one short scene of your sample, what appear to be 3 distinct videos with three different luminance levels and color balance motifs. Color grading this beast involves a 3-stage correction process IMO. You'd need some masking, too, to fix that magenta stain along the top middle. Apparently the original tape was stored for several years in an oven next to an industrial humidifier and a huge electromagnetic device (!). I managed to make some progress with it, but I'm letting it steep overnight.

If you don't have the Lagarith lossless compressor, you'll need it to work with YV12. Simple install. Get it here: http://lags.leetcode.net/codec.html

sirbyron 02-22-2015 12:45 AM

Quote:

Originally Posted by sanlyn (Post 36899)
Ooops, You caught me red-handed in a typo. The correct numbers for Crop in the script are (14,0,0,-10), so it's 14 pixels off the left side instead of 10. It could have just 12, but there's 2 pixels of solid junk on the side that flutters during play. Anyway, typos do crop up (pardon the term) after you change a script 37 times, LOL!.

Good to hear because I thought my brain quit working. lol


Quote:

Originally Posted by sanlyn (Post 36899)
It would be an understatement to say that the tape you're working with is thoroughly ruined. The original camera's autogain and autocolor has made, in this one short scene of your sample, what appear to be 3 distinct videos with three different luminance levels and color balance motifs. Color grading this beast involves a 3-stage correction process IMO. You'd need some masking, too, to fix that magenta stain along the top middle. Apparently the original tape was stored for several years in an oven next to an industrial humidifier and a huge electromagnetic device (!). I managed to make some progress with it, but I'm letting it steep overnight.

Yes, I do realize the tape is pretty bad. Weird thing though is that it was transferred (recorded) around 1984 or 1985. I have had the tape in the house (not garage) and in its plastic case all these years. It is a Memorex Pro Series T120 tape. Of course all that means nothing if the original copy was trash. Someone else did the transfer all those years ago so I have no idea the quality of the tape he had, or what he recorded it from and to. As I recall it has been pretty much like this since then. I think the camera was just crappy maybe plus over the years I am sure it has deteriorated to some degree.

I realize its never going to be "great" or maybe even under most peoples standards "good" but I just want to go ahead and get it transferred now before it deteriorates more. To be honest there are 2 more competitions on this tape. The 2nd one is about the same but better color ... still chroma issues though. The 3rd is a nightmare because it was recorded at night under football field lights...tons of yellow/green smear. This one and the 2nd year I was marching are great compared to that last one! lol! :D

I'll get the Lagarith compressor installed tomorrow.

One quick question. On the QTGMC plugin, I assume you are only using "some" of all the tools in that plugin? So if thats the case do you edit the script frequently or just tell it which tools you want to use in parenthesis? i.e. in this case (preset="medium",EZDenoise=1)

Cant say it enough..thanks for the time and help on this! :salute:

lordsmurf 02-22-2015 03:12 AM

Quote:

Originally Posted by sanlyn (Post 36928)
It would be an understatement to say that the tape you're working with is thoroughly ruined.

No. You're overstating things. It's not "thoroughly ruined". The signal simply has mild color damage, which can be compensated for to a degree. Let's save "thoroughly ruined" for nth generation tapes with a dozen flaws or more.

I would actually suggest undersaturating it some, and darkening the luma midtones some.

Also realize that band videos, even now in 2015, are not shot very well. It's always a local budget shop, with lower-grade equipment, often with lower-knowledge folks operating the camera. Only in a few cases (BOA Grand Nationals, for example) do you end up with quality shooting. Most local, regional, and even state-level contests (not to mention plain ol' football games) are a shoddy job.

I've restored a lot of band videos over the years. This is a very typical issue here.

After Avisynth work, run the VirtualDub CCD filter. It will further fix the color bleeds.

sanlyn 02-22-2015 06:54 AM

Quote:

Originally Posted by lordsmurf (Post 36930)
No. You're overstating things. It's not "thoroughly ruined". The signal simply has mild color damage, which can be compensated for to a degree. Let's save "thoroughly ruined" for nth generation tapes with a dozen flaws or more.

I'll go along with that.

Quote:

Originally Posted by lordsmurf (Post 36930)
I would actually suggest undersaturating it some, and darkening the luma midtones some.

Of course (and I already did that in Avisynth and VDub), but the before/after demos were oversaturated to show the chroma problems better.

Quote:

Originally Posted by lordsmurf (Post 36930)
I've restored a lot of band videos over the years. This is a very typical issue here.

I'm sure they're mostly godawful. Add camera shake and kamikaze zoom techniques in the bargain, LOL!

Quote:

Originally Posted by lordsmurf (Post 36930)
After Avisynth work, run the VirtualDub CCD filter. It will further fix the color bleeds.

CCD did little for color bleeding here, but I did include it for other reasons.

For sirbyron, this is some of stuff to deal with:

This video has near zero saturation. You see little color density until you saturate a bit and see the reddish-magenta stain along the top and upper middle. There is no identifiable color anywhere, not even white or gray. The O.P. sez the uniform trousers are maybe Navy blue. I don 't think so, as Navy blue comes in varying brightness ranges but has no green and no red in it. The blue trousers in this video aren't even blue, they're slate gray which is ~30% red, ~30% green, and ~40% blue. In the opening frames they have no blue at all. More likely they might have been what's called Royal Blue, which has no red, but has about 25% green and the rest blue. In any event, there's no way a real Navy Blue will show up in the clip unless one can accept a dark blue audience and blue trees in the opening frames. That's a major issue with the old autowhite camera circuits: by the time autowhite or autocolor were through with their dirty work, there were usually no whites at all, just discolored grayish thingies with color casts.

Even with mild saturation you get odd effects. The shadow side of the girl's face in the original isn't darkish tan or near-brown, it's greyed-out purple. She wears blue, white, and pink -- the pink scarf and sash are hardly visible and appear gray at first. The sunlit side of her face is not a skin color, but more like neutral gray wallpaper with a very slight tan tint in it. The band's blouses aren't yellow, but are grayed-out yellow-greens that turn more orange at the upper left of the image. The sun is off to the right and low, it's maybe 4-PM, October-November. But there's no sign of that kind of warmish color balance or contrasty side lighting anywhere. The way in which "auto" features in consumer cameras louse up everything in this manner is what kept me from using them.

During the zoom, camera autogain washes out everything and blows away all highlight detail. Near the middle of that zoom you encounter the magenta stain, and the gray rear fence and trees turn pink. What you can play with are saturation and midtones. The midtones can be lowered by decreasing gamma or lowering the middle point with color mill or curves. This will make the upper shadows look dark around RGB 64, so use curves to brighten that a bit. Unfortunately if you make the ending scene look OK the beginning will look dim and too contrasty. If you fix up the beginning, the ending will be out of whack.

Cleaning tape noise, spots, dropouts, and edge shimmer wasn't all that difficult. My script and filters are a total mess right now, so I have to clean them up before I can post.

And, yes, you can set up QTGMC with a number of values that change the way it behaves. You can play with awarpsharp2 as well. I already did that, as you'll see. However, the default settings are optimized for decent speed performance. The more options you change, the slower things go.

lordsmurf 02-22-2015 07:46 AM

Quote:

Originally Posted by sanlyn (Post 36931)
I'm sure they're mostly godawful. Add camera shake and kamikaze zoom techniques in the bargain, LOL!

No, the biggest irritant is left/right camera movement with the marching band. It really gives you a headache. What it says is that the shooter didn't have a wide enough lens. At least in the digital age, we have more resolution, better wide lenses, and widescreen. (WS because the top/bottom was always nothing. Sadly, no thanks to compression, many squander the extra res.)

Band videos are one of the things that push my Avisynth skills. :cool:

Aside from this mini topic (not ruined!), I think your explanations and samples are excellent. I have nothing to add here. :salute:

For example, I don't think he'd gain much by tweaking QTGMC.

sirbyron 02-22-2015 09:02 PM

1 Attachment(s)
Quote:

Originally Posted by sanlyn (Post 36931)
The O.P. sez the uniform trousers are maybe Navy blue. I don 't think so, as Navy blue comes in varying brightness ranges but has no green and no red in it. The blue trousers in this video aren't even blue, they're slate gray which is ~30% red, ~30% green, and ~40% blue. In the opening frames they have no blue at all. More likely they might have been what's called Royal Blue, which has no red, but has about 25% green and the rest blue. In any event, there's no way a real Navy Blue will show up in the clip unless one can accept a dark blue audience and blue trees in the opening frames. That's a major issue with the old autowhite camera circuits: by the time autowhite or autocolor were through with their dirty work, there were usually no whites at all, just discolored grayish thingies with color casts.

Royal Blue would be a better guess. Navy, after thinking about it, is too dark.

I added a pic to this post so you can see the "real" colors. :D

Quote:

Originally Posted by sanlyn (Post 36931)
What you can play with are saturation and midtones. The midtones can be lowered by decreasing gamma or lowering the middle point with color mill or curves. This will make the upper shadows look dark around RGB 64, so use curves to brighten that a bit. Unfortunately if you make the ending scene look OK the beginning will look dim and too contrasty. If you fix up the beginning, the ending will be out of whack.

Cleaning tape noise, spots, dropouts, and edge shimmer wasn't all that difficult. My script and filters are a total mess right now, so I have to clean them up before I can post.

I'll work with these suggestions and see what i can do. Thanks.

Quote:

Originally Posted by lordsmurf (Post 36930)
Band videos are one of the things that push my Avisynth skills.

Seems like I always pick the best videos to transfer!! lol! :smack:
And thanks for the suggestions Smurf. Look fwd to trying some of the Avisynth tips you mention on your Avisynth tips post.

I managed to email the classmate who originally made the transfer. He said that mine was a copy of a copy (3rd Gen). He also said that he copied mine from his copy. In addition to that, he stated that when he made his copy from the original, he recorded at LP instead of SP. When mine was copied it was done at SP on my tape ...So... I have an SP copy of an LP copy. He stated that he "thinks" he still has his original but cant get it to me for several months. Would there be a huge difference in quality perhaps, being that his was recorded at LP mode? He did copy his from the original though.

sanlyn 02-22-2015 10:36 PM

1 Attachment(s)
Thanks for the image. Yep, that's royal blue, the shiny kind. Photo's kinda orange and oversaturated, but I get the idea.

I was just about finished when family matters interrupted everything and killed half the day. I wish the folks didn't live 50 minutes away! Oh, well, it was time for a day away from the PC (whether I want one or not, LOL!). Thanks for your patience.

-- merged --

Quote:

Originally Posted by sirbyron (Post 36940)
Seems like I always pick the best videos to transfer!! lol! :smack:

Don't feel alone.

Quote:

Originally Posted by sirbyron (Post 36940)
I managed to email the classmate who originally made the transfer. He said that mine was a copy of a copy (3rd Gen).

Ouch! And double ouch! And I might add, OMG! At least he didn't make a copy at EP. Yes, slower speed = lower quality. All speeds with VHS = color inaccuracies wholesale. Each copy = more corruption. No exceptions.

After swearing at this clip for a while, I came up with a trial effort (attached). A bit saturated -- tried for a brilliant blue in those uniforms. But. folks, it won't happen. I'd cut my Vdub saturation figure at least in half. If you want saturation, you gotta have color data to work with. I favored settings for the majorette. Others might differ, but I spent most games watching the ladies --especially when my team was losing. I encoded for MPEG/DVD at 704x480 interlaced, a standard frame size for 4:3 DVD.

I ran the project in 2 steps. Trying to tweak colors with a slow script is sheer torture. So Step 1 deinterlaces and saves the result as YV12. Step 2 is a separate script, takes the input from Step 1 and does the rest. It's fast enough for tweaking in VirtualDub without driving you crazy.

Step 1:
You've seen this before, so nothing new except that I changed the QTGMC settings.

Code:

# ###############################
#      SCRIPT FOR STEP 1
# ###############################

AviSource("E:\forum\sirbyron\C\Chs1981Samplecc.avi") #<-- adjust path and file name.
Crop(16,0,0,-10).AddBorders(0,0,0,2)
ConvertToYV12(interlaced=true)
AssumeTFF().QTGMC(preset="fast",sharpness=0.8)
# ------- Save in VirtualDub as Lagarith YV12 using fast compress" ----------------

Code:

# ###############################
#      SCRIPT FOR STEP 2
# ###############################

Import("D:\Avisynth 2.5\plugins\chubbyrain2.avs")
Import("D:\Avisynth 2.5\plugins\RemoveSpotsMC.avs")

AviSource("path to Step 1 output\filename.avi") #<--- adjust path and name for step 1 file.
chubbyrain2()
ChromaShift(c=-8,u=-2,L=-4)
mergechroma(awarpsharp2(depth=32, type=1, blur=3, chroma=6))
AutoAdjust(temporal_radius=30,high_quality=true,auto_gain=true,gain_mode=1,\
  dark_limit=1.0,gamma_limit=3.0,auto_balance=true)
SmoothLevels(8, 0.85, 255,16,235,chroma=200,limiter=0,tvrange=true,dither=100)
v1=last
e=v1.SelectEven().RemoveSpotsMC().Blur(0.4,0.2).Sharpen(0.3)
o=v1.SelectOdd().RemoveSpotsMC().Blur(0.4,0.2).Sharpen(0.3)
Interleave(e,o)
AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()
Santiag()
ConvertToRGB32(matrix="Rec601",interlaced=true)
AddBorders(8,4,8,4)
return last

# ---- output is RGB32. You can save as Lagarith RGB32 in a
# ---- new file via "fast compress" and then run VirtualDub
# ---- as a separate step -- or load VirtualDub filters on
# ---- Avisynth output and save as Lagarith YV12 for an encoder
# ---- via "Full processing mode".

# ------ VirtualDub plugins used later (See .vcf file)
# - fxVHS.vdf (FlaXen VHS) Ise chroma shift only!! Disable all other filters in the window.
# - hue.vdf (hue/saturation/intensity - Donald Graft)
# - ColorMill.vdf
# - gradation.vdf

In Step2 I removed a couple of filters. Face it, this poor critter can't take much denoising. QTGMC and RemoveSpotsMC are about all it could tolerate. Specifically, sharpening just doesn't work here and looks weird. The new filters you see will be attached in a following post.

AviSource("path to Step 1 output\filename.avi"): The input is the YV12 file saved from Step 1. You can run both steps in one script, but it will crawl. Anyway, if you want to change any filters this will save the time and angst of deinterlacing every time you run it.

chubbyrain2()
ChromaShift(c=-8,u=-2,L=-4)
mergechroma(awarpsharp2(depth=32, type=1, blur=3, chroma=6))

Similar to the earlier script, but two chroma sharpeners with awarsharp2 was a bit much. The majorette already has detail loss and looks plastic to begin with. This step sharpens color only.

AutoAdjust(temporal_radius=30, high_quality=true, auto_gain=true, gain_mode=1,\
dark_limit=1.0, gamma_limit=3.0, auto_balance=true):
Autofilters are dangerous business. This one is a very conservative one. It doesn't try to "correct" everything (none of them do anyway!). Mainly it tries to stabilize those haywire luma and chroma changes. The values are set to keep blacks from looking too thick and to calm gamma from jumping through the roof midway. It works a little. At least it made the uniforms more blue. But it made the sky more pink. Don't expect miracles.

SmoothLevels(8, 0.85, 255,16,235 chroma=200, limiter=0, tvrange=true, dither=100): SmoothLevels is in the SmoothAdjust plugin. It's set up here to raise darks just a little to save some dark detail, then at the bright end it contracts the hard brights a bit to avoid overshoot and clipping. It also lowers the high gamma. The first 5 numbers in the syntax correspond to: dark value input (treats dark pixels starting at RGB 8), gamma (lowers gamma and midtones from default 1.0 to 0.85), bright value input (treats RGB 255 as the brightest value), dark output (uses 16 as the output target RGB for those RGB 8 dark input pixels), and bright output (take those RGB 255 input pixels and wind them down so they don't exceed RGB 235). The rest of the stuff is smoothing, with dithering to "fill in" pixel values that are missing in the adjusted luma and color range -- i.e, smooths luma and chroma gaps across the spectrum, often done to avoid banding artifacts.

v1=last
e=v1.SelectEven().RemoveSpotsMC().Blur(0.4,0.2). Sharpen(0.3)
o=v1.SelectOdd().RemoveSpotsMC().Blur(0.4,0.2). Sharpen(0.3)
Interleave(e,o)

A tricky sequence, but often used. You have spots, dropouts, rips, etc., some of which endure for multiple frames. This routine splits the frames into two groups with hopes that a streak or dropout will occur only once in each group of frames. v1=last saves a copy of the last thing that happened in the script, and calls it "v1". Then we take all the Even numbered frames from v1 and save them as "e". Then we take all the odd numbered frames from v1 and call them "o". Clever names, huh? Just don't create a name that's the same as a command or function. Each group of frames is filtered with RemoveSpotsMC, then blurred just a bit, then sharpened just a bit. Why? To smooth stuff like split and ragged edges, especially damage that makes the majorette look as if she has two noses. Interleave(e,o) assembles "e" and "o" frames into their original sequence.

AssumeTFF().SeparateFields().SelectEvery(4,0,3). weave(): Reinterlace the reassembled frames using Top Field First. This means separating the progressive frames into 2 fields, as in the original clip. SelectEvery(4,0,3) takes every group of 4 fields and selects only fields 0 and 3 (the first field in a group is always considered field 0, not field 1). Weave() puts the two selected fields into an interlaced frame with the proper pixel lineup and scan line orientation. This line has 4 separate steps separated by periods. Each step feeds the next part of the the statement.

Santiag(): Anti-alias and edge smoothing. Some mighty ragged and noisy edges in this thing.

ConvertToRGB32(matrix="Rec601",interlaced=true)
AddBorders(8,4,8,4)
return last

Go to RGB32 for VirtualDub. Note that at this point, the video is interlaced. AddBorders restores the 640x480 frame size. In this case, you must end this script with "return last". This means to return the last thing the script accomplished. Otherwise, we've named some video copies as "v1", "e", and "o". Avisynth has to know what we want back from this foolishness. What we want returned is the "last" thing that was done.

In the above notes, notice how many coded words have spaces that don';t belong there. That's why we usually post original code inside "code" markers (see the "<>" icon above the reply window).

What I did was take the Step 2 script, read its output in VirtualDub, and load the VDub filters before saving the file as YV12. You'll need YV12 for the encoder anyway, so you can tell VirtualDub to output lossless Lagarith or huffyuv YV12, even though the VDuib filters run in RGB.

I'll attach more filters and the VirtualDub settings in the next post.

sanlyn 02-23-2015 05:22 PM

2 Attachment(s)
The attached plugin2.zip has subfolders with read-me and Avisynth plugins for AutoAdjust.dll, SmoothAdjust.dll, RemoveSpotsMC.avs, and Santiag.avsi. And since everybody needs a good sharpener, I included LimitedSharpenfaster. You can use it set strong or weak (the "strength" parameter), but the default 160 is pretty heavy. I had to remove it from this project. Poor Chs1981Samplecc already has oversharpening artifacts from previous dubs.

The attached VirtualDub_Files.zip has FlaXen's fxvhs plugin and ColorTools if you don't already have them. Also has a handy desktop RGB pixel sampler called Csamp.exe (don't leave home without it). Why VirtualDub doesn't already have a built-in pixel reader is beyond me.

Also in the VirtualDub file is a copy of the .vcf file with the settings I used for the RGB filters. Make sure you have these 4 filters in your VirtualDub plugins: fxVHS.vdf, hue.vdf, ColorMill.vdf, and gradation.vdf. A .vcf is a text file that you can read in Notepad if you want to. You load the filters in VirtualDub using "File..."-> "load processing settings...", then navigate to where the .vcf is located and click Open (or OK, or whatever the dialog wants). Once they're loaded, you can look inside each filter to see the settings.

The best place to keep .vcf's is with your project. Don't save it in VDub by overwriting it -- save it with a new name or version number. You never can tell when you want it back again.

Everyone is bound to mumble and disagree over specific settings. I'm not very satisfied, myself. But that's a given.

sirbyron 02-23-2015 10:14 PM

2 Attachment(s)
"Trialrun.mpg" looking good to me. I was going great on Step 1, got it completed and saved with Lagarith. Trying to open Step 2 in Vdub I came up with the error I attached as a jpg. Hopefully you can read the errors. Looks like according to the error it is hanging up on line "16" in my script and on lines "44" and "13" in the "RemoveSpotsMC.avs" script. Here is my Script in notepad (which I copy and pasted from the forum and then edited my filename for the video:

Code:

# ###############################
#      SCRIPT FOR STEP 2
# ###############################

Import("C:\Program Files\AviSynth 2.5\plugins\chubbyrain2.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\RemoveSpotsMC.avs")

AviSource("C:\Documents and Settings\Administrator\My Documents\My Videos\Chs1981SampleStep1.avi") #<--- adjust path and name for step 1 file.
chubbyrain2()
ChromaShift(c=-8,u=-2,L=-4)
mergechroma(awarpsharp2(depth=32, type=1, blur=3, chroma=6))
AutoAdjust(temporal_radius=30,high_quality=true,auto_gain=true,gain_mode=1,\
  dark_limit=1.0,gamma_limit=3.0,auto_balance=true)
SmoothLevels(8, 0.85, 255,16,235,chroma=200,limiter=0,tvrange=true,dither=100)
v1=last
e=v1.SelectEven().RemoveSpotsMC().Blur(0.4,0.2).Sharpen(0.3)
o=v1.SelectOdd().RemoveSpotsMC().Blur(0.4,0.2).Sharpen(0.3)
Interleave(e,o)
AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()
Santiag()
ConvertToRGB32(matrix="Rec601",interlaced=true)
AddBorders(8,4,8,4)
return last

# ---- output is RGB32. You can save as Lagarith RGB32 in a
# ---- new file via "fast compress" and then run VirtualDub
# ---- as a separate step -- or load VirtualDub filters on
# ---- Avisynth output and save as Lagarith YV12 for an encoder
# ---- via "Full processing mode".

# ------ VirtualDub plugins used later (See .vcf file)
# - fxVHS.vdf (FlaXen VHS) Ise chroma shift only!! Disable all other filters in the window.
# - hue.vdf (hue/saturation/intensity - Donald Graft)
# - ColorMill.vdf
# - gradation.vdf

I do have "RemoveSpotsMC.avs" in my Avisynth plugin file. I uploaded a screenshot of that folder also. On this computer I am running the following:

Windows XP 32bit
P4 2.0 Ghz
2.0 GB Ram

Quote:

Originally Posted by sanlyn (Post 36941)
Thanks for the image. Yep, that's royal blue, the shiny kind. Photo's kinda orange and oversaturated, but I get the idea.

I was just about finished when family matters interrupted everything and killed half the day. I wish the folks didn't live 50 minutes away! Oh, well, it was time for a day away from the PC (whether I want one or not, LOL!). Thanks for your patience.

Ah..no problem at all, thank YOU for your help. Good to get away from the monitor for a while and yes ... Family always first! :wink2:

sanlyn 02-24-2015 07:04 AM

1 Attachment(s)
Quote:

Originally Posted by sirbyron (Post 36956)
Trying to open Step 2 in Vdub I came up with the error I attached as a jpg. Hopefully you can read the errors. Looks like according to the error it is hanging up on line "16" in my script and on lines "44" and "13" in the "RemoveSpotsMC.avs" script.

Say, one error is pretty good for starters. And that was due to a frequent oversight (mine, of course).

The error message says that RemoveSpotsMC is looking for a function called "SCselect". That function is in the RemoveDirt.dll, and -- darn it -- RemoveDirt almost always trips up people because people think it's part of RemoveGrain and comes with QTGMC. But it doesn't.

Two versions of the RemoveDirt.dll's are attached. Use RemoveDirtSSE2.dll.

Your looks script looks OK, but start using the code markers in the reply window. Click the "#" icon above the reply window and copy code inside the code markers. For some reason, this and other forums put spaces between letters sometimes and breaks up a word. That's why a straight copy of the following line in your script looks like this:
Quote:

Originally Posted by sirbyron (Post 36956)
e=v1.SelectEven().RemoveSpotsMC().Blur(0.4,0.2).Sh arpen(0.3)
o=v1.SelectOdd().RemoveSpotsMC().Blur(0.4,0.2).Sh arpen(0.3)
Interleave(e,o)
AssumeTFF().SeparateFields().SelectEvery(4,0,3).We ave()

If you paste code inside code markers, they'll look like this:
Code:

e=v1.SelectEven().RemoveSpotsMC().Blur(0.4,0.2).Sharpen(0.3)
o=v1.SelectOdd().RemoveSpotsMC().Blur(0.4,0.2).Sharpen(0.3)
Interleave(e,o)
AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()

Nice work. You should have seen me kicking and screaming the first time I used Avisynth. Hope you're getting a feel for working with it, if for nothing more than simple tasks. You might want to have a look at this web page if you haven't seen it before: http://www.animemusicvideos.org/guid...post-qual.html. It's about anime, but the filters can be used anywhere. Anime samples help show the filter effects more clearly.

lordsmurf 02-24-2015 07:14 AM

Quote:

Originally Posted by sanlyn (Post 36958)
You might want to have a look at this web page if you haven't seen it before: http://www.animemusicvideos.org/guid...post-qual.html. It's about anime, but the filters can be used anywhere. Anime samples help show the filter effects more clearly.

@sirbyron:

However, realize that most AMV users severely overfilter their videos. They look terrible more often than not. So do NOT use that site for ideas on how to restore video, but rather ONLY to see how filters work. That's just not a good site for video restoration techniques. Beware.

I want to give this thread some attention, but I can't this week. :(

sanlyn has mentioned several interesting things, and I've been following along with the conversation. :hmm:

@sanlyn

How about I give you access to the new glossary, and you can add (seed it with) Avisynth info? I really like what you did with the filter breakdown here. I realize that Avisynth.org has a wiki, but that's not what I want to do. This site focuses on restoration, not just any ol' filter.

It's not ready yet, and won't be for another month or two. But it's on my docket for the spring.

Interested? :)

sanlyn 02-24-2015 07:41 AM

Nice offer, lordsmurf, much appreciated. Will be glad to contribute whatever I can....pending your approval, of course. Would be nice to have such a guide.

Indeed, anime fans filter like crazy. Agreed, it's a decent page at AMV to show what the filters do, but like you I wouldn't recommend throwing everything in sight at a video. I wish there was more of the original data in the sample I worked so I could avoid something like RemoveSpotsMC and didn't have to deinterlace to clean it up. Keeping that sample around to see what can be done with it later. Those spots and dropouts were driving me crazy, though. Well, but sometimes you just have to live with a few glitches and do less cleanup....

Thanks for the feedback.

sirbyron 03-01-2015 10:35 PM

Quote:

Originally Posted by sanlyn (Post 36958)
Say, one error is pretty good for starters. And that was due to a frequent oversight (mine, of course).

Thanks ... I try to really study before I do something. Sometimes it works, sometimes it doesn't! lol

Quote:

Originally Posted by sanlyn (Post 36958)
The error message says that RemoveSpotsMC is looking for a function called "SCselect". That function is in the RemoveDirt.dll, and -- darn it -- RemoveDirt almost always trips up people because people think it's part of RemoveGrain and comes with QTGMC. But it doesn't.

Two versions of the RemoveDirt.dll's are attached. Use RemoveDirtSSE2.dll.

That fixed it! Yayyy! Getting in late so dont have time to do anything else tonight but at least I know "Step 2" is loading now. Thanks!

Quote:

Originally Posted by sanlyn (Post 36958)
Your looks script looks OK, but start using the code markers in the reply window. Click the "#" icon above the reply window and copy code inside the code markers. For some reason, this and other forums put spaces between letters sometimes and breaks up a word.

Ahh...I see that # sign now ... took me forever to notice it for some reason. I'll definitely use it next time.

Quote:

Originally Posted by sanlyn (Post 36958)
Nice work. You should have seen me kicking and screaming the first time I used Avisynth. Hope you're getting a feel for working with it, if for nothing more than simple tasks. You might want to have a look at this web page if you haven't seen it before: http://www.animemusicvideos.org/guid...post-qual.html. It's about anime, but the filters can be used anywhere. Anime samples help show the filter effects more clearly.

Thanks, it has stretched my brain a bit.. but I am understanding it somewhat. Cant wait to gradually explore things and break down the script you used and just experiment to see what changes visually. Of course I'll keep that script and definitely not overwrite it! I cant wait to put it in use on the complete show.

Quote:

Originally Posted by lordsmurf (Post 36959)
@sirbyron:

However, realize that most AMV users severely overfilter their videos. They look terrible more often than not. So do NOT use that site for ideas on how to restore video, but rather ONLY to see how filters work. That's just not a good site for video restoration techniques. Beware.

I want to give this thread some attention, but I can't this week. :(

sanlyn has mentioned several interesting things, and I've been following along with the conversation. :hmm:

Definitely understand on the "overfiltering". Yes, I'll just use it to see how filters work. Always look fwd to any suggestions you have also. Thanks! :salute:


Quote:

Originally Posted by lordsmurf (Post 36959)
It's not ready yet, and won't be for another month or two. But it's on my docket for the spring.

Glad to hear! Cant wait.

Quote:

Originally Posted by sanlyn (Post 36958)
Keeping that sample around to see what can be done with it later

This sounds good too! Thanks.

I'll hopefully get to really spend some time tomorrow night on this and using it on the full video. I'll check back in then. So thankful... :worthy:

-- merged --

Sanlyn, I downloaded TMPGEnc Authoring Works 5 trial version and it doesn't let me load my avi file type. It says it is an "audio only" file but it isn't because it plays fine on my computer. I saved Step 2 as "Lagarith" via full processing. If TMPGEnc is not a recommended authoring program for this particular file can you recommend one? Thanks.

lordsmurf 03-02-2015 12:53 AM

You must encode to MPEG before authoring.
TAW5 is excellent authorware.


All times are GMT -5. The time now is 06:16 PM

Site design, images and content © 2002-2026 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2026 Jelsoft Enterprises Ltd.