![FFmpeg: ハードウェア scale_npp フィルターを使用しようとするとフォーマット エラーが発生する](https://rvso.com/image/1703349/FFmpeg%3A%20%E3%83%8F%E3%83%BC%E3%83%89%E3%82%A6%E3%82%A7%E3%82%A2%20scale_npp%20%E3%83%95%E3%82%A3%E3%83%AB%E3%82%BF%E3%83%BC%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%82%88%E3%81%86%E3%81%A8%E3%81%99%E3%82%8B%E3%81%A8%E3%83%95%E3%82%A9%E3%83%BC%E3%83%9E%E3%83%83%E3%83%88%20%E3%82%A8%E3%83%A9%E3%83%BC%E3%81%8C%E7%99%BA%E7%94%9F%E3%81%99%E3%82%8B.png)
私はUbuntu 22.04LTSにNVidia Geforceグラフィックカードをインストールしています。現在、このコマンドを実行してデスクトップ全体をキャプチャしようとしています。
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)