Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th August 2014, 11:55   #1  |  Link
3hj
Registered User
 
Join Date: Jul 2014
Posts: 2
Advice humbly requested on optimal filter order.

Hello.

I have a non-profit film project I'm doing, with the intention of releasing it for free download/streaming online. This film is going to be cobbled together from a multitude of sources:

- 1080p HDV footage
- SD DVCam footage
- 2nd-gen VHS camcorder footage
- Hi-8 camcorder footage

I figure the prudent thing to do would be to release this project in 720p, because (a) I've seen some astonishingly good results with upscalers here and elsewhere on the internet but (b) I think upscaling VHS to 1080p is probably a bit too much of a stretch.

My question is about the 'optimal' order of filters, which ones to put in which order to get the best results. At some point, I'm going to use the following filters on the footage (the HDV footage will probably remain as-is, since it's pretty pristine):

- upscaling to 720p
- cropping (removing useless black/garbage outer edges on the VHS footage; turning all 4:3 images into 16:9)
- deinterlacing (all the VHS footage and some of the DVCam footage is interlaced)
- deblocking (some of the DVCam stuff has lossy DivX compression on top of the original MPEG-2 captures and has noticeable artifacting)
- de-noising (some of the VHS footage is quite noisy, and some of the DVCam footage was shot in low-light and is quite grainy)
- general de-VHS-ugliness'ing (seems to be a lot of filter chains built specifically around making VHS footage more pleasing, so I'll be investigating and probably including stuff like that as well)
- levels/brightness/contrast adjustment
- colour correction/colour grading
- sharpening where needed (not sure if upscaling would negate needing to do this?)

Might be subjected to some minor adjustments and filtering otherwise, but I think the above will be pretty much everything I'll be doing with AviSynth.

So. In what order would I stack these to get the best results? My assumption would be levels+colour correction -> deinterlace -> deblock -> denoise -> sharpening -> upscaling -> cropping, but this is just my gut feel, and I'm not too knowledgeable on the intricacies of filtering. What would you suggest? Any info/hints will be greatly appreciated.

Also, would I want to do the filtering before editing the footage together, or after? I would assume beforehand, but again, beginner knowledge and all that.

Thanks.
3hj is offline   Reply With Quote
Old 27th August 2014, 13:11   #2  |  Link
bxyhxyh
Registered User
 
Join Date: Dec 2011
Posts: 354
Sharpening should be after upscaling or before downscaling.
Upscaling sharpened video can be "upscale" artifacts caused by sharpeners.
Same for levels/colour correction.
Also I think cropping should be done before resizing. Black borders can be recognized as line then there can be ring/halo artifacts.

So my recommendation is
deinterlace -> denoise -> deblock -> cropping -> upscaling -> sharpening -> levels+colour correction
bxyhxyh is offline   Reply With Quote
Old 27th August 2014, 13:22   #3  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
1. sharpen (separatefields first and do limit the sharpdif so artifacts and noise will not get worsened)
2. color adjustments (16bpc precision, same as 1, separatefields first, then adjust)
3. denoise/deblock (separatefields then denoise/deblock)
4. deinterlace
5. upscale
feisty2 is offline   Reply With Quote
Old 27th August 2014, 13:27   #4  |  Link
bxyhxyh
Registered User
 
Join Date: Dec 2011
Posts: 354
Quote:
Originally Posted by feisty2 View Post
3. denoise/deblock (separatefields then denoise/deblock)
4. deinterlace
I think this destroys more detail than deinterlace + denoise.
bxyhxyh is offline   Reply With Quote
Old 27th August 2014, 13:32   #5  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
sharpening should be performed on the original clip before any other filters,
your clip will easily be oil painted look like if sharpen a denoised clip
color adjustments should be performed before denoising
you may find some residual noise/dirty spots if denoise first then lighten the color
feisty2 is offline   Reply With Quote
Old 27th August 2014, 13:38   #6  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by bxyhxyh View Post
I think this destroys more detail than deinterlace + denoise.
deinterlacing WILL affect the original noise pattern, so will affect the denoise effect
however, denoise first is harmless to deinterlace
feisty2 is offline   Reply With Quote
Old 29th August 2014, 13:48   #7  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
If you have a long, quiet day at the office to kill, consider reading this thread: http://forum.videohelp.com/threads/3...PEG-2-encoding. It covers this and other issues pertinent to working with multiple sources of the types you mention, such as taking into account DV vs. MPEG chroma placement, translating between the SD Rec.601 and HD Rec.709 colourspaces, the luma (and perhaps chroma) correction you mention, etc.

For what it's worth at this point, for interlaced material the most important rule is always to deinterlace before doing ANYTHING that changes vertical geometry (e.g. resize and crop), and/or that makes assumptions about vertical information being from the same point in time (e.g. subtitles) and/or is generally interlacing unaware. For example, denoising interlaced material is debatably damaging - spatial denoising will spatially blur information between fields originally from different points in time, and temporal denoising will similarly not account for true movement between fields. In various threads (if not in the one above) jagabo has explained why not even separated-field work-arounds are generally suitable.

The filter sequence you suggest seems largely safe from that point of view, except that some purists would argue that giving the deinterlacer less-than-original field information after levels and chroma correction is sub-optimal.
fvisagie is offline   Reply With Quote
Old 29th August 2014, 15:04   #8  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by fvisagie View Post
If you have a long, quiet day at the office to kill, consider reading this thread: http://forum.videohelp.com/threads/3...PEG-2-encoding. It covers this and other issues pertinent to working with multiple sources of the types you mention, such as taking into account DV vs. MPEG chroma placement, translating between the SD Rec.601 and HD Rec.709 colourspaces, the luma (and perhaps chroma) correction you mention, etc.

For what it's worth at this point, for interlaced material the most important rule is always to deinterlace before doing ANYTHING that changes vertical geometry (e.g. resize and crop), and/or that makes assumptions about vertical information being from the same point in time (e.g. subtitles) and/or is generally interlacing unaware. For example, denoising interlaced material is debatably damaging - spatial denoising will spatially blur information between fields originally from different points in time, and temporal denoising will similarly not account for true movement between fields. In various threads (if not in the one above) jagabo has explained why not even separated-field work-arounds are generally suitable.

The filter sequence you suggest seems largely safe from that point of view, except that some purists would argue that giving the deinterlacer less-than-original field information after levels and chroma correction is sub-optimal.
you can surely interpolate every fields to full frames with eedi3 and do denoise, sharpen all those stuff and simply discard the interpolated fields and weave the source fields together at the end of everything before deinterlacing if you worry about even separatefields first is not right

Code:
#interlaced input#
separatefields ().assumeframebased ()
bot=selecteven ().eedi3 (field=0,dh=true,sclip=selecteven ().nnedi3 (field=0,dh=true))
top=selectodd ().eedi3 (field=1,dh=true,sclip=selectodd ().nnedi3 (field=1,dh=true))
interleave (bot,top)
#sharpen, denoise, blah blah...#
bot=selecteven ().separatefields ().selecteven ().assumefieldbased ()
top=selectodd ().separatefields ().selectodd ().assumefieldbased ()
interleave (bot,top).assumebff ()
weave ()
#deinterlace#
EDIT: Fixed field temporal shift

Last edited by feisty2; 29th August 2014 at 15:41.
feisty2 is offline   Reply With Quote
Old 29th August 2014, 16:01   #9  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Some denoise filters have an Interlaced arg (or similar) eg FFT3DFilter (spacio/temporal) and VagueDenoise (Spacial).
Also, Stickboy's jdl-interlace.avsi has JDL_UnfoldFieldsVertical, and JDL_FoldFieldsVertical (using flip arg), used to apply
spatial filters to interlaced material.
http://www.avisynth.nl/users/stickboy/
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 29th August 2014, 16:17   #10  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by StainlessS View Post
Some denoise filters have an Interlaced arg (or similar) eg FFT3DFilter (spacio/temporal) and VagueDenoise (Spacial).
Also, Stickboy's jdl-interlace.avsi has JDL_UnfoldFieldsVertical, and JDL_FoldFieldsVertical (using flip arg), used to apply
spatial filters to interlaced material.
http://www.avisynth.nl/users/stickboy/
as far as I'm concerned, all these filters just do separatefields function or things similar internally, which fvisagie thinks is wrong
feisty2 is offline   Reply With Quote
Old 29th August 2014, 17:03   #11  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Everyone has their own way of doing things, you have to determine what works best for your particular scenario

Separatefields() is "technically wrong" because of the even/odd vertical field offset. Even/Odd fields are not vertically aligned

Even if you group even/odd separate fields, and filter that way, then interleave and weave - then use of temporal filters is technically "wrong" and less effective, because in bobbed sequence, you will be filtering 0,2,4,6... separately from 1,3,5,7.... ie. there will be no temporal filtering between even and odd, only within




Quote:
Originally Posted by feisty2 View Post
you can surely interpolate every fields to full frames with eedi3 and do denoise, sharpen all those stuff and simply discard the interpolated fields and weave the source fields together at the end of everything before deinterlacing if you worry about even separatefields first is not right

Code:
#interlaced input#
separatefields ().assumeframebased ()
bot=selecteven ().eedi3 (field=0,dh=true,sclip=selecteven ().nnedi3 (field=0,dh=true))
top=selectodd ().eedi3 (field=1,dh=true,sclip=selectodd ().nnedi3 (field=1,dh=true))
interleave (bot,top)
#sharpen, denoise, blah blah...#
bot=selecteven ().separatefields ().selecteven ().assumefieldbased ()
top=selectodd ().separatefields ().selectodd ().assumefieldbased ()
interleave (bot,top).assumebff ()
weave ()
#deinterlace#
EDIT: Fixed field temporal shift


Did you realize that you're essentially "double rate deinterlacing" by separating , interleaving the EDI "resized" fields ? ie You're supporting what fvisagie said

So why are you deinterlacing, re-interlacing then deinterlacing again ? Seems like a lot of extra steps ?
poisondeathray is offline   Reply With Quote
Old 29th August 2014, 17:13   #12  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
the difference is a lot of people like to use advanced deinterlace/bob script like qtgmc, those scripts will not keep the original fields, there are new fields interpolated, but the original fields are altered as well, this method will not do anything to the original fields if you leave that #denoise xxxx#part empty
feisty2 is offline   Reply With Quote
Old 29th August 2014, 17:31   #13  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by feisty2 View Post
the difference is a lot of people like to use advanced deinterlace/bob script like qtgmc, those scripts will not keep the original fields, there are new fields interpolated, but the original fields are altered as well, this method will not do anything to the original fields if you leave that #denoise xxxx#part empty


Yes, that will keep original fields.. But who said anything about keeping original fields?

He wants to deinterlace and upscale, and he's filtering anyways - so not keeping original fields

Or maybe you implying that filtering should be done on original fields ?
poisondeathray is offline   Reply With Quote
Old 29th August 2014, 17:34   #14  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by poisondeathray View Post
Yes, that will keep original fields.. But who said anything about keeping original fields?

He wants to deinterlace and upscale, and he's filtering anyways - so not keeping original fields

Or maybe you implying that filtering should be done on original fields ?
personally, I think it's quality wise to use sharpen or denoise kinda stuff on original fields and that's the whole point why I order like that, to get the best quality

Last edited by feisty2; 29th August 2014 at 17:37.
feisty2 is offline   Reply With Quote
Reply

Tags
advice, filters, restoration, upscaling

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:49.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.