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 > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th December 2018, 10:02   #241  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
Quote:
Originally Posted by poisondeathray View Post
Did you get an error message ?
No error messages; just the x264 process that reports a broken pipe on the first frame it processes:

encoded 1 frames, 12.82 fps, 238.61 kb/s
Error: fwrite() call failed when writing frame: 0, plane: 0, errno: 32
Output 9 frames in 2.06 seconds (4.38 fps)
Core freed but 24883200 bytes still allocated in framebuffers

Quote:
I got an error messge complaining that didn't have nnedi3_resample.py , so I needed to download it and put it into site-packages , then it worked
I got nnedi3_resample.py in site-packages (and nnedi3_weights.bin in the plugins64 directory), as per usual.

Quote:
use_fmtc=False by default if you look at muvsfunc

I saw that, yeah; but it was not caused the breakage.
__________________
Gorgeous, delicious, deculture!
asarian is offline   Reply With Quote
Old 10th December 2018, 15:36   #242  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,374
Quote:
Originally Posted by asarian View Post
No error messages; just the x264 process that reports a broken pipe on the first frame it processes:

encoded 1 frames, 12.82 fps, 238.61 kb/s
Error: fwrite() call failed when writing frame: 0, plane: 0, errno: 32
Output 9 frames in 2.06 seconds (4.38 fps)
Core freed but 24883200 bytes still allocated in framebuffers


1) Did you convert it to the final pixel format in the script? eg. YUV420P8 if encoding 8bit 4:2:0 etc... YUV420P10 if 10bit 4:2:0 . Or whatever you're doing

2) Are you using correct matching vspipe with your vapoursynth version ?

Post commandline if neither of those is the cause
poisondeathray is offline   Reply With Quote
Old 10th December 2018, 16:03   #243  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
Quote:
Originally Posted by poisondeathray View Post
1) Did you convert it to the final pixel format in the script? eg. YUV420P8 if encoding 8bit 4:2:0 etc... YUV420P10 if 10bit 4:2:0 . Or whatever you're doing
I'm just trying to downsize it to a regular Blu-ray format, 8-bit, compressed with x264.

I use dgdecodenv, which, if I understood it correctly, will output the UHD input as 8-bit YV12 by default.

Quote:
2) Are you using correct matching vspipe with your vapoursynth version ?
Yes, matching vspipe is being used. The whole new setup works flawlessly (already done 2 discs with it), but it's just this SSIM_downsample that won't budge for me.
__________________
Gorgeous, delicious, deculture!
asarian is offline   Reply With Quote
Old 10th December 2018, 16:12   #244  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,374
You have to convert it back to the final pixel format. That filter converts up to float
poisondeathray is offline   Reply With Quote
Old 10th December 2018, 16:17   #245  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
Quote:
Originally Posted by poisondeathray View Post
You have to convert it back to the final pixel format. That filter converts up to float
Ah, that would explain it. Thx!
__________________
Gorgeous, delicious, deculture!
asarian is offline   Reply With Quote
Old 11th December 2018, 07:16   #246  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
Quote:
Originally Posted by poisondeathray View Post
1) Did you convert it to the final pixel format in the script? eg. YUV420P8 if encoding 8bit 4:2:0 etc... YUV420P10 if 10bit 4:2:0 . Or whatever you're doing

Bloody h*ell! Looks like I got the colorspace messed up, after all: flaccid colors

The bottom image is the result of extracting the HEVC stream with TsMuxer (as eac3to can't extract to .mkv for HEVC yet), so prior to me re-encoding it. The colors are all flaccid, and not vibrant at all.

Is there any way I could change the header of the encoded file somehow, and set a different colorspace? Or am I too late already?

And perhaps more importantly, as TsMuxer apparently screws up the stream, and eac3to can't do it, what is the best way to extract the HEVC stream properly? (to feed to the VS input filters).
__________________
Gorgeous, delicious, deculture!
asarian is offline   Reply With Quote
Old 11th December 2018, 08:10   #247  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
^^ Ok, I did some comparison:

stream comparison

The pane on the right is from the resultant tsMuxer stream, the one of the right of the original Blu-ray m2ts. Far as I can see, they're identical! No bit-depth is lost, no colorspace conversion took place, etc. Yet playing/encoding the stream muxed by tsMuxer yields all these flaccid colors.
__________________
Gorgeous, delicious, deculture!
asarian is offline   Reply With Quote
Old 11th December 2018, 09:36   #248  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
Hmm, after the initial shock, I think the UHD 'Oblivion' disc is simply encoded with flatter colors. (Which is possible, of course) I can't see another reason. I got 2 other UHD discs so far (I intend to make Pan @ Scan HD versions, from UHD, for some of my fave movies), and they look about the same, color-wise (demuxed) as their original. So, no weirdness was going on, after all. Maybe I should get my money back on the Oblivion UHD. (Or make the colors a bit more vibrant myself).
__________________
Gorgeous, delicious, deculture!
asarian is offline   Reply With Quote
Old 11th December 2018, 16:18   #249  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,374
Quote:
Originally Posted by asarian View Post
Hmm, after the initial shock, I think the UHD 'Oblivion' disc is simply encoded with flatter colors. (Which is possible, of course) I can't see another reason. I got 2 other UHD discs so far (I intend to make Pan @ Scan HD versions, from UHD, for some of my fave movies), and they look about the same, color-wise (demuxed) as their original. So, no weirdness was going on, after all. Maybe I should get my money back on the Oblivion UHD. (Or make the colors a bit more vibrant myself).
You probably have to tonemap it . It's HDR10 release, correct?

Code:
https://www.blu-ray.com/movies/Oblivion-4K-Blu-ray/156371/

Quote:
HDR: HDR10 Universal's 2160p, HDR-enabled presentation...
One option is DGHDRtoSDR , another is vapoursynth tonemap

Last edited by poisondeathray; 11th December 2018 at 16:23.
poisondeathray is offline   Reply With Quote
Old 11th December 2018, 17:07   #250  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by poisondeathray View Post
One option is DGHDRtoSDR
You may like this one as it is GPU accelerated. Apply it after resizing on the GPU (if needed) for maximum performance.

Last edited by videoh; 11th December 2018 at 17:11.
videoh is offline   Reply With Quote
Old 11th December 2018, 19:09   #251  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
I do tonemap that way
Code:
den = core.resize.Bicubic(clip=den, format=vs.RGBS, filter_param_a=0.0, filter_param_b=0.75, range_in_s="limited", matrix_in_s="2020ncl", primaries_in_s="2020", primaries_s="2020", transfer_in_s="st2084", transfer_s="linear",dither_type="none", nominal_luminance=mcll)
den = core.tonemap.Mobius(clip=den, exposure=exposure, transition=0.3, peak=mcll)
den = core.fmtc.resample(den, resw, resh, kernel="bilinear", invks=True, invkstaps=3, taps=4)
den = core.resize.Bicubic(clip=den, format=vs.YUV444PS, filter_param_a=0.0, filter_param_b=0.75, matrix_s="709", primaries_in_s="2020", primaries_s="709", transfer_in_s="linear", transfer_s="709")
res = core.fmtc.resample(den, resw, resh, invks=True, kernel="bicubic", invkstaps=3, css="420").fmtc.bitdepth(bits=8, dmode=3, flt=False)
the parameters you need to pass are resw and resh for the final resolution, mcll for the mcll parameter of your stream, you can get it with mediainfo, and exposure you need to set as you like it, i suggest you to compare with the SDR bluray, as the tonemap filter i use this one https://github.com/ifb/vapoursynth-tonemap
MonoS is offline   Reply With Quote
Old 11th December 2018, 23:18   #252  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
Quote:
Originally Posted by videoh View Post
You may like this one as it is GPU accelerated. Apply it after resizing on the GPU (if needed) for maximum performance.
This looks like just what the doctor ordered! Unfortunately, the pertinent thread points to an invalid rar: https://forum.doom9.org/showthread.php?t=175624


EDIT: Nevermind: found a newer version in the directory itself.
__________________
Gorgeous, delicious, deculture!

Last edited by asarian; 11th December 2018 at 23:26.
asarian is offline   Reply With Quote
Old 11th December 2018, 23:39   #253  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Latest version is always linked on my web page:

http://rationalqm.us/mine.html
videoh is offline   Reply With Quote
Old 12th December 2018, 00:07   #254  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
@videoh could you make a vapoursynth section on your webpage too? Or mark filters with native vapoursynth support somehow?
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 12th December 2018, 00:08   #255  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
OK, will do. Thanks for the suggestion.
videoh is offline   Reply With Quote
Old 12th December 2018, 00:13   #256  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
Quote:
Originally Posted by videoh View Post
OK, will do. Thanks for the suggestion.
And, while we're at it, could you please also make DGDenoise native to vapoursynth? (so that DGDecodeNV.dll doesn't need to be loaded as legacy avs filter any more for it, with LoadPlugin).
__________________
Gorgeous, delicious, deculture!
asarian is offline   Reply With Quote
Old 12th December 2018, 03:15   #257  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by asarian View Post
And, while we're at it, could you please also make DGDenoise native to vapoursynth? (so that DGDecodeNV.dll doesn't need to be loaded as legacy avs filter any more for it, with LoadPlugin).
The problem for me is that implementing both native Avisynth and native Vapoursynth versions creates a lot of code duplication and extra maintenance. I have not found a solution to this. Myrsloik has stated, and testing bears out, that there is no performance penalty for using the avscompat mechanism. So unless a compelling argument is advanced, I'll prefer to just make one version. If Avisynth could import Vapoursynth filters then I would reverse things.

I had already implemented native Vapoursynth for DGSource() before I settled on this policy.
videoh is offline   Reply With Quote
Old 12th December 2018, 03:32   #258  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
Quote:
Originally Posted by videoh View Post
The problem for me is that implementing both native Avisynth and native Vapoursynth versions creates a lot of code duplication and extra maintenance. I have not found a solution to this. Myrsloik has stated, and testing bears out, that there is no performance penalty for using the avscompat mechanism. So unless a compelling argument is advanced, I'll prefer to just make one version. If Avisynth could import Vapoursynth filters then I would reverse things.

I had already implemented native Vapoursynth for DGSource() before I settled on this policy.
Okay, thx. That sounds entirely reasonable. I tried it out last night on a re-encode, and was worried that maybe the avs route would be less stable somehow, but turned out to be rocksolid after all.
__________________
Gorgeous, delicious, deculture!
asarian is offline   Reply With Quote
Old 12th December 2018, 03:42   #259  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
^^ P.S. I'm continually amazed at how fast the GPU stuff is. Naturally, my GTX 1080 Ti is a beast, but especially the GPU load (measured by GPU-Z) is extremely low: along with OpenCL support for x264, the gpu-assisted resize, and DGDenoise, the entire GPU load only dips into a few percent, every now then. nVidea, ftw!
__________________
Gorgeous, delicious, deculture!
asarian is offline   Reply With Quote
Old 12th December 2018, 04:20   #260  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by asarian View Post
^^ P.S. I'm continually amazed at how fast the GPU stuff is.
Yes, it clearly outperforms CPU implementations and if you can eliminate unnecessary CPU<->GPU transfers (think CUDASynth) it blows CPU away into the next galaxy.

Quote:
Naturally, my GTX 1080 Ti is a beast, but especially the GPU load (measured by GPU-Z) is extremely low: along with OpenCL support for x264, the gpu-assisted resize, and DGDenoise, the entire GPU load only dips into a few percent, every now then. nVidea, ftw!
Who can argue with that? I like to remind people to look at the CPU utilization too, because savings can be applied to CPU things, especially encoding.
videoh 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 03:38.


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