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 22nd November 2018, 22:16   #1  |  Link
TomArrow
Registered User
 
Join Date: Dec 2017
Posts: 90
AviSynth+, basic filters that work with RGBAPS color format?

I'm doing the following:

Code:
video=FFVideoSource("HDRVideo.mkv")
video=video.ConvertBits(16).ConvertToYUV444()
video=Spline36ResizeMT(video,1920,800,SetAffinity=false).Sharpen(0.2)
video=z_ConvertFormat(video,pixel_type="RGBPS",colorspace_op="2020ncl:st2084:2020:l=>rgb:linear:2020:l", dither_type="none").DGHable(exposure=0.1,d=0.00001,e=0.0295,f=0.3,a=5)
video=z_ConvertFormat(video,pixel_type="YUV444P16",colorspace_op="rgb:linear:2020:l=>709:709:709:l",dither_type="ordered")
video
The main purpose of this is the HDR to SDR tonemapping via DGHable.

But here I was wondering, is there any way to adjust the image in the RGBPS color format? That's the format it has after the first call to z_ConvertFormat and as I understand it, this is a floating point format in which the image is stored in linear color space.

It would be nice if I could make some very basic adjustments to the image in this colorspace. For example contrast, gain, etc. for a very rudimentary color correction. In particular I'd like trying to just scale the green channel down a little bit (say, multiply it with 0.95).

Unfortunately RGBAdjust doesn't work in RGBPS. Tweak doesn't work for obvious reasons.

Is there some kind of list of filters that actually are compatible with this color format?

I know I could just make the tweaks after it's converted back to a "normal" color format, but I want to play around with the linear color space a bit.
TomArrow is offline   Reply With Quote
Old 22nd November 2018, 22:22   #2  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Expr filter should work. And I'll have a look at RGBAdjust why it stuck in the stone age.
pinterf is offline   Reply With Quote
Old 22nd November 2018, 23:18   #3  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Levels() works in RGBPS ok too

Request: Can someone re-write HistogramRGBLevels , HistogramRGBParade, functions so they compatible with other bit depths?
http://avisynth.nl/index.php/Histograms_in_RGB_%26_CMY
poisondeathray is offline   Reply With Quote
Old 23rd November 2018, 10:08   #4  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,309
If you want, you can try this, if you're using my plugins (if you want to convert HDR PQ to SDR) :
Code:
video=FFVideoSource("HDRVideo.mkv")
video=video.ConvertBits(16).ConvertToYUV444()
video=Spline36ResizeMT(video,1920,800,SetAffinity=false).Sharpen(0.2)
video=ConvertYUVtoLinearRGB(video,Color=0,OutputMode=2).DGHable(...)
video=ConvertLinearRGBtoYUV()
video
If you don't need separate tuning, DGHable will very probably be faster than my ConvertRGB_Hable_HDRtoSDR.
__________________
My github.
jpsdr is offline   Reply With Quote
Old 23rd November 2018, 13:33   #5  |  Link
TomArrow
Registered User
 
Join Date: Dec 2017
Posts: 90
Quote:
Originally Posted by pinterf View Post
Expr filter should work. And I'll have a look at RGBAdjust why it stuck in the stone age.
Thanks man. Can you give me a quick example of how Expr works? I read the page but it doesn't click yet.

Say I want to multiply the green channel with 0.98, how would I go about that?
TomArrow is offline   Reply With Quote
Old 23rd November 2018, 13:36   #6  |  Link
TomArrow
Registered User
 
Join Date: Dec 2017
Posts: 90
Quote:
Originally Posted by jpsdr View Post
If you want, you can try this, if you're using my plugins (if you want to convert HDR PQ to SDR) :
Code:
video=FFVideoSource("HDRVideo.mkv")
video=video.ConvertBits(16).ConvertToYUV444()
video=Spline36ResizeMT(video,1920,800,SetAffinity=false).Sharpen(0.2)
video=ConvertYUVtoLinearRGB(video,Color=0,OutputMode=2).DGHable(...)
video=ConvertLinearRGBtoYUV()
video
If you don't need separate tuning, DGHable will very probably be faster than my ConvertRGB_Hable_HDRtoSDR.
Pardon me, but I don't entirely understand what you are suggesting. You replaced those z_ConvertFormat calls with other functions. Is there a benefit to that?
TomArrow is offline   Reply With Quote
Old 23rd November 2018, 14:21   #7  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by TomArrow View Post
Thanks man. Can you give me a quick example of how Expr works? I read the page but it doesn't click yet.

Say I want to multiply the green channel with 0.98, how would I go about that?
rgbclip=rgbclip.Expr("x","x 0.98 *","x")
pinterf is offline   Reply With Quote
Old 23rd November 2018, 15:49   #8  |  Link
TomArrow
Registered User
 
Join Date: Dec 2017
Posts: 90
Quote:
Originally Posted by pinterf View Post
rgbclip=rgbclip.Expr("x","x 0.98 *","x")
Fucking fantastic, thank you so much, now I think I get it! Though it seems that I have an older version where this will multiply the blue channel due to that GBR ordering bug, but no problem at all, I see the logic behind it now.
TomArrow is offline   Reply With Quote
Old 23rd November 2018, 16:08   #9  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,309
As you're using one of my filters, Spline36ResizeMT, maybe you want to try/test those on my HDRTools, it's a plugin dedicated to HDR/SDR work, if you're interested or curious to check.
__________________
My github.

Last edited by jpsdr; 23rd November 2018 at 16:12.
jpsdr is offline   Reply With Quote
Old 23rd November 2018, 16:29   #10  |  Link
TomArrow
Registered User
 
Join Date: Dec 2017
Posts: 90
Quote:
Originally Posted by jpsdr View Post
As you're using one of my filters, Spline36ResizeMT, maybe you want to try/test those on my HDRTools, it's a plugin dedicated to HDR/SDR work, if you're interested or curious to check.
Ah, I see. I'm gonna be honest, I mostly just modified the script that came with ripbot264, that's why I'm using your filters. Nice meeting you though, I didn't realize the community was this tight knit.

Gonna check out your projects.
TomArrow is offline   Reply With Quote
Reply

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 15:48.


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