Yep, using
ffmpeg -init_hw_device vaapi=foo:/dev/dri/renderD128 -hwaccel vaapi -hwaccel_device foo -i - -f mpegts -c:a copy -c:v libx264 -b:v 368k pipe:1
gives me this error, probably because the user running tvheadend does not have access to the renderD128 device..
2021-09-12 10:59:18.811 [ INFO]:subscription: 042B: "HTTP" subscribing on channel "NPO 3 HD", weight: 100, adapter: "Philips TDA10023 DVB-C #2 : DVB-C #0", network: "Caiway DVB-C", mux: "354MHz", provider: "CAIW Media", service: "NPO 3 HD", profile="mp4-h264-aac-spawn", hostname="10.0.0.138", username="camper", client="BSPlayer 3.0/10394"
2021-09-12 10:59:18.814 [ INFO]:spawn: Executing "/usr/local/tvheadend-testing/bin/ffmpeg"
2021-09-12 10:59:18.841 [ ERROR]:spawn: ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
2021-09-12 10:59:18.841 [ ERROR]:spawn: built with gcc 4.9.3 (crosstool-NG 1.20.0) 20150311 (prerelease)
2021-09-12 10:59:18.841 [ ERROR]:spawn: configuration: --target-os=linux --cross-prefix=/root/spksrc/toolchains/syno-apollolake-6.1/work/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --prefix=/usr/local/tvheadend-testing --extra-cflags=-I/root/spksrc/spk/tvheadend-testing/work-apollolake-6.1/install/usr/local/tvheadend-testing/include --extra-ldflags=-L/root/spksrc/spk/tvheadend-testing/work-apollolake-6.1/install/usr/local/tvheadend-testing/lib --extra-libs='-lxml2 -ldl' --pkg-config=/usr/bin/pkg-config --ranlib=/root/spksrc/toolchains/syno-apollolake-6.1/work/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ranlib --enable-cross-compile --enable-rpath --enable-pic --enable-shared --enable-optimizations --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-fontconfig --enable-libass --enable-libbluray --enable-avresample --enable-libfdk-aac --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsox
2021-09-12 10:59:18.841 [ ERROR]:spawn: libavutil 55. 78.100 / 55. 78.100
2021-09-12 10:59:18.841 [ ERROR]:spawn: libavcodec 57.107.100 / 57.107.100
2021-09-12 10:59:18.841 [ ERROR]:spawn: libavformat 57. 83.100 / 57. 83.100
2021-09-12 10:59:18.841 [ ERROR]:spawn: libavdevice 57. 10.100 / 57. 10.100
2021-09-12 10:59:18.841 [ ERROR]:spawn: libavfilter 6.107.100 / 6.107.100
2021-09-12 10:59:18.841 [ ERROR]:spawn: libavresample 3. 7. 0 / 3. 7. 0
2021-09-12 10:59:18.841 [ ERROR]:spawn: libswscale 4. 8.100 / 4. 8.100
2021-09-12 10:59:18.841 [ ERROR]:spawn: libswresample 2. 9.100 / 2. 9.100
2021-09-12 10:59:18.841 [ ERROR]:spawn: libpostproc 54. 7.100 / 54. 7.100
2021-09-12 10:59:18.841 [ ERROR]:spawn: Device creation failed: -12.
2021-09-12 10:59:18.841 [ ERROR]:spawn: Failed to set value 'vaapi=foo:/dev/dri/renderD128' for option 'init_hw_device': Cannot allocate memory
2021-09-12 10:59:18.841 [ ERROR]:spawn: Error parsing global options: Cannot allocate memory