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. |
5th February 2023, 22:04 | #2001 | Link | ||
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,669
|
Quote:
Code:
ColorBars(pixel_type="YV12") propClearAll() deep_resize(width*2, height*2, grain=0) propShow(size=24) Quote:
|
||
5th February 2023, 23:13 | #2002 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,547
|
Quote:
I rarely use colormatrix (or related) anymore for upscaling, because almost everything SD I'm upscaling uses machine learning at some point, so it's converted to RGB early on |
|
5th February 2023, 23:13 | #2003 | Link | |
Registered User
Join Date: Feb 2003
Posts: 124
|
Quote:
Code:
z_ConvertFormat(colorspace_op="470bg:601:170m:full=>709:709:709:full") That's what I'm seeing too. |
|
6th February 2023, 00:29 | #2004 | Link | ||
Registered User
Join Date: Sep 2007
Posts: 5,547
|
Quote:
Transfer also have the same values for "601" and "709" so, it's the same mathematically Primaries are debatable - you actually shift the colors if you go from 170m to 709. Technically, you're supposed to adjust the primaries, but >95% of the time, it's not actually done upstream for the transfer to the DVD in the first place - so you end up with slightly shifted colors if you adjust them in my experience. Primaries are typically not adjusted for in broadcast, BD, DVD, web streaming either (except for HDR) You only get the "correct" colors, if the primaries were handled correctly all the way through, upstream and downstream and the playback method. Quote:
OTOH, some types of artifacts related to colormatrix conversion can occur with some types of animation (there are some threads and examples on this on this forum and others), so depending on how picky you are , you might want to filter them farther, so earlier could be better in some cases |
||
6th February 2023, 03:15 | #2005 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,547
|
Quote:
You need to run SceneStats before ex_autolevels . 2pass is probably better with a log file, but might be difficult to do in ripbot alone Code:
video = SceneStats(video, mode="Range+Stats",Y=true,UV=false) #1pass , no log file written video = ex_autolevels(video, interval=0.5,th=0.1) |
|
6th February 2023, 04:44 | #2007 | Link | ||
Registered User
Join Date: Sep 2007
Posts: 5,547
|
Quote:
It was just a quick test to rule out configuration problems (if any) Actually you can run the 2pass method, since avsmeter is available in ripbot. The analysis will not seem to "hang" and it will "bake" the analysis results into the text file. ie. use avsmeter to run the 1st pass, change the script for the encoding pass (or passes) . Make sure you run the analysis pass single threaded (no prefetch, or prefetch (1), also source filter with threads=1, and/or use a very robust indexed method like DGSource. You also have to edit the log file, there is a repeated section at the top that you have to delete (open in a text editor, and delete all the lines up to the 2nd "Type string" line) dogway posts this warning in ScenesPack.avsi - that's what it means Quote:
Code:
video = SceneStats(video, mode="Range+Stats",Y=true,UV=false, path="path\source_stats.log") Code:
video = ReadStats(video, "path\source_stats.log") video = ex_autolevels(video, interval=0.5,th=0.1) There are other "auto" leveling filters and methods that you can try out too... Last edited by poisondeathray; 6th February 2023 at 04:47. |
||
6th February 2023, 05:08 | #2008 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,547
|
What kind of "auto leveling" are you wanting ? Is it more "general" brightness/darkness/contrast issues, or to deal with "luminance flicker", or "white balance" / color balance/color cast , or something else? For the general category, you can try AutoLevels, or AutoAdjust |
6th February 2023, 06:45 | #2009 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,547
|
Quote:
For avisynth white balance, I find RGBAdapt_AWB_Process is quite good and customizable - results are close to commercial plugins in some cases - but IIRC you had issues running it. It works in ripbot, loading the video then copy/pasting - I just tried it. And playing with ripbot - I think I figured out the "no error message" black screen MPCHC ripbot preview issue that you sometimes have. AWB_Func didn't work, at first no error message. It turns out I had a typo, which the now visible error message conveyed. What you need to do is move the seekbar in MPCHC, and the error message will pop up You can also try coloryuv(autowhite=true) , it' s not as advanced but can do the job adequately in some cases If you prefer the PP filter's, you can use PP . One option is to frameserve in (Premiere AVS Import plugin) / frameserve out (Advanced Frameserver, or Debugmode Frameserver - now called "Cumincode Framserver") . Or use intermediates. I personally prefer intermediates when using PP |
|
6th February 2023, 07:34 | #2010 | Link | ||
Registered User
Join Date: Sep 2007
Posts: 5,547
|
Quote:
Quote:
Another option is if you re-wrap (streamcopy) into MP4, PP can import AVC, HEVC too. Native file import such as MP4 colorspace is handled properly |
||
6th February 2023, 16:41 | #2011 | Link | |
Registered User
Join Date: Nov 2009
Posts: 2,367
|
Quote:
I also updated ex_luma_rebuild() to allow for ex_levels() type of normalization with 'lo' and 'hi' args, but optimized without any performance penalty. Also updated StabPlus() with ex_autolevels(). Actually you could hack open the StabPlus() function to reuse some code with the below script. Code:
ffvideosource("noisy_original.mkv") propSet("_FieldBased",0) ConvertBits(16) ex_Luma_Rebuild(15.0, 0.004, 21, tv_out=true) ConvertBits(8,dither=1) StabPlus() crop(2,2,-6,-2) SceneStats("Range+Stats") pref = ex_autolevels(hi=true,tv_out=false) temp = Pref.TemporalSoften(5,255,0,25,2) rep = temp.Repair(Pref.TemporalSoften(1,255,0,25,2)) pref = ex_merge(rep, pref, MotionMask(rep,dir=0,scale=3,sharpness=2)) SMDegrain(2, 600, mode="TemporalSoften",str=2,prefilter=pref,RefineMotion=true) ex_unsharp(0.3) gr = 1 size = (720/2133.) * 3.3 GrainFactory3mod(g1str=7*gr,g2str=9*gr,g3str=7*gr,g1size=1.7*size,g2size=1.4*size,g3size=1.2*size,g1cstr=0.5*gr,g2cstr=0.3*gr,g3cstr=0.1*gr,temp_avg=1,tv_range=true) For the new SMDegrain update, I'm still missing a bugfix in ex_retinex() for lvl=1 and highlights=false. Just was burnt out with the latest fixes. This is the new output: link For comparison I was curious to test videoFred's script, it does a good job on stabilization and luma flicker but there's still some wobble: link
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread Last edited by Dogway; 6th February 2023 at 18:02. |
|
6th February 2023, 17:19 | #2012 | Link | |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 720
|
Quote:
|
|
6th February 2023, 17:30 | #2013 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,367
|
Sure, I said before it's not perfect. For these kind of borked sources the best solution is not a surgeon fix, but call TemporalSoften and fix several issues at once.
You can play with the temporal radius of TemporalSoften and SMDegrain to balance the effect, or use a pyramidal approach where you refine motion vectors further and further. Maybe applying BM3D with high radius to 'rep' frame can improve some stabilization.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
6th February 2023, 17:51 | #2014 | Link | |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 720
|
Quote:
|
|
7th February 2023, 16:31 | #2015 | Link |
Registered User
Join Date: Nov 2009
Posts: 2,367
|
I was curious to test the performance of ex_autolevels() on a synthetic test so I made this gradient patch with alternating lifted blacks and gamma.
This is ex_autolevels: Out of curiosity I also tested Autolevels(), I don't know if I'm doing something wrong here, the call is: Code:
Autolevels(filterRadius=10, output_low=0, output_high=255, ignore=0.05, sceneChgThresh=255) Probably if I run a second pass of ex_autolevels() with original stats it can be stabilized further. Will check that. EDIT: Yes, it's more stable with a second run but 'lo' and 'hi' have to be disabled to avoid a re-normalization: Code:
ex_autolevels(true ,true,false,reStats=false,tv_in=false) ex_autolevels(false,true,false,reStats=false,tv_in=false)
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread Last edited by Dogway; 7th February 2023 at 18:15. |
7th February 2023, 23:05 | #2016 | Link |
21 years and counting...
Join Date: Oct 2002
Location: Germany
Posts: 716
|
Looks very interesting! Where would you suggest to put this in a (double) SMDegrain call?
Out of curiosity I took a much closer look on other transfers I did over the last couple of month. Now that I developed a certain eye for this texture wobble, I see it in a lot of films I did in the past. SD and HD. Even films where you would not expect this because you can hardly see any luma flickering in the source. I start to believe this texture wobble is some kind of general side effect of the way SMDegrain removes noise or from the motion compensation. I still understand too little on how the entire process works to judge this. SMDegrain does a terrific job on films that had a very good AD transfer and where filmgrain really is the only kind of noise present. Same goes for modern digital productions where grain is added in post-processing for some arguable reasons. But on sources where other types of noise are involved, escpecially these 'unstable' sources, the side effects become clearly superficial when you try to go for a clean overall look. I just had a SD film here where in one scene almost the whole picture wobbled. Right now I'm playing around with other denoisers on this one to see what they can do. Last edited by LeXXuz; 7th February 2023 at 23:07. |
8th February 2023, 02:37 | #2017 | Link |
Registered User
Join Date: Dec 2005
Location: Sweden
Posts: 720
|
@Dogway I think I found what is causing that wobble in the bushes.
Code:
MotionMask(rep,dir=0,scale=3,sharpness=2) Try and see if you change the temporalsoften params lower if the wobble disappear. |
8th February 2023, 03:49 | #2018 | Link | ||
Registered User
Join Date: Nov 2009
Posts: 2,367
|
I've been refining ex_autolevels() and now I get it almost perfectly flicker free.
First I had a bug in ArrayDelVal() in ExTools which I'll update soon. Then I added 'Deflicker' arg to ex_autolevels() to make the normalization per scene (autolevels) or per frame (deflicker). Effectively running 2 passes makes it balanced enough for the gamma flicker. Code:
ex_autolevels(true ,true,false,Deflicker=true,tv_in=false) ex_autolevels(false,true,false,Deflicker=true,tv_in=false) This is how you make a flickering patch: Code:
GradientLinear(zoom=1, positive=true, precision=4) trim(0,32) SceneStats("Range") ScriptClip(function [] () { lo = rand(30) gm = (rand(100)-50)/200.+1 ex_levels(0,gm,255,lo,255,tv_range=false) } ) SceneStats("Stats") ...Deflickering here... ConvertBits(8,dither=1) Quote:
Quote:
EDIT: Here an updated script with less wobble but also less background stabilization. Link I tested with ex_reduceflicker() as the clip presented bob-like jitter and worked very nice, also reduced luma flicker a bit further despite not being designed for that. Code:
ffvideosource("noisy_original.mkv") propSet("_FieldBased",0) ConvertBits(16) ex_Luma_Rebuild(15.0, 0.004, 21, tv_out=true) ConvertBits(8,dither=1) StabPlus() crop(2,2,-6,-2) SceneStats("Range+Stats") pref = ex_autolevels( true ,true, true,Deflicker=true,tv_out=false) pref = ex_autolevels(pref,false,true,false,Deflicker=true,tv_out=false) pref2 = ex_reduceflicker(pref,3,true) pref3 = SMDegrain(tr=3,mode="temporalsoften",blksize=32,thSAD=900,prefilter=pref2,str=2,contrasharp=false,refinemotion=false) bk = SMDegrain(pref3,tr=3,mode="MDegrain",blksize=16,thSAD=400,refinemotion=true) ft = SMDegrain( tr=2,mode="MDegrain",blksize=16,thSAD=300,refinemotion=true,prefilter=bk) ex_merge(bk, ft, MotionMask(pref3,scale=10,sharpness=5)) ex_unsharp(0.3) gr = 1 size = (720/2133.) * 3.3 GrainFactory3mod(g1str=7*gr,g2str=9*gr,g3str=7*gr,g1size=1.7*size,g2size=1.4*size,g3size=1.2*size,g1cstr=0.5*gr,g2cstr=0.3*gr,g3cstr=0.1*gr,temp_avg=1,tv_range=true) Code:
ffvideosource("noisy_original.mkv") propSet("_FieldBased",0) ConvertBits(16) ex_Luma_Rebuild(15.0, 0.004, 21, tv_out=true) ConvertBits(8,dither=1) StabPlus2() crop(2,2,-6,-2) SceneStats("Range+Stats") pref = ex_autolevels( true ,true, true,Deflicker=true,tv_out=false) pref = ex_autolevels(pref,false,true,false,Deflicker=true,tv_out=false) pref3 = SMDegrain(tr=3,mode="temporalsoften",blksize=32,thSAD=900,prefilter=pref,str=2,contrasharp=false,refinemotion=false) bk=SMDegrain(tr=2,mode="temporalsoften",blksize=16,thSAD=400,LFR=false,refinemotion=true,prefilter=pref3) ft=SMDegrain(tr=2,mode="MDegrain" ,blksize=16,thSAD=300,LFR=false,refinemotion=true,prefilter=bk) ex_merge(bk, ft, MotionMask(pref3,scale=10,sharpness=5)) ex_unsharp(0.3) gr = 1 size = (720/2133.) * 3.3 GrainFactory3mod(g1str=7*gr,g2str=9*gr,g3str=7*gr,g1size=1.7*size,g2size=1.4*size,g3size=1.2*size,g1cstr=0.5*gr,g2cstr=0.3*gr,g3cstr=0.1*gr,temp_avg=1,tv_range=true)
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread Last edited by Dogway; 8th February 2023 at 19:46. |
||
9th February 2023, 03:31 | #2019 | Link |
Registered User
Join Date: Feb 2003
Posts: 124
|
Anybody have an idea what might be causing the horizontal chroma lines in these two screenshots? They don't exist in the source video.
Code:
https://send.cm/d/KEeM https://send.cm/d/KEeP Code:
z_convertformat(pixel_type=last.pixeltype, colorspace_op="170m:709:709:full=>709:709:709:full").propSet("_ColorRange",1) tfm(mode=1, pp=7) tdecimate(mode=0, dupthresh=1.4) lsfplus(strength=60,ss_x=1.5,ss_y=1.5,soft=30,overshoot=1) removegrain(mode=5) propSet("_FieldBased",0).deep_resize(960,720,grain=0,qual=2,gpuid=-1,show=false) prefetch(2) |
9th February 2023, 03:57 | #2020 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,547
|
Move z_convertformat after IVTC. "colormatrix" or similar applied on fields can cause similar issue, because it's applying a progressive transform while still organized in fields. There is an interlaced=true/false switch , but I believe it's non functional. Better just to move it
Last edited by poisondeathray; 9th February 2023 at 03:59. |
Tags |
avisynth, dogway, filters, hbd, packs |
Thread Tools | Search this Thread |
Display Modes | |
|
|