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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th December 2022, 21:33   #1  |  Link
BabaG
Registered User
 
Join Date: Dec 2003
Posts: 253
deflicker for 10 bit source?

i have a script that uses the deflicker plugin but am getting an error that it only supports 8 bit sources. my sources are 10 bit. for the the tests i made in coming up with the script i must have used 8 bit and not thought about it. is there an alternative to 'deflicker' that will accept 10 bit? workaround?

thanks,
babag
BabaG is offline   Reply With Quote
Old 8th December 2022, 21:57   #2  |  Link
coolgit
Registered User
 
Join Date: Apr 2019
Posts: 223
Convert to 8 bits then use deflicker then back to 10 bits.
coolgit is offline   Reply With Quote
Old 8th December 2022, 22:47   #3  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
Can you share your deflicker script?? i will findout if it have newer ver (maybe)
kedautinh12 is offline   Reply With Quote
Old 8th December 2022, 23:21   #4  |  Link
BabaG
Registered User
 
Join Date: Dec 2003
Posts: 253
here's the relevant part:
Code:
import("/home/babag/.wine/drive_c/Program Files (x86)/AviSynth+/plugins+/RemoveDirt.avs")
import("/home/babag/.wine/drive_c/Program Files (x86)/AviSynth+/plugins+/RemoveDirtMC.avs")

AddAutoloadDir("C:\users\babag\Downloads\Video\AVISynth\AVISynth\Tests",toFront=true)     # Load additional scripts and filters

FFMPEGSource2("source_file_2880x2160p_DNxHR_444_12bit_23976fps.mov", atrack=1)
#ConvertToYV12(matrix="rec709")
z_ConvertFormat(pixel_type="YUV420P16")

Crop(240,0,-240,-0)

BilinearResize(width/2, height/2)

Deflicker()             #   Mainly for use on hand developed film. Only supports 8 bit.
because of the source material, digitized hand-developed 16mm film that was shot and processed many years after its expiration date, it's a bit of an odd script. i can post more if necessary but this gets us up to the error at the deflicker plugin. the deflicker plugin is version: Deflicker-v0.6.7z

the line:

Code:
ConvertToYV12(matrix="rec709")
was used when testing with 8bit files.

the line:

Code:
z_ConvertFormat(pixel_type="YUV420P16")
is something i was recommended to use to preserve 10 bit sources.

thanks,
babag

Last edited by BabaG; 8th December 2022 at 23:29.
BabaG is offline   Reply With Quote
Old 8th December 2022, 23:39   #5  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Deflicker does not support >8bit. Pinterf added support for other planar colorspaces (Y, YV16,YV24) and x64 but no HBD. One alternative is http://avisynth.nl/index.php/ReduceFlicker - it supports >8bit.
Reel.Deel is offline   Reply With Quote
Old 8th December 2022, 23:48   #6  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
+1 for reduceflicker()

Honestly,

Code:
ReduceFlicker(strength=3, aggressive=true)
is probably everything you need
FranceBB is offline   Reply With Quote
Old 8th December 2022, 23:58   #7  |  Link
BabaG
Registered User
 
Join Date: Dec 2003
Posts: 253
thanks for the 'ReduceFlicker' tips. i'd seen it but didn't know if it would handle >8bit. will download and try some tests.

the flicker being addressed in the script with the deflicker plugin is not a rapid flicker. it's a slow, gentle variance in brightness caused by the hand-developing. i'll be curious to see how ReduceFlicker works compared to deflicker, which does a good job on this long, slow density variation.

may have hit another snag too. got an error about 'awarpsharp.' seems connected to this line later in the script:
Code:
UnsharpMask(strength=50, radius=2, threshold=0)
thanks again,
babag
BabaG is offline   Reply With Quote
Old 9th December 2022, 00:05   #8  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Replace UnsharpMask with the script version from here: https://forum.doom9.org/showthread.p...11#post1875711
I recommend changing the name to UnsharpMask2 so there is no conflict in names if you have the WarpSharp plugin loaded.

Do you mind sharing a sample of the troublesome video?
Reel.Deel is offline   Reply With Quote
Old 9th December 2022, 01:35   #9  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
Here unsharpmask for HBD
https://github.com/Dogway/Avisynth-S...Pack.avsi#L637
kedautinh12 is offline   Reply With Quote
Old 9th December 2022, 07:08   #10  |  Link
BabaG
Registered User
 
Join Date: Dec 2003
Posts: 253
thanks for the continuing tips. back to testing this.

@Reel.Deel
was able to get virtualdub to load the script after making the change you suggest and renaming to unsharpmask2. problem now is that, while virtualdub loads the avs file, the image remains a simple black frame. tried rendering it out and the render is also black throughout. i have two masters at 2880x2160p and they both do this. one is grass valley hqx and the other is dnxhr 12 bit. both do the same thing: they each load but display only a black frame. handbrake is able to open and display preview frames for both of these masters. mpv player also plays them both. avspmod shows both masters as black.

edit:
both the dnxhr and gv-hqx files original files open properly in virtualdub so, i guess, it's something to do with my avisynth script. maybe the loading of the file?
Code:
FFMPEGSource2("film_source_2880x2160p_DNxHR_444_12bit_23976fps.mov", atrack=1)
#FFMPEGSource2("film_source_2880x2160p_GV-HQX_23976fps.mov", atrack=1)
#ConvertToYV12(matrix="rec709")
z_ConvertFormat(pixel_type="YUV420P16")

@kedautinh12
tried the sharpening pack as well as the hbd function as a standalone as i wasn't sure what i was supposed to do since there were a lot of functions all in one pack. in any event, i got an error that there was no function named ex_bs. it's this line:
Code:
thres  = ex_bs(thres, 8, bi, fulls=rgb, flt=true)
and is at line 649 in the overall pack.

thanks for any ideas.
babag

Last edited by BabaG; 9th December 2022 at 07:18.
BabaG is offline   Reply With Quote
Old 9th December 2022, 07:17   #11  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
You need ExTools and RgTools to work
https://github.com/Dogway/Avisynth-S...r/ExTools.avsi
https://github.com/pinterf/RgTools/releases
kedautinh12 is offline   Reply With Quote
Old 9th December 2022, 07:26   #12  |  Link
BabaG
Registered User
 
Join Date: Dec 2003
Posts: 253
thanks, kedautinh12. seems i have rgtools but not extools. downloaded and installed. will probably try tomorrow.

thanks again,
babag
BabaG is offline   Reply With Quote
Old 9th December 2022, 20:50   #13  |  Link
BabaG
Registered User
 
Join Date: Dec 2003
Posts: 253
currently working on why the image is black and it seems to be this:
Code:
Levels(20, 1.0, 240, 0, 255)
is there an alternative?

thanks,
babag
BabaG is offline   Reply With Quote
Old 9th December 2022, 21:15   #14  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,377
Quote:
Originally Posted by BabaG View Post
currently working on why the image is black and it seems to be this:
Code:
Levels(20, 1.0, 240, 0, 255)
is there an alternative?

thanks,
babag
Those are 8bit values. I'm pretty sure you posted about this already

10bit code values go from 0 to 1023 . A rough approximation would be to multiply by 4. coring=false means don't clip the values to limited range

Levels(80,1,960,0,1023, false)

EDIT:
Quote:
z_ConvertFormat(pixel_type="YUV420P16")
Or if it's converted 16 bit you're working with, they go from 0 to 65535 . You didn't post your script or specify where you have your levels

Last edited by poisondeathray; 9th December 2022 at 21:19.
poisondeathray is offline   Reply With Quote
Old 9th December 2022, 21:53   #15  |  Link
BabaG
Registered User
 
Join Date: Dec 2003
Posts: 253
thanks, pdr, and you're right, of course. i did get bit by this before. got lost navigating all of the various things i don't really understand about this stuff but am approaching the end, i hope, of the process. moving now from test materials to real world, hence, the higher resolutions and bit depths.

thanks again,
babag
BabaG is offline   Reply With Quote
Old 9th December 2022, 22:17   #16  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 703
StainlessS made it like this:
https://forum.doom9.org/showthread.p...61#post1975161
anton_foy is offline   Reply With Quote
Old 9th December 2022, 22:58   #17  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 1,002
Quote:
Originally Posted by Reel.Deel View Post
Replace UnsharpMask with the script version from here: https://forum.doom9.org/showthread.p...11#post1875711
Quote:
Originally Posted by kedautinh12 View Post
The better alternative, same quality as the original.

https://github.com/realfinder/AVS-St...Mask_avsi.avsi
__________________
Live and let live
gispos is offline   Reply With Quote
Old 10th December 2022, 02:47   #18  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
Quote:
Originally Posted by gispos View Post
The better alternative, same quality as the original.

https://github.com/realfinder/AVS-St...Mask_avsi.avsi
Better? I think it's same cause Dogway base it and change from masktools to extools
kedautinh12 is offline   Reply With Quote
Old 10th December 2022, 12:40   #19  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 1,002
Quote:
Originally Posted by kedautinh12 View Post
Better? I think it's same cause Dogway base it and change from masktools to extools
But is still different.
I had compared the versions and UnsharpMask_avsi is almost identical to the original (That I like).
Other versions give different results. I just wanted to point out an alternative that gives almost the same result.
__________________
Live and let live
gispos is offline   Reply With Quote
Reply


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 06:54.


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