This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

[HELP] libplacebo (tonemapping) crashes...
#1
Hi Selur,

I just tried to use tonemapping with a HDR 4k source. All other options work without problems, but the last one with libplacebo (which is the most interesting to me) does crash.
I took the VS script, and tried to use it in VirtualDub64. It works, when I comment the tonemap-line out. If not, Virtualdub crashes with a memory problem in libplacebo. When I don't specify any parametres (only clip), I receive an error, that the input colorspace is not specified, so the library is correctly installed and works. When I specify (correctly) 1 for this parametre, it crashes.
I then tried an older version with extra libdovi in the same directory: Also crashes.
I am out of options. What can it be? Is Windows 11 maybe required? I am under Win 10.
Reply
#2
# Imports
import vapoursynth as vs
# getting Vapoursynth core
import sys
import os
core = vs.core
# Import scripts folder
scriptPath = 'F:/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# loading plugins
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libvs_placebo.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/DGDecNV/DGDecodeNV.dll")
# Import scripts
import validate
# Source: 'G:\TestClips&Co\files\HDR\HDR10\4K sun HDR test.mp4'
# Current color space: YUV420P10, bit depth: 10, resolution: 3840x2160, frame rate: 25fps, scanorder: progressive, yuv luminance scale: limited, matrix: 2020ncl, transfer: smpte2084, primaries: bt.2020, format: HEVC
# Loading G:\TestClips&Co\files\HDR\HDR10\4K sun HDR test.mp4 using DGSource
clip = core.dgdecodenv.DGSource("J:/tmp/mp4_103cd4c1d7cbc771969218d2162207ff_853323747.dgi")# 25 fps, scanorder: progressive
frame = clip.get_frame(0)
# setting color matrix to 2020ncl.
clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT2020_NCL)
# setting color transfer (vs.TRANSFER_ST2084), if it is not set.
if validate.transferIsInvalid(clip):
  clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_ST2084)
# setting color primaries info (to vs.PRIMARIES_BT2020), if it is not set.
if validate.primariesIsInvalid(clip):
  clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT2020)
# setting color range to TV (limited) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
# making sure frame rate is set to 25fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# making sure the detected scan type is set (detected: progressive)
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
# adjusting color space from YUV420P16 to YUV444P16 for vsToneMapPlacebo
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, range_s="limited")
# color adjustment using ToneMap (Placebo)
clip = core.placebo.Tonemap(clip=clip, src_csp=1, dst_csp=0, src_min=0.0050, src_max=1000.0000, dst_min=0.2023, dst_max=203.0000, dynamic_peak_detection=1, tone_mapping_param=0.000)
# adjusting output color from: YUV444P16 to YUV420P10 for NVEncModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, range_s="limited", dither_type="error_diffusion")
# set output frame rate to 25fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# output
clip.set_output()
works fine here.
Since you didn't share any details, I have no way to reproduce this.
In Hybrid, you could open the Vapoursynth Preview to check whether the script itself works. If it does not, it should show an error.
If you can reproduce the crash you could create a debug output, which contains details, like what the used script looks like, what Hybrid version you used, what parameters you used,....

Quote:Is Windows 11 maybe required? I am under Win 10.
No.

Quote: Virtualdub crashes with a memory problem in libplacebo.
Not knowing anything about your setup, it might be that some other filter is autoloaded because of a Python/Vapoursynth setup which autoloads something that is causing problems. Could be a memory issue. Could be some overclocking or similar. Could be a bug in libplacebo. Could be some overactive virus scanner.
Could be a gpu driver issue.

Quote:I am out of options.
Read the sticky, provide proper details that allow to reproduce the issue.
Also share details about your system. (What CPU are you using? Any virus scanner running? Any media player or other software using the gpu running? Any tuning tools running? Is the system overclocked.)
Does this only happen with this source, or also with others?

The bug tracker over at https://github.com/Lypheo/vs-placebo/issues doesn't list any known memory issues.

=> sorry, without details I can do nothing more than guessing.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#3
Thanks for your long reply. I tried to break down the problem to a very simple point, that is why I tried it with VirtualDub.

Hybrid: It is the original unchanged (complete) version. Everything works fine. Only the special Tonemapping filter does not (all other tonemapping filters f. e. work)
Of course I do not get any Error, otherwise I would have posted it here.
I built an index for libavvideosource, so that opening the file does not last long, only one second.
With the other tonemap filters the preview opens after 1 or 2 seconds.
With libplacebo you wait forever. The preview window just silently does not open, no error, no working GPU (or CPU) cooler, no memory usage.

You are right, I could have provided (and look into) the debug file, sorry! I just did, the result:

  HYBRID
2025.01.26 - 19:11:20_Windows 10 Version 21H2 (64bit)_2024.12.21.1 - level 9: Preview::indexingIsFinished 'VAPOURSYNTHPREVIEW' ignored,..
2025.01.26 - 19:11:20_Windows 10 Version 21H2 (64bit)_2024.12.21.1 - level 9: Got unhandled IPC message:  F a i l e d   t o   l o a d   C : \ U s e r s \ B M F \ A p p D a t a \ R o a m i n g \ V a p o u r S y n t h \ p l u g i n s 6 4 \ l i b m v t o o l s _ s f _ e m 6 4 t . d l l .   G e t L a s t E r r o r ( )   r e t u r n e d   1 2 6 .   T h e   f i l e   y o u   t r i e d   t o   l o a d   o r   o n e   o f   i t s   d e p e n d e n c i e s   i s   p r o b a b l y   m i s s i n g .
2025.01.26 - 19:11:20_Windows 10 Version 21H2 (64bit)_2024.12.21.1 - level 9: Got unhandled IPC message:  F a i l e d   t o   l o a d   C : \ U s e r s \ B M F \ A p p D a t a \ R o a m i n g \ V a p o u r S y n t h \ p l u g i n s 6 4 \ l i b m v t o o l s _ s f _ e m 6 4 t . d l l .   G e t L a s t E r r o r ( )   r e t u r n e d   1 2 6 .   T h e   f i l e   y o u   t r i e d   t o   l o a d   o r   o n e   o f   i t s   d e p e n d e n c i e s   i s   p r o b a b l y   m i s s i n g .
2025.01.26 - 19:11:22_Windows 10 Version 21H2 (64bit)_2024.12.21.1 - level 9: --- vsViewer output - START ---
2025.01.26 - 19:11:22_Windows 10 Version 21H2 (64bit)_2024.12.21.1 - level 9: --- vsViewer output - END ---

The newest library version that is also included in Hybrid has a linked libdovi. As I wrote, I thought, maybe this could be the reason, so I took an older libplacebo with separated libdovi, but got the same error.

Something else must be missing. I have installed the c++ runtimes from 2005-2022. Is there a newer one?

Configuration: Windows 10, Intel i7 7700K, Nvidia Geforce GTX 1070.

It seems to be the mixture between my standard vapoursynth and Hybrid-vaporsynth installs.
I will find out somehow, if not, I will ask you again. Thank you very much for now - you already helped me by reminding on the debug file!
Reply
#4
Okay, problem is with https://github.com/IFeelBloated/vapoursynth-mvtools-sf not libplacebo.

You can use the 64bit version of https://www.dependencywalker.com/ to check the dll to see what's missing on your system. (not on my pc atm. so I can't check the dependencies here)

Latest runtimes should be available here:
https://learn.microsoft.com/en-us/cpp/wi...le-version

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#5
Quote:It seems to be the mixture between my standard vapoursynth and Hybrid-vaporsynth installs.
Ah, okay. Sadly, there is no option to stop Vapourynth autoloading. Sad
(asked for it a few years ago, but the dev didn't think it was necessary)
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#6
Big thanks, Selur! Will try everything tomorrow and post here of course also when successful.
Reply
#7
On another machine it worked without problems.
But I decided to keep using Donald Grafts wonderful DGIndexNV, which gives the best results (to me), when you tweak the parameters right.
So all for nothing. Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)