#10875: scale_vulkan filter produces wrong colors
----------------------------------+--------------------------------------
Reporter: bermond | Type: defect
Status: new | Priority: normal
Component: avfilter | Version: git-master
Keywords: vulkan | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
----------------------------------+--------------------------------------
Applying the `scale_vulkan` filter produces an output with
blueish/greenish color tint.
How to reproduce:
{{{
$ ffmpeg \
-init_hw_device vulkan=hw:0 -filter_hw_device hw \
-f lavfi -i 'color=color=White:size=1280x720' \
-vf 'hwupload,scale_vulkan=w=640:h=480,hwdownload,format=yuv420p' \
-c:v libx264 -preset:v ultrafast -movflags '+faststart' -t 40 -y test-
out.mp4
ffmpeg version N-113734-gcffadfe99a Copyright (c) 2000-2024 the FFmpeg
developers
built with gcc 13.2.1 (GCC) 20230801
configuration: --prefix=/usr --extra-cflags=-I/opt/cuda/include --extra-
ldflags=-L/opt/cuda/lib64 --enable-lto --disable-rpath --enable-gpl
--enable-version3 --enable-nonfree --enable-shared --disable-static
--disable-stripping --disable-htmlpages --enable-gray --enable-alsa
--enable-avisynth --enable-bzlib --enable-chromaprint --enable-frei0r
--enable-gcrypt --enable-gmp --enable-gnutls --enable-iconv --enable-
ladspa --enable-lcms2 --enable-libaom --enable-libaribb24 --enable-
libaribcaption --enable-libass --enable-libbluray --enable-libbs2b
--enable-libcaca --enable-libcelt --enable-libcdio --enable-libcodec2
--enable-libdav1d --enable-libdavs2 --enable-libdc1394 --enable-libfdk-aac
--enable-libflite --enable-libfontconfig --enable-libfreetype --enable-
libfribidi --enable-libharfbuzz --enable-libglslang --enable-libgme
--enable-libgsm --enable-libiec61883 --enable-libilbc --enable-libjack
--enable-libjxl --enable-libklvanc --enable-libkvazaar --enable-liblensfun
--enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopencv --enable-libopenh264
--enable-libopenjpeg --enable-libopenmpt --enable-libopenvino --enable-
libopus --enable-libplacebo --enable-libpulse --enable-libqrencode
--enable-librabbitmq --enable-librav1e --enable-librist --enable-librsvg
--enable-librubberband --enable-librtmp --disable-libshaderc --enable-
libshine --enable-libsmbclient --enable-libsnappy --enable-libsoxr
--enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1
--enable-libsvthevc --enable-libsvtvp9 --disable-libtensorflow --enable-
libtesseract --enable-libtheora --disable-libtls --enable-libtwolame
--enable-libuavs3d --enable-libv4l2 --enable-libvidstab --enable-libvmaf
--enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-
libwebp --enable-libx264 --enable-libx265 --enable-libxevd --enable-
libxeve --enable-libxavs --enable-libxavs2 --enable-libxcb --enable-
libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape --enable-libxvid
--enable-libxml2 --enable-libzimg --enable-libzmq --enable-libzvbi
--enable-lv2 --enable-lzma --enable-decklink --disable-mbedtls --enable-
libmysofa --enable-openal --enable-opencl --enable-opengl --disable-
openssl --disable-pocketsphinx --enable-sndio --enable-sdl2 --enable-
vapoursynth --enable-vulkan --enable-xlib --enable-zlib --enable-amf
--enable-cuda-nvcc --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec
--enable-libdrm --enable-libvpl --enable-libnpp --enable-nvdec --enable-
nvenc --enable-omx --enable-rkmpp --enable-v4l2-m2m --enable-vaapi
--enable-vdpau
libavutil 58. 39.100 / 58. 39.100
libavcodec 60. 39.101 / 60. 39.101
libavformat 60. 21.101 / 60. 21.101
libavdevice 60. 4.100 / 60. 4.100
libavfilter 9. 17.100 / 9. 17.100
libswscale 7. 6.100 / 7. 6.100
libswresample 4. 13.100 / 4. 13.100
libpostproc 57. 4.100 / 57. 4.100
Input #0, lavfi, from 'color=color=White:size=1280x720':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: wrapped_avframe, yuv420p, 1280x720 [SAR 1:1 DAR
16:9], 25 fps, 25 tbr, 25 tbn
Stream mapping:
Stream #0:0 -> #0:0 (wrapped_avframe (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x58048fbc3b80] using SAR=1/1
[libx264 @ 0x58048fbc3b80] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x58048fbc3b80] profile Constrained Baseline, level 3.0, 4:2:0,
8-bit
[libx264 @ 0x58048fbc3b80] 264 - core 164 r3108 31e19f9 - H.264/MPEG-4 AVC
codec - Copyleft 2003-2023 - http://www.videolan.org/x264.html - options:
cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1
psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=15
lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250
keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, mp4, to 'test-out.mp4':
Metadata:
encoder : Lavf60.21.101
Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(progressive),
640x480 [SAR 1:1 DAR 4:3], q=2-31, 25 fps, 12800 tbn
Metadata:
encoder : Lavc60.39.101 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
[mp4 @ 0x58048f89cac0] Starting second pass: moving the moov atom to the
beginning of the file
[out#0/mp4 @ 0x58048f9a9f80] video:15KiB audio:0KiB subtitle:0KiB other
streams:0KiB global headers:0KiB muxing overhead: 31.864029%
frame= 1000 fps=0.0 q=-1.0 Lsize= 20KiB time=00:00:40.00 bitrate=
4.0kbits/s speed=57.8x
[libx264 @ 0x58048fbc3b80] frame I:4 Avg QP:11.75 size: 928
[libx264 @ 0x58048fbc3b80] frame P:996 Avg QP:12.01 size: 11
[libx264 @ 0x58048fbc3b80] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 @ 0x58048fbc3b80] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 0.0%
0.0% 0.0% 0.0% 0.0% skip:100.0%
[libx264 @ 0x58048fbc3b80] coded y,uvDC,uvAC intra: 0.0% 0.1% 0.0% inter:
0.0% 0.0% 0.0%
[libx264 @ 0x58048fbc3b80] i16 v,h,dc,p: 97% 0% 3% 0%
[libx264 @ 0x58048fbc3b80] i8c dc,h,v,p: 100% 0% 0% 0%
[libx264 @ 0x58048fbc3b80] kb/s:2.93
}}}
Instead of having a solid white output in the example above, the color is
wrong.
All other hardware accelerated scale filters (`scale_cuda`, `scale_npp`,
`scale_qsv` and `scale_vaapi`) does **not** produce this behavior.
System Information:
- OS: Arch Linux
- Vulkan device: NVIDIA RTX 3060
- GPU driver: NVIDIA proprietary driver version 545.29.06
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10875>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
_______________________________________________
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac
To unsubscribe, visit link above, or email
ffmpeg-trac-requ...@ffmpeg.org with subject "unsubscribe".