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 24th January 2019, 01:36   #41  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,396
Thanks for the plugin videoh I got a black screen when I set fullrange=false. It works okay with fullrange=true.

Code:
LoadPlugin("C:\HDTV Tools\DGDecNV\DGDecodeNV.dll")
LoadPlugin("C:\HDTV Tools\avscube\x64\vscube.dll")

DGSource("00005.dgi").crop(0,114,-0,-114).ConvertBits(16)

ConvertToPlanarRGB(matrix="PC.709").crop(0,1,0,-1)

Cube("C:\HDTV Tools\avscube\U-CANON-C-LOG-V1-LTR.cube", fullrange=true)

ConvertToYUV420(matrix="PC.709").ConvertBits(8, dither = 0)
Stereodude is offline   Reply With Quote
Old 24th January 2019, 03:30   #42  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,583
I'll look into it, Stereodude. Thanks for pointing it out. Can you please give me your cube file? Thank you.
videoh is offline   Reply With Quote
Old 24th January 2019, 21:26   #43  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,396
Quote:
Originally Posted by videoh View Post
I'll look into it, Stereodude. Thanks for pointing it out. Can you please give me your cube file? Thank you.
It's in this zip file.

http://stereodude.net/LUT.zip
Stereodude is offline   Reply With Quote
Old 24th January 2019, 23:11   #44  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,583
Got it, thank you.

Can you give me a mediainfo dump on your source file, please? Is it HDR, etc?

Last edited by videoh; 24th January 2019 at 23:19.
videoh is offline   Reply With Quote
Old 24th January 2019, 23:40   #45  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,583
Seems that this was fixed in timecube at some point:

https://forum.doom9.org/showthread.p...30#post1850130

The code link there is broken so I'll try to hunt down the r2 changes.
videoh is offline   Reply With Quote
Old 24th January 2019, 23:48   #46  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,583
Latest code is here:

https://github.com/sekrit-twc/timecube

I'll do a re-port to Avisynth+ starting with this latest code.
videoh is offline   Reply With Quote
Old 24th January 2019, 23:59   #47  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,396
Quote:
Originally Posted by videoh View Post
Got it, thank you.

Can you give me a mediainfo dump on your source file, please? Is it HDR, etc?
Code:
General
Complete name                            : E:\TempBD\TIM\05\00005.h264
Format                                   : AVC
Format/Info                              : Advanced Video Codec
File size                                : 618 MiB
Overall bit rate mode                    : Variable

Video
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, RefFrames               : 4 frames
Bit rate mode                            : Variable
Maximum bit rate                         : 38.0 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
It is FHD directly from a Blu-ray. It is not HDR. It looks very flat. I believe that they shot the footage in C-Log (Canon Log) and didn't bother to grade it. Hence my interest in applying a C-Log to Rec709 3D LUT to it. I'm not sure if it should be fullrange=false or true. I wanted to try both and look at the output visually when I noticed that fullrange=false gave black screen output.
Stereodude is offline   Reply With Quote
Old 25th January 2019, 00:10   #48  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,583
OK, thanks. As I mentioned, I'll re-port the latest code.
videoh is offline   Reply With Quote
Old 25th January 2019, 21:24   #49  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,583
Rather than upgrade to r2a I ported the fullrange fix only. Here is the revised version:

http://rationalqm.us/hdr/avscube_1.1.rar
videoh is offline   Reply With Quote
Old 26th January 2019, 02:23   #50  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,396
Quote:
Originally Posted by videoh View Post
Rather than upgrade to r2a I ported the fullrange fix only. Here is the revised version:

http://rationalqm.us/hdr/avscube_1.1.rar
I get an error on both the x86 and x64 versions.

x64:
'C:/HDTV Tools/avscube/x64/vscube.dll' cannot be used as a plugin for AviSynth.

x86:
'C:/HDTV Tools/avscube/x86/vscube.dll' cannot be used as a plugin for AviSynth.
Stereodude is offline   Reply With Quote
Old 26th January 2019, 02:42   #51  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,583
Hmm, that's strange. I will look into it. This doesn't happen with my version 1.0 DLL? What version of Avisynth+ are you using?
videoh is offline   Reply With Quote
Old 26th January 2019, 03:00   #52  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,396
Quote:
Originally Posted by videoh View Post
Hmm, that's strange. I will look into it. This doesn't happen with my version 1.0 DLL? What version of Avisynth+ are you using?
No, the 1.0 version works fine in x64 & x86 (aside from the bug I reported earlier). I have AviSynth+ 0.1 (r2772, MT, x86_64) (0.1.0.0)
Stereodude is offline   Reply With Quote
Old 27th January 2019, 15:41   #53  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,583
Somehow avscube.dll got excluded from the build after I updated VS 2017. I have fixed it. Please re-download to get the fixed version.
videoh is offline   Reply With Quote
Old 28th January 2019, 01:20   #54  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Metropolitan City of Milan, Italy
Posts: 1,850
Quote:
Originally Posted by videoh View Post
Somehow avscube.dll got excluded from the build after I updated VS 2017. I have fixed it. Please re-download to get the fixed version.
Tested on WinXP SSE4.1 and it works fine with fullrange=true now.
Thanks again.
FranceBB is offline   Reply With Quote
Old 28th January 2019, 03:24   #55  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,396
Quote:
Originally Posted by videoh View Post
Somehow avscube.dll got excluded from the build after I updated VS 2017. I have fixed it. Please re-download to get the fixed version.
Seems to be working okay with the updated version. No more black screen and the fullrange switch works.
Stereodude is offline   Reply With Quote
Old 28th January 2019, 04:57   #56  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,583
Great. Thanks for your testing and for reporting the issue.
videoh is offline   Reply With Quote
Old 27th November 2020, 08:32   #57  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Metropolitan City of Milan, Italy
Posts: 1,850
Hi Donald,
I'm resurrecting this topic as it seems to be the only one which is AVSCube related and I'd like to ask you something about it.
I've been using it all the time at work, in production, on my Xeon 28c/56th machines, but I'd like to speed things up a bit as all my server run fairly recent NVIDIA Quadro cards.
You're a developer, you know CUDA, you made many hardware accelerated plugins, are you tempted even just a little bit to make this CUDA accelerated as well?
FranceBB is offline   Reply With Quote
Old 15th September 2021, 21:32   #58  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Metropolitan City of Milan, Italy
Posts: 1,850
I know that we all took this as granted, but just to reassure everyone, I made a simple test for Cube() with the identity matrix.

Test1:

Code:
#Indexing
video=LWLibavVideoSource("Z:\YUV_pattern-2fr.v210-14-2020PQ.mov")
audio=BlankClip(length=1, channels=8, audio_rate=48000, fps=25)
AudioDub(video, audio)

#From 4:2:2 10bit to 4:2:2 16bit planar
ConvertBits(16)

#From 4:2:2 16bit planar Narrow Range to RGB Planar 16bit Narrow Range
z_ConvertFormat(pixel_type="RGBP16", colorspace_op="2020:2020:2020:limited=>rgb:2020:2020:limited", dither_type="none", resample_filter="Spline64")
Test2:

Code:
#Indexing
video=LWLibavVideoSource("Z:\YUV_pattern-2fr.v210-14-2020PQ.mov")
audio=BlankClip(length=1, channels=8, audio_rate=48000, fps=25)
AudioDub(video, audio)

#From 4:2:2 10bit to 4:2:2 16bit planar
ConvertBits(16)

#From 4:2:2 16bit planar Narrow Range to RGB Planar 16bit Narrow Range
z_ConvertFormat(pixel_type="RGBP16", colorspace_op="2020:2020:2020:limited=>rgb:2020:2020:limited", dither_type="none", resample_filter="Spline64")

#From PQ to HLG with 16bit precision
Cube("Z:\IDENTITY.cube", fullrange=true)

I called "Test1" as noLUT and "Test2" as IdentityMatrix.

Now, since anything times the identity matrix returns itself and therefore applying it or not shouldn't change anything (unless linear algebra and my whole life is a lie xD), I expected Test1 and Test2 to be the same, so I did:

Code:
noLUT=ImageSource("\\mibctvan000\Ingest\MEDIA\temp\Test4_PQ_Avisynth_no_LUT_no_dithering_RGBP16.tiff").ConverttoYUV444()
IdentityMatrix=ImageSource("\\mibctvan000\Ingest\MEDIA\temp\Test6_PQ_Avisynth_IdentityMatrix_no_dithering_RGBP16.tiff").ConverttoYUV444()

StackHorizontal(noLUT, IdentityMatrix)
TurnRight.Histogram.TurnLeft #luma
and indeed it returned:https://i.imgur.com/YFBVZTn.png

and since I couldn't see differences at first glance, I tried with Subtract:

Code:
noLUT=ImageSource("\\mibctvan000\Ingest\MEDIA\temp\Test4_PQ_Avisynth_no_LUT_no_dithering_RGBP16.tiff").ConverttoYUV444()
IdentityMatrix=ImageSource("\\mibctvan000\Ingest\MEDIA\temp\Test6_PQ_Avisynth_IdentityMatrix_no_dithering_RGBP16.tiff").ConverttoYUV444()

Subtract(noLUT, IdentityMatrix)
which shouldn't have been returning differences, in fact: https://i.imgur.com/3UTpdiB.png

So I thought: Uhm, maybe it's just my eyes but I can't see any difference, let's try with SSIM and...

Code:
noLUT=ImageSource("\\mibctvan000\Ingest\MEDIA\temp\Test4_PQ_Avisynth_no_LUT_no_dithering_RGBP16.tiff").ConverttoYUV420().ConvertBits(bits=8, dither=-1)
IdentityMatrix=ImageSource("\\mibctvan000\Ingest\MEDIA\temp\Test6_PQ_Avisynth_IdentityMatrix_no_dithering_RGBP16.tiff").ConverttoYUV420().ConvertBits(bits=8, dither=-1)

SSIM(noLUT, IdentityMatrix, "results.csv", "globalSSIM.txt", lumimask=1, scaled=1)
returned Y=1.0000, U=1.0000, V=1.0000
so a perfect score, which means that the two are exactly the same: https://i.imgur.com/uxznR68.png

so I can confirm that Cube() works as expected.

The reason why I've made this test is to be 100% sure as I've been having some stuff processed through an analyzer and although the result was... "fine", there were some slight variations from how it should have been, so I was trying to find one function to blame but apparently it's not Cube() eheheheheh.

Anyway, I think it was worth sharing to reassure everyone that the function is mathematically correct and does what it's supposed to do.
FranceBB is offline   Reply With Quote
Reply

Tags
3dl, cube, hdr, lut, sdr

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 13:51.


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