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:
[31mValidation failed: !params->renderable || fmt_caps & PL_FMT_CAP_RENDERABLE (../subprojects/libplacebo/src/gpu.c:250)[0m
[31m Backtrace:[0m
[31m #0 0x7ff80b7d19cd in pl_tex_create+0x33d (D:\Stuff\Movie Tools\Conversion\VapourSynth\vs-plugins\libvs_placebo.dll+0x619cd) (0x240aa19cd)[0m
[31m #1 0x7ff80b7d2077 in pl_tex_recreate+0xa7 (D:\Stuff\Movie Tools\Conversion\VapourSynth\vs-plugins\libvs_placebo.dll+0x62077) (0x240aa2077)[0m
ols\Conversion\VapourSynth\vs-plugins\libvs_placebo.dll+0x2b00) (0x240a42b00)[0mame= 0 fps=0.0 q=0.0 size= 0KiB time=N/A bitrate=N/A speed=N/A elapsed=0:00:00.52
[31m #3 0x7ff80b77371f in VapourSynthPluginInit2+0x208f (D:\Stuff\Movie Tools\Conversion\VapourSynth\vs-plugins\libvs_placebo.dll+0x371f) (0x240a4371f)[0m
[31m #4 0x7ff83731959c in getVapourSynthAPI+0xde3c (D:\Stuff\Movie Tools\Conversion\VapourSynth\Lib\site-packages\VapourSynth.dll+0x10959c) (0x18010959c)[0m
[31m #5 0x7ff83732c652 in getVapourSynthAPI+0x20ef2 (D:\Stuff\Movie Tools\Conversion\VapourSynth\Lib\site-packages\VapourSynth.dll+0x11c652) (0x18011c652)[0m
[31m #6 0x7ff83732df05 in getVapourSynthAPI+0x227a5 (D:\Stuff\Movie Tools\Conversion\VapourSynth\Lib\site-packages\VapourSynth.dll+0x11df05) (0x18011df05)[0m
[31m #7 0x7ff878741bb1 in configthreadlocale+0x91 (C:\Windows\System32\ucrtbase.dll+0x21bb1) (0x180021bb1)[0m
[31m #8 0x7ff8790c7373 in BaseThreadInitThunk+0x13 (C:\Windows\System32\KERNEL32.DLL+0x17373) (0x180017373)[0m
[31m #9 0x7ff87b0dcc90 in RtlUserThreadStart+0x20 (C:\Windows\SYSTEM32\ntdll.dll+0x4cc90) (0x18004cc90)[0m
[31m for texture: ../src/tonemap.c:115[0m
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.
GeoffreyA
31st August 2025, 07:41
Good morning,
If I may ask, could someone possessing an Nvidia GPU please test the following script and batch file: https://workupload.com/file/BNhWcnJmSyw
I've submitted (https://github.com/IGCIT/Intel-GPU-Community-Issue-Tracker-IGCIT/issues/1206) the issue to Intel as not working on Arc, but would like to be sure that it does work on other hardware.
I put together the archive to make it easier for them to reproduce. The batch file, vs.bat, runs the script through VSPipe, sending the output to the FFmpeg executable in the folder. FFmpeg copies the piped frames to the null muxer, not writing any output.
Thanks in advance.
Selur
31st August 2025, 08:22
I get:
C:\Users\Selur\Desktop\VS>vapoursynth-portable\vspipe -c y4m script.vpy - | ffmpeg -i - -c:v copy -f null -
ffmpeg version 2025-08-25-git-1b62f9d3ae-essentials_build-www.gyan.dev Copyright (c) 2000-2025 the FFmpeg developers
built with gcc 15.2.0 (Rev8, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi --enable-openal --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
libavutil 60. 10.100 / 60. 10.100
libavcodec 62. 13.101 / 62. 13.101
libavformat 62. 4.100 / 62. 4.100
libavdevice 62. 2.100 / 62. 2.100
libavfilter 11. 5.100 / 11. 5.100
libswscale 9. 2.100 / 9. 2.100
libswresample 6. 2.100 / 6. 2.100
Creating lwi index file 100%
Input #0, yuv4mpegpipe, from 'fd:':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo (444P / 0x50343434), yuv444p(progressive), 3840x2160, 59.94 fps, 59.94 tbr, 59.94 tbn
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Output #0, null, to 'pipe:':
Metadata:
encoder : Lavf62.4.100
Stream #0:0: Video: rawvideo (444P / 0x50343434), yuv444p(progressive), 3840x2160, q=2-31, 59.94 fps, 59.94 tbr, 59.94 tbn
Output 60 frames in 1.37 seconds (43.91 fps)00:00.63 bitrate=N/A speed=1.25x elapsed=0:00:00.50
[out#0/null @ 000001b0c2d85080] video:1458000KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
frame= 60 fps= 59 q=-1.0 Lsize=N/A time=00:00:01.00 bitrate=N/A speed=0.979x elapsed=0:00:01.02
C:\Users\Selur\Desktop\VS>pause
Cu Selur
GeoffreyA
31st August 2025, 08:32
Appreciate it, Selur! So it works. I get the error for each frame.
Z2697
2nd September 2025, 15:08
Have you tried earlier vs-placebo versions?
GeoffreyA
2nd September 2025, 16:21
Have you tried earlier vs-placebo versions?
Only the previous version or so.
EDIT: Tried all versions of sgt0 with same results.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.