Log in

View Full Version : libplacebo Tonemap not working


GeoffreyA
9th August 2025, 12:53
When I try to use libplacebo in VapourSynth, I get the following error repeated for each frame:

Validation failed: !params->renderable || fmt_caps & PL_FMT_CAP_RENDERABLE (../subprojects/libplacebo/src/gpu.c:250)
 Backtrace:
 #0 0x7ff80b7d19cd in pl_tex_create+0x33d (D:\Stuff\Movie Tools\Conversion\VapourSynth\vs-plugins\libvs_placebo.dll+0x619cd) (0x240aa19cd)
 #1 0x7ff80b7d2077 in pl_tex_recreate+0xa7 (D:\Stuff\Movie Tools\Conversion\VapourSynth\vs-plugins\libvs_placebo.dll+0x62077) (0x240aa2077)
ols\Conversion\VapourSynth\vs-plugins\libvs_placebo.dll+0x2b00) (0x240a42b00)ame= 0 fps=0.0 q=0.0 size= 0KiB time=N/A bitrate=N/A speed=N/A elapsed=0:00:00.52
 #3 0x7ff80b77371f in VapourSynthPluginInit2+0x208f (D:\Stuff\Movie Tools\Conversion\VapourSynth\vs-plugins\libvs_placebo.dll+0x371f) (0x240a4371f)
 #4 0x7ff83731959c in getVapourSynthAPI+0xde3c (D:\Stuff\Movie Tools\Conversion\VapourSynth\Lib\site-packages\VapourSynth.dll+0x10959c) (0x18010959c)
 #5 0x7ff83732c652 in getVapourSynthAPI+0x20ef2 (D:\Stuff\Movie Tools\Conversion\VapourSynth\Lib\site-packages\VapourSynth.dll+0x11c652) (0x18011c652)
 #6 0x7ff83732df05 in getVapourSynthAPI+0x227a5 (D:\Stuff\Movie Tools\Conversion\VapourSynth\Lib\site-packages\VapourSynth.dll+0x11df05) (0x18011df05)
 #7 0x7ff878741bb1 in configthreadlocale+0x91 (C:\Windows\System32\ucrtbase.dll+0x21bb1) (0x180021bb1)
 #8 0x7ff8790c7373 in BaseThreadInitThunk+0x13 (C:\Windows\System32\KERNEL32.DLL+0x17373) (0x180017373)
 #9 0x7ff87b0dcc90 in RtlUserThreadStart+0x20 (C:\Windows\SYSTEM32\ntdll.dll+0x4cc90) (0x18004cc90)
 for texture: ../src/tonemap.c:115
Critical: Failed creating GPU textures!


from vapoursynth import core

clip = core.lsmas.LWLibavSource(r"4k.mkv")

clip = clip.fmtc.bitdepth(bits=16)

clip = clip.placebo.Tonemap(src_csp=1, dst_csp=0)

clip = clip.fmtc.bitdepth(bits=8)

clip.set_output()


libplacebo works in FFmpeg. The GPU is an Arc B580, but I used to get similar errors with the Radeon iGPU. Resample() works. Am I using Tonemap() correctly, or could this be a driver problem?

Selur
9th August 2025, 14:07
Which libplacebo do you use? (from: https://github.com/Lypheo/vs-placebo ? https://github.com/sgt0/vs-placebo ? https://github.com/Mikewando/vs-placebo ? Which version?)
Using https://github.com/sgt0/vs-placebo with:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
import sys
import os
core = vs.core
# Limit frame cache to 48473MB
core.max_cache_size = 48473
# 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_AVX2.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, smoothing_period=100.00, gamut_mapping=0, tone_mapping_function=0, 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. (using my NVIDIA GPU)

I guess that "Failed creating GPU textures" is a driver problem or incompatibility.
Maybe increasing the log_level gives further details.
You could also try the other repositories I linked to.

Cu Selur

GeoffreyA
9th August 2025, 16:44
Thank you, Selur.

I was using https://github.com/sgt0/vs-placebo, the latest version.

Trying the other repositories, it fails with different errors. Trying your script, with some lines commented out and changing the source plug-in, same. So, I reckon the problem is in the driver.