![FFmpeg:嘗試使用硬體scale_npp過濾器時出現格式錯誤](https://rvso.com/image/1703349/FFmpeg%EF%BC%9A%E5%98%97%E8%A9%A6%E4%BD%BF%E7%94%A8%E7%A1%AC%E9%AB%94scale_npp%E9%81%8E%E6%BF%BE%E5%99%A8%E6%99%82%E5%87%BA%E7%8F%BE%E6%A0%BC%E5%BC%8F%E9%8C%AF%E8%AA%A4.png)
我在帶有 NVidia Geforce 顯示卡的 Ubuntu 22.04LTS 上安裝了 CUDA。我目前正在嘗試通過運行此命令來捕獲完整桌面
ffmpeg -y -hide_banner \
-hwaccel cuda \
-f x11grab \
-framerate 25 \
-video_size 3840x2160 \
-i :1.0+0,0 \
-vf "scale_npp=1920:-1" \
-c:v hevc_nvenc -cq:v 21 -preset slow \
output.mp4
過濾scale_npp
器導致以下錯誤:
Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0:0' and the filter 'auto_scale_0'
[vf#0:0 @ 0x561418cffe00] Error reinitializing filters!
[vf#0:0 @ 0x561418cffe00] Task finished with error code: -38 (Function not implemented)
[vf#0:0 @ 0x561418cffe00] Terminating thread with return code -38 (Function not implemented)
[vost#0:0/hevc_nvenc @ 0x561418ce2840] Could not open encoder before EOF
[vost#0:0/hevc_nvenc @ 0x561418ce2840] Task finished with error code: -22 (Invalid argument)
[vost#0:0/hevc_nvenc @ 0x561418ce2840] Terminating thread with return code -22 (Invalid argument)
[out#0/mp4 @ 0x561418ce0c00] Nothing was written into output file, because at least one of its streams received no packets.
由於錯誤,我不知道是否一切正常Function not implemented
。
一般來說,我想確保一切都在我的 GPU 上完成,然後將最終結果傳送到輸出檔案。
以下是系統的一些輸出:
ffmpeg -hide_banner -h encoder=hevc_nvenc
Encoder hevc_nvenc [NVIDIA NVENC hevc encoder]:
General capabilities: dr1 delay hardware
Threading capabilities: none
Supported hardware devices: cuda cuda
Supported pixel formats: yuv420p nv12 p010le yuv444p p016le yuv444p16le bgr0 bgra rgb0 rgba x2rgb10le x2bgr10le gbrp gbrp16le cuda
ffmpeg -hide_banner -h filter=scale_npp
Filter scale_npp
NVIDIA Performance Primitives video scaling and format conversion
Inputs:
#0: default (video)
Outputs:
#0: default (video)