#41  
05-13-2020, 06:29 PM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 29 Times in 25 Posts
Also, is there no benefit to applying mergechroma vertically by rotating the video to the side?
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #42  
05-14-2020, 05:26 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
Quote:
Originally Posted by Winsordawson View Post
Thank you. I used ReplaceFramesMC for certain frames with bad tracking issues that cannot be fixed. Does this create a problem for the filters?

I did not realize RemoveDirtMC can do the same job as RemoveSpotsMC. It is also much quicker. Now that speed is not an issue, should I have de-interlaced first or is it fine to do it at the end? Also, is it safe to SeparateFields for most filters except for color, or are there certain filters that work better in normal interlaced? If a temporal filter works just as well when the fields are separated, I would rather err on this side than incorrectly apply a spatial filter when the fields have not been separated.

The saturation in the video you attached seems unnatural, especially in the blue shirt. I am just curious, is this the way it should be done or is it just a stylistic preference?
ReplaceFramesMC should be used on interlaced video. Probably wont hurt with this one, but you might have a playback glitch due to some distortion across fields. Difficult to say, but it go by so quickly you probably won't notice. It's probable that an artifact or something would originally exist in one field either before or after the replaced frame and be carried over into two fields on the new frame. The new frame gets its data from the frames before and after it.

A purist would say that progressive means progressive, period. That debate isn't resolved. One school says deinterlacing creates damage, and it does to a certain extent, including sometimes carrying glitches like spots and dropouts into the new full-size frames. Others differ and claim you should eliminate such glitches with SeparateFields routines before going to a full deinterlace. It gets more complicated when you realize that QTGMC and MCTemporalDenoise use SeparateFields internally. Most of us just try it out and see. I tend to use both, but if I have to deinterlace anyway it seems that filters like ChromaShift and anti-alias and dehalos work better with deinterlace.

RemoveDirtMC and RemoveSpotsMC don't work on the same things equally. The former is better with dropouts, the latter was never intended for dropouts.

I didn't spend more than 90 seconds on the color. Time was catching up on me.


Quote:
Originally Posted by Winsordawson View Post
Also, is there no benefit to applying mergechroma vertically by rotating the video to the side?
None that I can see. Both filters treat all edges equally.
Reply With Quote
  #43  
05-14-2020, 03:59 PM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 29 Times in 25 Posts
Quote:
RemoveDirtMC and RemoveSpotsMC don't work on the same things equally. The former is better with dropouts, the latter was never intended for dropouts.

I didn't spend more than 90 seconds on the color. Time was catching up on me.
Thank you. I did not realize that. I would appreciate any help you can give on the second video, but at the same time, please consider yourself first. If you feel rushed for whatever reason, I can wait. These times are already stressful enough.
Reply With Quote
  #44  
05-15-2020, 07:44 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
I changed this:
Code:
#Add fades to some clips
clip3
clip3 = FadeOut(last, 30)

clip4
clip4 = FadeOut(last, 30)

clip5
clip5 = FadeOut(last, 30)
to this for faster running:
Code:
#Add fades to some clips
clip3=Clip3.FadeOut(30)
clip4=Clip4.FadeOut(30)
clip5=Clip5.FadeOut(30)
You don't need "last" in the original code. When you invoked the name of the clip it automatically became last.

The following is not correct!
Code:
BottomField=SelectEven(). RemoveSpotsMC().RemoveSpotsMC3()
TopField=SelectOdd().RemoveSpotsMC().RemoveSpotsMC3()
Interleave(BottomField, TopField).AssumeBFF()
Even-numbered fields are always top fields, never bottom fields.
Even-numbered fields start on the top scanline and are numbered 0, 2, 4, 6, 8, etc. You can call them by any name you want. But physically they are the top fields and are always even numbered.

Physically, bottom fields never start at the top line. They are odd-numbrered fields starting at the second scanline, which is never the top line. They are numbered 1, 3, 5, 7, 9, etc. You can call them whatever you want. But phsyically they are the bottom fields and are always odd-numbered.

AssumeBFF() and AssumeTFF() have nothing to do with positioning the fields. They determine which fields play first, bottom or top. They handle field playback priority only. They have no influence on field positions.

There is some line twitter on the guy's glasses. You can deinterlace the clip and then vertically resize to half-height, then upsize it back again. But this video is too soft and corrupt for that.

You are cropping interlaced YV12 vertically in groups of two pixels, which is a no-no.
Use YUY2 or RGB. Look atv the table halfway down this page: http://avisynth.nl/index.php/Crop

Code:
Weave()

LimitedSharpenFaster()
Why are you weaving non-interlaced video and then sharpening it while it's re-interlaced?

You've done as well as you can with really bad color. The guy's hair is blue and the black lapel isn't black. Are those supposed to look that way?


code]
aud=NicMPG123Source(vidpath+"video2_before Tc0 L2 2ch 48 320 DELAY 0ms.mp2", Normalize=false)
vid=MPEG2Source(vidpath+"video2_before.d2v")
AudioDub(vid,aud)

LoadVirtualdubPlugin("D:\VirtualDub\plugins\ColorM ill.vdf", "ColorMill")

################################################## #######################
/* ################## code below can't be used here ################

AssumeBFF()
clip1 = Trim(1505, 4271)
clip2 = Trim(9464, 11636)
clip3 = Trim(15587, 19197)
clip4 = Trim(25203, 28942)
clip5 = Trim(35200, 38568)
clip6 = Trim(43275, 45038)

#Add fades to some clips
clip3=Clip3.FadeOut(30)
clip4=Clip4.FadeOut(30)
clip5=Clip5.FadeOut(30)

vid2 = clip1 + clip2 + clip3 + clip4 + clip5 + clip6
vid2

Trim(400, 1300)
################## code above can't be used here ################ */
################################################## ######################

Levels(15, 1, 255, 16, 235, coring=false, dither=true)

ConvertToRGB32(interlaced=true, matrix="Rec601")
ColorMill(25700, 25700, 29277, 25700, 16996, 16962, 25700, 25700, 25700, 25152, 25685,\
25700, 25700, 1124, 1029)

ConvertToYV12(interlaced=true)

#For vertical ringing
FAN(lambda=5)

SeparateFields()

TopField=SelectEven().RemoveDirtMC(40,false)
BottomField=SelectOdd().RemoveDirtMC(40,false)
Interleave(TopField,BottomField)

#Noise removal
super=MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta =2, overlap=4)
backward_vec1 = MAnalyse(super, isb=true, delta=1, overlap=4)
forward_vec1 = MAnalyse(super, isb=false, delta=1, overlap=4)
forward_vec2 = MAnalyse(super, isb= false, delta=2, overlap=4)
MDegrain2(super, backward_vec1, forward_vec1, backward_vec2, forward_vec2, thSAD=400)

ChromaShift(C=4)
#Chroma bleeding
mergechroma(aWarpSharp(depth=25, thresh=0.5, blurlevel=2, cm=1, bm=0))
LimitedSharpenFaster()
AddGrainC(var=1.2)

Weave()

##-- Can't crop interlaced YV122 in vertical groups of 2 pixels. ##--
##-- Must use vertical groups of 4, or Use YUY2 or RGB. ##--
##--
ConvertToYUY2(interlaced=true)
Crop(28, 2. 0, -6).AddBorders(16,4,12,4)

/*For de-interlaced version
QTGMC(preset="medium",ChromaMotion=true)
VInverse2()
ConvertToRGB32(interlaced=false, matrix="Rec601")
*/

ConvertToRGB32(interlaced=true, matrix="Rec601")
return last
[/code]
Reply With Quote
The following users thank sanlyn for this useful post: Winsordawson (05-16-2020)
  #45  
05-16-2020, 12:46 PM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 29 Times in 25 Posts
Quote:
Even-numbered fields are always top fields, never bottom fields.
Even-numbered fields start on the top scanline and are numbered 0, 2, 4, 6, 8, etc. You can call them by any name you want. But physically they are the top fields and are always even numbered.

Physically, bottom fields never start at the top line. They are odd-numbrered fields starting at the second scanline, which is never the top line. They are numbered 1, 3, 5, 7, 9, etc. You can call them whatever you want. But phsyically they are the bottom fields and are always odd-numbered.
Thank you. So top field = even fields and bottom fields = odd fields. I was basing my script on this guide:
https://www.afterdawn.com/guides/arc...nth_page_8.cfm

Down the page it says:

Quote:
SelectEven returns a clip consisting of every even numbered frame in a clip. Since the first frame of a clip is numbered 0, this translates to return every other frame, starting with the first one. Although it can be used just as easily for progressive frames, it's primarily used after SeparateFields to create clips containing only top or bottom fields so they can be filtered separately.

Example Code
Create a clip from only the top fields of a TFF clip:
TopField = SeparateFields().SelectEven()

Create a clip from only the bottom fields of a BFF clip:
BottomField = SeparateFields().SelectEven()
My understanding was that SeparateFields separated the video into the even and odd fields, which are now frames. SelectEven then selects only the even frames, which would correspond to the top fields of a TFF clip (since the top/even fields come first). But if this is a BFF clip, the bottom or odd fields come first, starting with 0.

But if what you write above is correct, then SelectEven would always choose the top fields, and this guide is wrong. I am confused.

Quote:
Why are you weaving non-interlaced video and then sharpening it while it's re-interlaced?
I used Weave() because I used SeparateFields beforehand. What am I doing wrong? I understand I should have sharpened before weaving.

Quote:
There is some line twitter on the guy's glasses. You can deinterlace the clip and then vertically resize to half-height, then upsize it back again
How does a simple re-size alone affect that? Nothing else has to be done?

Quote:
You've done as well as you can with really bad color. The guy's hair is blue and the black lapel isn't black. Are those supposed to look that way?
I can confirm from a different video of this person that the jacket should be blue. In Premiere, I can easily correct this by selecting the black and white points, and moving the hue wheel itself so that the mask of the skin tone is on the skin tone line. Here is what the colors should look like (it is not completely color corrected)

color_corrected_premiere.jpg


Here is before
You must be logged in to view this content; either login or register for the forum. The attached screen shots, before/after images, photos and graphics are created/posted for the benefit of site members. And you are invited to join our digital media community.


Is there anyway to color correct this using VirtualDub? I could not get ColorMill to work. Otherwise, I will have to use Premiere or DaVinci and export a lossless version to VirtualDub. If so, should I export a version from Avisynth/VirtualDub with the noise removed, followed by color correction in a NLE, and then back to Avisynth/VirtualDub? Or just color correct it first in a NLE and then use Avisynth/VirtualDub? I need to color correct before I use Mergechroma() or it will not work correctly because of how skewed the colors are.


Reply With Quote
  #46  
05-16-2020, 03:58 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
Quote:
Originally Posted by Winsordawson View Post
So top field = even fields and bottom fields = odd fields. I was basing my script on this guide:
https://www.afterdawn.com/guides/arc...nth_page_8.cfm

Down the page it says:
Quote:
SelectEven returns a clip consisting of every even numbered frame in a clip. Since the first frame of a clip is numbered 0, this translates to return every other frame, starting with the first one. Although it can be used just as easily for progressive frames, it's primarily used after SeparateFields to create clips containing only top or bottom fields so they can be filtered separately.

Example Code
Create a clip from only the top fields of a TFF clip:
TopField = SeparateFields().SelectEven()

Create a clip from only the bottom fields of a BFF clip:
BottomField = SeparateFields().SelectEven()
My understanding was that SeparateFields separated the video into the even and odd fields, which are now frames. SelectEven then selects only the even frames, which would correspond to the top fields of a TFF clip (since the top/even fields come first). But if this is a BFF clip, the bottom or odd fields come first, starting with 0.

But if what you write above is correct, then SelectEven would always choose the top fields, and this guide is wrong. I am confused.
The guide is wrong. Bottom field never starts on the top line. That guide has other oddball errors and bad advice elsewhere.

Quote:
Originally Posted by Winsordawson View Post
Quote:
There is some line twitter on the guy's glasses. You can deinterlace the clip and then vertically resize to half-height, then upsize it back again
How does a simple re-size alone affect that? Nothing else has to be done?
Code:
QTGMC(use whatever preset)
Spline36Resize(720,240)
Spline36Resize(720,480)
The resize reduces vertical resolution by half, often combining thin horizontal lines into one. A soft video like this one with no detail isn't going to look very good afterwards.

If your NLE can correct the color first, do it separately. I don't use Premiere,but ColorFinesse in my AfterEffects is similar. DaVinci can't work with lossless codecs.
Reply With Quote
  #47  
05-16-2020, 05:24 PM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 29 Times in 25 Posts
Thank you. I tried the 6-axis color correction in VirtualDub2 but that did not help either. I guess it does have its limits. I don't know the color got screwed up that badly.

Is it correct that the modulo requirements for cropping borders is different than when adding them? From the Avisynth page, it seems that the height of YV12 video must be divisible by 4 on interlaced video, but on the AddBorders page it says that for YV12 video all four border widths must be divisible by 2. In that case it would seem that I can crop 4 from the top and 8 from that bottom (total = 12), and can add back a border to the top and bottom of 6 and 6. If cropping has a mod4 rule to preserve the colorspace, why doesn't AddBorders follow that as well?

http://avisynth.nl/index.php/AddBorders
Reply With Quote
  #48  
05-16-2020, 09:08 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
AddBorders doesn't change the image. it just adds border pixe4ls.

You can not work with single pixels in TV12. An odd number of pixels on any side means you have an odd number of pixels on at least one side or a frame that's not YV12 compliant. YV12 stores luma and chroma data in even numbers of pixels. If you have odd pixels in YV12, you're missing or displacing some information.
Reply With Quote
  #49  
05-16-2020, 11:30 PM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 29 Times in 25 Posts
Thank you. I changed it to Crop(28, 4, 0 , -8).AddBorders(16,6,12,6). Doesn't AddBorder add to the frame size? It is what it says at the above link "Add black or colored borders, increasing frame size." That is why I did not know why its modulo rules are different.

Also, is there a way to turn a mono track of a video into stereo in Avisynth without resorting to an outside program? I tried to use MergeChannels but the video would not play. The clip in question only had one track, which was mono.

Code:
original = AVISource("video.avi")
sound = original
MergeChannels(original, sound)
return last


Attached Files
File Type: mpg mono_clip.mpg (20.44 MB, 1 downloads)
Reply With Quote
  #50  
05-16-2020, 11:39 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,501
Thanked 2,447 Times in 2,079 Posts
Mono and stereo video? Huh?
Those are audio terms. And Avisynth isn't for audio. You want SoundForge.

I probably owe you a favor, so I'll process a few audio tracks for you. Unlike video, audio is quick (well, for me, 25 years of experience with SoundForge and others).

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
  #51  
05-17-2020, 02:57 PM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 29 Times in 25 Posts
Quote:
Originally Posted by lordsmurf View Post
Mono and stereo video? Huh?
Those are audio terms. And Avisynth isn't for audio. You want SoundForge.

I probably owe you a favor, so I'll process a few audio tracks for you. Unlike video, audio is quick (well, for me, 25 years of experience with SoundForge and others).
Thanks, but I think you know the favor I am waiting for .
What I meant is that my video only had one mono track of audio, and I wanted it in stereo. I was able to get around it easily by converting the .avi to a .wav file and importing that into Audacity, where duplicating tracks is simple. It also had the added benefit of allowing me to apply noise reduction and normalization. I was just curious about what MergeChannels actually does, since it did not do anything for me.
Reply With Quote
  #52  
05-17-2020, 08:29 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
Quote:
Originally Posted by Winsordawson View Post
Thanks, but I think you know the favor I am waiting for .
What I meant is that my video only had one mono track of audio, and I wanted it in stereo. I was able to get around it easily by converting the .avi to a .wav file and importing that into Audacity, where duplicating tracks is simple. It also had the added benefit of allowing me to apply noise reduction and normalization. I was just curious about what MergeChannels actually does, since it did not do anything for me.
Why don't you look it up? There's more than you need:

http://avisynth.nl/index.php/MergeChannels'
http://avisynth.nl/index.php/ConvertToMono
http://avisynth.nl/index.php/MonoToStereo
http://avisynth.nl/index.php/MixAudio

http://avisynth.nl/index.php/Category:Audio_filters
Reply With Quote
  #53  
05-17-2020, 11:23 PM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 29 Times in 25 Posts
Quote:
I did, but the MergeChannels script from above does not seem to work, so I thought someone may have experience with it. VirtualDub can open it but cannot play it, simply saying "dub in progress" regardless of clip size. It appears that it must be given two mono channels and not video. My hope was that it would recognize a mono track from a video and directly turn it to stereo but that is not the case. The other filters are nice but are used with a separate sound track as well, and if I have a sound track already I would have processed it through Audacity, which is what I did.
Reply With Quote
Reply




Tags
avisynth, color artifact, restoration

Similar Threads
Thread Thread Starter Forum Replies Last Post
Attempt to fix AGC issues with ATI 650/750 USB? burak5 Capture, Record, Transfer 0 08-17-2016 06:46 AM
Removing dot crawl with Avisynth? (1st attempt) TheCatacomb Restore, Filter, Improve Quality 7 06-13-2016 10:35 PM
VHS restore filters using Avisynth and VirtualDub - advice? Zoink187 Restore, Filter, Improve Quality 13 07-24-2014 09:38 PM
Virtualdub and Avisynth workflow and filter advice for VHS restore Zoink187 Restore, Filter, Improve Quality 11 07-23-2014 07:31 AM
VHS footage restore Advice using VirtualDub/Avisynth Zoink187 Restore, Filter, Improve Quality 0 03-28-2014 09:14 PM

Thread Tools



 
All times are GMT -5. The time now is 05:56 AM