I need a humble help in making the ffmpeg image work

root@DESKTOP-NDGNCJ5:/mnt/c/Users/Public/WORK# docker run --rm -it --device=/dev/dri:/dev/dri -v /mnt/c/Users/Public/WORK linuxserver/ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i -c:v h264_vaapi -b:v 3M -vf ‘format=nv12|vaapi,hwupload,scale_vaapi=w=360:h=240’ -c:a copy output.mkv
**** adding /dev/dri/renderD128 to video group video with id 44 ****
**** permissions for /dev/dri/card0 are good ****
ffmpeg version 7.0.1 Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 13 (Ubuntu 13.2.0-23ubuntu4)
configuration: --disable-debug --disable-doc --disable-ffplay --enable-alsa --enable-cuvid --enable-ffprobe --enable-gpl --enable-libaom --enable-libass --enable-libdav1d --enable-libfdk_aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-libkvazaar --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libplacebo --enable-librav1e --enable-libshaderc --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nonfree --enable-nvdec --enable-nvenc --enable-cuda-llvm --enable-opencl --enable-openssl --enable-stripping --enable-vaapi --enable-vdpau --enable-version3 --enable-vulkan
libavutil 59. 8.100 / 59. 8.100
libavcodec 61. 3.100 / 61. 3.100
libavformat 61. 1.100 / 61. 1.100
libavdevice 61. 1.100 / 61. 1.100
libavfilter 10. 1.100 / 10. 1.100
libswscale 8. 1.100 / 8. 1.100
libswresample 5. 1.100 / 5. 1.100
libpostproc 58. 1.100 / 58. 1.100
[AVHWDeviceContext @ 0x55ca6d404d80] Failed to initialise VAAPI connection: -1 (unknown libva error).
Device creation failed: -5.
Failed to set value ‘/dev/dri/renderD128’ for option ‘vaapi_device’: Input/output error
Error parsing global options: Input/output error

I would think this error is complaining about hardware access. What kind of video card are you working with? See this page: Specialized Configurations with Docker — NVIDIA Container Toolkit 1.16.0 documentation