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 4th November 2014, 01:18   #21  |  Link
Hotte
Registered User
 
Join Date: Oct 2014
Posts: 209
feisty, had a close comparative look now at this lady.

"new" indeed sets a benchmark here: Pulling out all the detail without halos or grain increase - just keeping the natural look. Wonderful! It is so sad that it runs so slow.

I am keen to work with that sample. But with all that conversion here and there, I will probably not have a comparable starting position. Or could you post a 10 picture avi or so to a hosting website ?
Hotte is offline   Reply With Quote
Old 4th November 2014, 01:24   #22  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by Hotte View Post
@poisondeathray, yes I know its not free from artefacts - which cam isnīt ? (btw jpg-picture compression did not add visible artefacts - it looks at home just like you see it on the web here)
Are you kidding? There are many camera / recording setups that don't have these type of h264 block artifacts. You record to uncompressed or external recorder. You don't need uncompressed, even lightly compressed like ProRes , DNxHD. Even cheapo consumer camcorders with HDMI can do this

There are 2 isssues you are discussing. 1) block artifacts (already present) 2) magenta shift

I suspect Edius doesn't have the magenta shift because it's working in RGB
poisondeathray is offline   Reply With Quote
Old 4th November 2014, 02:13   #23  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
u want my sample?
sure, when I get home I'll upload the samples (original untouched clip and the sharpened clip via my approach)
lsfmod indeed produces halo free and no grain amplified result also
but the whole image just became oil painted after sharpening
I checked lsfmod code, all nice code but the results just not quiet satisfying
I guess it might be just the crappy (too rough, not very precise) blur kernels it uses
edit: removegrain does not look like a nice kernel for sharpening to me
but somehow lsfmod picks it as the kernel

Last edited by feisty2; 4th November 2014 at 06:58.
feisty2 is offline   Reply With Quote
Old 4th November 2014, 02:21   #24  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
all "magic" comes at price
this case, the price is ur time
u can enjoy the nice "magical" result if ur willing to waste such a long time to sharpen some videos
feisty2 is offline   Reply With Quote
Old 4th November 2014, 08:51   #25  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Code:
o=last
a=last.Dither_convert_8_to_16 ()
b=last.binomialBlur(varY=0.5, varC=0, Y=3, U=2, V=2, useMMX=true).Dither_convert_8_to_16 ()
sharp=dither_add16 (a,dither_sub16 (a,b,dif=true),dif=true)
a.sharplimit16 (sharp)
ditherpost (mode=6)
s=last
mask=mt_hysteresis (o.mt_edge ("cartoon"),o.mt_edge ("hprewitt")).mt_expand_multi(sw=6, sh=6).mt_inpand_multi(sw=6, sh=6).tmaskcleaner ()
mt_merge (o,s,mask,y=3,u=3,v=3,luma=true)
solution to ur problem

Last edited by feisty2; 4th November 2014 at 09:15.
feisty2 is offline   Reply With Quote
Old 4th November 2014, 08:53   #26  |  Link
Hotte
Registered User
 
Join Date: Oct 2014
Posts: 209
@poisondeathray: Of course having artefact free raw material is better. However most ordinary videographers will have some in-camera compression, nowadays usually h.264 and .mov if it is a mainstream dslr. Nevertheless some of those are looking for better sharpening than in-camera. I already achieved much better sharpening using avisynth, which is our discussion here.

What you said about EDIUS is interesting: I do not know if the algorithm they use inside is RGB. But I tried out my initial unsharpmask code and replaced bionomialblur() with gaussianblur(). Gaussian also delivers good results, but contrary to binomialblur() it allows the code to run with RGB (canopus codec exports the MOV as an AVI in YUY2) like this:

x=avisource("blabla.avi").convertToRGB24
i=x.gaussianBlur()
...

Result: Again magenta artefacts. Mmmmhhhhhh.....
Hotte is offline   Reply With Quote
Old 4th November 2014, 08:57   #27  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
u can use any yv12 filter on rgb colorspace
there's something called "rgb48y", check the "dither" document
feisty2 is offline   Reply With Quote
Old 4th November 2014, 08:57   #28  |  Link
Hotte
Registered User
 
Join Date: Oct 2014
Posts: 209
wow, feisty2, canīt belive it...
I will do some testing tonight...canīt wait (like my boss).
Hotte is offline   Reply With Quote
Old 4th November 2014, 09:04   #29  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
u can simply convey every rgb channel on a grayscale yv12 frame
example: showred ("yv12"), it will separate red channel from ur image and store it on yv12 format
detailed example:
Code:
xxxsource
a=last
a.showred ("yv12")
#processes here#
r=last
a.showgreen ("yv12")
#processes here#
g=last
a.showblue ("yv12")
#processes here#
b=last
mergergb (r,g,b,"rgb24")
there, rgb image filtered by yv12 only filters and without colorspace conversion
feisty2 is offline   Reply With Quote
Old 4th November 2014, 11:29   #30  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
samples!
http://www.sharebeast.com/72oa3rblzoax
http://www.sharebeast.com/woo4wbqk4h9g
soft.mkv is the source clip
sharp.mkv is the detail sharpened clip
both are in an "encodable" rgb48y format, encode and process friendly, but not for the final result
soft.mkv was converted to rgb48y from a dvd I bought
both clips were encoded by x264 (qp=0, lossless encoding)
to convert them to regular rgb clips
2 methods
1 rgb24 output
ditherpost (mode=6)
mergergb (selectevery (3,0),selectevery (3,1),selectevery (3,2),"rgb24")
2 rgb48 output
converttoy8 ()
Dither_convey_rgb48_on_yv12(selectevery (3,0),selectevery (3,1),selectevery (3,2))
*raw output, requires special encode commands

Last edited by feisty2; 4th November 2014 at 11:32.
feisty2 is offline   Reply With Quote
Old 4th November 2014, 16:04   #31  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by Hotte View Post
@poisondeathray: Of course having artefact free raw material is better. However most ordinary videographers will have some in-camera compression, nowadays usually h.264 and .mov if it is a mainstream dslr. Nevertheless some of those are looking for better sharpening than in-camera. I already achieved much better sharpening using avisynth, which is our discussion here.
Of course, but you were discussing the "block" artifacts after sharpening. I was merely pointing out they were already there, and that any approach to sharpening or local contrast enhancement will tend to increase their visibility

There are many "hacks" for increasing internal bitrate recordings of various DSLRs. This alone will significantly reduce those artifacts - Magic Lantern for Canon, GH2 hacks etc... Look into it for your model
poisondeathray is offline   Reply With Quote
Old 4th November 2014, 20:17   #32  |  Link
Hotte
Registered User
 
Join Date: Oct 2014
Posts: 209
feisty, I cannot get tmaskcleaner to work (unknow function). I found a zip with tmaskcleaner.dll (well hidden somewhere) and put it into the avisynth/plugins directory, but it does not work - even, when I Load the plugin (canīt load) at the beginning of the script.

btw do I use 32bit or 64bit versions of dll`s ? I have git Win7 64bit and avisynth 2.6

Thanx
Hotte is offline   Reply With Quote
Old 4th November 2014, 20:20   #33  |  Link
Hotte
Registered User
 
Join Date: Oct 2014
Posts: 209
poisondeathray, thank you for your input. Yes, yes, yes I am very keen to get a higher bitrate for my NikonD5300! But I could not find a website. Any idea ?
Forget about that. After some more investigation I understood that the D5300 ist just simply to new to have been conquered. Buty anyway thanks for the idea. Never thought these options do exist.

Last edited by Hotte; 4th November 2014 at 21:04.
Hotte is offline   Reply With Quote
Old 4th November 2014, 21:41   #34  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by Hotte View Post
poisondeathray, thank you for your input. Yes, yes, yes I am very keen to get a higher bitrate for my NikonD5300! But I could not find a website. Any idea ?
Forget about that. After some more investigation I understood that the D5300 ist just simply to new to have been conquered. Buty anyway thanks for the idea. Never thought these options do exist.
That's too bad. You can clearly see the improvement in all camera models and makes. It really makes a big difference

eg. for D5100
http://www.personal-view.com/talks/d...Comment_163187

Sometimes Vitaliy needs some motivation or convincing to work on new models (donations help). There are also other variants of hacks you can check , like NikonHacker. Maybe you just have to wait a few months...



Anyways we are getting off topic here, lets stick to the avisynth discussion...
poisondeathray is offline   Reply With Quote
Old 4th November 2014, 22:29   #35  |  Link
Hotte
Registered User
 
Join Date: Oct 2014
Posts: 209
Sorry feisty2, maybe these are a stupid questions but I cannot get your code to work:

Code:
avisource("blabla.avi").convertToYV12
o=last
a=last.Dither_convert_8_to_16 ()
b=last.binomialBlur(varY=0.5, varC=0, Y=3, U=2, V=2, useMMX=true).Dither_convert_8_to_16 ()
sharp=dither_add16 (a,dither_sub16 (a,b,dif=true),dif=true)
a.sharplimit16 (sharp)
ditherpost (mode=6)
s=last
mask=mt_hysteresis (o.mt_edge ("cartoon"),o.mt_edge ("hprewitt")).mt_expand_multi(sw=6, sh=6).mt_inpand_multi(sw=6, sh=6).tmaskcleaner ()
mt_merge (o,s,mask,y=3,u=3,v=3,luma=true)
Answer "The scripts's return value was not a video clip".
Ok, I changed:

Code:
...
p=mt_merge (o,s,mask,y=3,u=3,v=3,luma=true)
return(p)
Answer: "There is no function named "tmaskcleaner""
Although tmaskcleaner.dll x86 Version ‎24.‎12.‎2013 ‏‎21:03 is in the avisynth/plugins directory.

Ok, another approach. Put a load at the beginning:
Code:
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\tmaskcleaner")

or 

LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\tmaskcleaner.dll")
...answer is "Unable to load "C:\..."

If I just outcomment tmaskcleaner
Code:
...
s=last
mask=mt_hysteresis (o.mt_edge ("cartoon"),o.mt_edge ("hprewitt")).mt_expand_multi(sw=6, sh=6).mt_inpand_multi(sw=6, sh=6)#.tmaskcleaner ()
p=mt_merge (o,s,mask,y=3,u=3,v=3,luma=true)
return(p)
I am getting a sharpend result which shows absolutely no change to previous results.

What am I doing wrong?
Hotte is offline   Reply With Quote
Old 4th November 2014, 23:53   #36  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I dont know dither at all (got it, never tried it), but, are you using v2.6, Avisynth v2.58 cannot 'see' v2.6 plugins. (tmaskcleaner)
__________________
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 5th November 2014, 00:57   #37  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
uh, tmaskcleaner is just to remove some random dots, remove it if u cant load it
not working? but it works perfectly on my computer
ur problems are all about flat areas got sharped
so, I masked flat parts out
no, the problem areas are not even processed at all, 100% from the source clip
so.... I donno whats happening on ur computer
feisty2 is offline   Reply With Quote
Old 5th November 2014, 08:24   #38  |  Link
Hotte
Registered User
 
Join Date: Oct 2014
Posts: 209
@StainlessS: A version mess... I`ve got 2.60build2012May16 and 2.60build2013Sep28. Both don't find tmaskcleaner... and the latter throws caching errors with dither.avsi!

@feisty2:
btw. which version are you using ?
It`s not a problem, I just removed tmaskcleaner, and yes, I did a stupid mistake with "... return value was not a video clip"
It's just that "mask=mt_hysteresis...mt_merge..." make no visible change to the result.

So I will experiment a bit with your excellent RGB tip and try to flatten out magenta somehow...
...and not drive the thread into further detail of magenta block artefacts that might not show up elsewhere and are maybe only a result of bad source encoding (as poisondeathray suspected).

I will soon be coming back with a final summary of this sharpen approach.

Thank you for your generous and highly qualified support so far. Iīve learned so much about the power of avisynth.

Last edited by Hotte; 5th November 2014 at 08:48.
Hotte is offline   Reply With Quote
Old 5th November 2014, 08:44   #39  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
u overrated me, after all, how much can a 17 years old kid know
I just happen to like to dig around "Google"
look, the whole thing just seems weird to me
u said the source clip is free (at least visually free) from those block and color messes
so here's what the code I wrote above does
it replaces problem block, discolored parts of the sharpened clip with the original unprocessed clip by using a mask function
so how could it be no change?
feisty2 is offline   Reply With Quote
Old 5th November 2014, 21:48   #40  |  Link
Hotte
Registered User
 
Join Date: Oct 2014
Posts: 209
Just a short message tonight, I'll be out for two days.

Yes, feisty2, I was wrong, you were right: There definitely IS a change. Is does away with fine sharpening artifacts so delivers even better results, though in some rare flat areas it does not sharpen (obviously because you restore the original). Unfortunately in chroma there is no significant improvement. For some strange reason flat blue here and there becomes flat magenta. But all in all it is not a big problem. You have to have a very, very close look to see it. What counts more is, that the sharpening is really good. I will be trying with some separated RGB settings and gradfun3....

I will be coming back soon. Donīt forget to post that lady-video (just a short clip). I would like to see how our sharpening looks in comparison. If possible put it somewhere where you do not have to download some software or register. Thanks so far Iīll be back soon.

Last edited by Hotte; 5th November 2014 at 21:51.
Hotte is offline   Reply With Quote
Reply

Tags
detail, fine, full-hd, sharpen, unsharp mask

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 16:42.


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