デコーダにはQSVとNVDECにハードウェア支援を受けたDXVA2、D3D11。フィルタにはQSV、OpenCL、NPP、Vulkan。エンコーダにはQSVとソフトウェアエンコーダのlibx264のコマンド例のまとめ。コマンド例はぞれぞれ上にQSV、下にlibx264を併記し、filter はソフトウェアフィルタ(いわゆる通常のフィルタ)を示す。他にも処理の速いコマンド例があるかもしれない。入力ファイルはH.264/AACを想定している。エラーが出るときはフィルタの最後を format=nv12 から format=yuv420p に変更するとエラーがなくなるかもしれない。

-hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 1-hwaccel_device で利用するデバイスを番号を指定できる。デバイスはintel-CPU、NVIDIA-GeForce、AMD-Radeonどちらでも使える。OpenCL、Vulkanフィルタも同様にintel-CPU、NVIDIA-Geforce、AMD-Radeonで使える。使えるハードウェアはGPU-Zで調べられる。

HWAccelIntro – FFmpeg

オプション

  • -hwaccel name
    ハードウェアデコードに使う名前の指定。none、auto、vdpau、dxva2、vaapi、qsv が指定できる
  • -hwaccel_device name
    ハードウェア支援に使うデバイスの指定
  • -hwaccel_output_format
    ハードウェア支援を受けたデコードの出力フォーマットの指定
  • -init_hw_device type[=name][:device[,key=value…]]
    初期化するハードウェアデバイスの指定
  • -filter_hw_device name
    フィルタで使うハードウェアデバイスの指定

ffmpeg Documentation : Advanced Video options

フィルタ

  • hwdownload
    ハードウェアフレームをシステムメモリへダウンロードする
  • hwupload
    システムメモリフレームをハードウェアサーフェスにアップロードする。フィルタを初期化するときに、アップロード先のデバイスを指定する必要がある。ffmpegを使う場合は、-filter_hw_device を指定して適切なデバイスを指定する

QSV

QSV 対応の ffmpeg をつくる
QSV フィルタの詰め合わせ vpp_qsv

デコード

ffmpeg -hwaccel qsv -c:v h264_qsv -i input -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel qsv -c:v h264_qsv -i input -vf hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

CPUフィルタ

ffmpeg -hwaccel qsv -c:v h264_qsv -i input -vf hwdownload,format=nv12,filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel qsv -c:v h264_qsv -i input -vf hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

QSVフィルタ

ffmpeg -hwaccel qsv -c:v h264_qsv -i input -vf scale_qsv=1280:720 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel qsv -c:v h264_qsv -i input -vf scale_qsv=1280:720,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

QSVフィルタからCPUフィルタ

ffmpeg -hwaccel qsv -c:v h264_qsv -i input -vf scale_qsv=1280:720,hwdownload,format=nv12,filter,hwupload=extra_hw_frames=64 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel qsv -c:v h264_qsv -i input -vf scale_qsv=1280:720,hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

CPUフィルタからQSVフィルタ

ffmpeg -hwaccel qsv -c:v h264_qsv -i input -vf hwdownload,format=nv12,filter,hwupload=extra_hw_frames=64,scale_qsv=1280:720 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel qsv -c:v h264_qsv -i input -vf hwdownload,format=nv12,filter,hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

NPPフィルタ
ffmpeg に nvenc(cuda)をインストールする
CUDA を使ったハードウェアアクセレーションフィルタのまとめ

ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda -hwaccel qsv -c:v h264_qsv -i input -vf hwdownload,format=nv12,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda -hwaccel qsv -c:v h264_qsv -i input -vf hwdownload,format=nv12,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

NPPフィルタからCPUフィルタ

ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda -hwaccel qsv -c:v h264_qsv -i input -vf hwdownload,format=nv12,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12,filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda -hwaccel qsv -c:v h264_qsv -i input -vf hwdownload,format=nv12,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

CPUフィルタからNPPフィルタ

ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda -hwaccel qsv -c:v h264_qsv -i input -vf hwdownload,format=nv12,filter,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda -hwaccel qsv -c:v h264_qsv -i input -vf hwdownload,format=nv12,filter,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

OpenCLフィルタ
openclで検索 | ニコラボ
FFmpeg Filters Documentation : OpenCL Video Filters

ffmpeg -hwaccel qsv -c:v h264_qsv -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,hwupload,roberts_opencl,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel qsv -c:v h264_qsv -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,hwupload,roberts_opencl,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

OpenCLフィルタからCPUフィルタ

ffmpeg -hwaccel qsv -c:v h264_qsv -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,hwupload,roberts_opencl,hwdownload,format=nv12,filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel qsv -c:v h264_qsv -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,hwupload,roberts_opencl,hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

CPUフィルタからOpenCLフィルタ

ffmpeg -hwaccel qsv -c:v h264_qsv -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,filter,hwupload,roberts_opencl,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel qsv -c:v h264_qsv -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,filter,hwupload,roberts_opencl,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

Vulkanフィルタ

ffmpeg -hwaccel qsv -c:v h264_qsv -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,hwupload,avgblur_vulkan,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel qsv -c:v h264_qsv -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,hwupload,avgblur_vulkan,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

VulkanフィルタからCPUフィルタ

ffmpeg -hwaccel qsv -c:v h264_qsv -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,hwupload,avgblur_vulkan,hwdownload,format=nv12,avgblur -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel qsv -c:v h264_qsv -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,hwupload,avgblur_vulkan,hwdownload,format=nv12,avgblur -c:v libx264 -c:a copy output.mp4

CPUフィルタからVulkanフィルタ

ffmpeg -hwaccel qsv -c:v h264_qsv -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf "hwdownload,format=nv12,filter,hwupload,avgblur_vulkan,hwdownload,format=yuv420p" -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel qsv -c:v h264_qsv -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf "hwdownload,format=nv12,filter,hwupload,avgblur_vulkan,hwdownload,format=yuv420p" -c:v libx264 -c:a copy output.mp4

NVDEC(cuvid)

ffmpeg に nvenc(cuda)をインストールする

デコード

ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input -vf hwdownload -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input -vf hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

CPUフィルタ

ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input -vf hwdownload,format=nv12,filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input -vf hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

QSVフィルタ

ffmpeg -hwaccel cuvid -c:v h264_cuvid -init_hw_device qsv=qsv:hw -hwaccel qsv -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel cuvid -c:v h264_cuvid -init_hw_device qsv=qsv:hw -hwaccel qsv -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

QSVフィルタからCPUフィルタ

ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 0 -init_hw_device qsv=qsv:hw -hwaccel qsv -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12,filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 0 -init_hw_device qsv=qsv:hw -hwaccel qsv -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

CPUフィルタからQSVフィルタ

ffmpeg -hwaccel cuvid -c:v h264_cuvid -init_hw_device qsv=qsv:hw -filter_hw_device qsv -i input -vf hwdownload,format=nv12,scale=320:240,hwupload=extra_hw_frames=64,scale_qsv=1280:720 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel cuvid -c:v h264_cuvid -init_hw_device qsv=qsv:hw -filter_hw_device qsv -i input -vf hwdownload,format=nv12,scale=320:240,hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

NPPフィルタ

ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input -vf scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input -vf scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

NPPフィルタからCPUフィルタ

ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input -vf scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12,filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input -vf scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

CPUフィルタからNPPフィルタ

ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input -vf hwdownload,format=nv12,filter,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input -vf hwdownload,format=nv12,filter,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

OpenCLフィルタ

ffmpeg -hwaccel cuvid -c:v h264_cuvid -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,hwupload,roberts_opencl,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel cuvid -c:v h264_cuvid -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,hwupload,roberts_opencl,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

OpenCLフィルタからCPUフィルタ

ffmpeg -hwaccel cuvid -c:v h264_cuvid -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,hwupload,roberts_opencl,hwdownload,format=nv12,filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel cuvid -c:v h264_cuvid -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,hwupload,roberts_opencl,hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

CPUフィルタからOpenCLフィルタ

ffmpeg -hwaccel cuvid -c:v h264_cuvid -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,filter,hwupload,roberts_opencl,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel cuvid -c:v h264_cuvid -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,filter,hwupload,roberts_opencl,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

Vulkanフィルタ

ffmpeg -hwaccel cuvid -c:v h264_cuvid -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,hwupload,avgblur_vulkan,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel cuvid -c:v h264_cuvid -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,hwupload,avgblur_vulkan,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

VulkanフィルタからCPUフィルタ

ffmpeg -hwaccel cuvid -c:v h264_cuvid -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,hwupload,avgblur_vulkan,hwdownload,format=nv12,avgblur -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel cuvid -c:v h264_cuvid -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,hwupload,avgblur_vulkan,hwdownload,format=nv12,avgblur -c:v libx264 -c:a copy output.mp4

CPUフィルタからVulkanフィルタ

ffmpeg -hwaccel cuvid -c:v h264_cuvid -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,filter,hwupload,avgblur_vulkan,hwdownload,format=yuv420p -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel cuvid -c:v h264_cuvid -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,filter,hwupload,avgblur_vulkan,hwdownload,format=yuv420p -c:v libx264 -c:a copy output.mp4

NVDEC

デコーダ名の指定が不要。一部フィルタの併用方法が不明。

デコード

ffmpeg -hwaccel nvdec -i input -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel nvdec -i input -c:v libx264 -c:a copy output.mp4

CPUフィルタ

ffmpeg -hwaccel nvdec -i input -vf filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel nvdec -i input -vf filter -c:v libx264 -c:a copy output.mp4

QSVフィルタ

ffmpeg -hwaccel nvdec -init_hw_device qsv=qsv:hw -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel nvdec -init_hw_device qsv=qsv:hw -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

QSVフィルタからCPUフィルタ

ffmpeg -hwaccel nvdec -init_hw_device qsv=qsv:hw -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12,filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel nvdec -init_hw_device qsv=qsv:hw -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

CPUフィルタからQSVフィルタ

ffmpeg -hwaccel nvdec -init_hw_device qsv=qsv:hw -filter_hw_device qsv -i input -vf filter,hwupload=extra_hw_frames=64,scale_qsv=1280:720 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel nvdec -init_hw_device qsv=qsv:hw -filter_hw_device qsv -i input -vf filter,hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

Vulkanフィルタ

ffmpeg -hwaccel nvdec -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwupload,avgblur_vulkan,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel nvdec -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwupload,avgblur_vulkan,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

VulkanフィルタからCPUフィルタ

ffmpeg -hwaccel nvdec -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwupload,avgblur_vulkan,hwdownload,format=nv12,avgblur -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel nvdec -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwupload,avgblur_vulkan,hwdownload,format=nv12,avgblur -c:v libx264 -c:a copy output.mp4

CPUフィルタからVulkanフィルタ

ffmpeg -hwaccel nvdec -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf filter,hwupload,avgblur_vulkan,hwdownload,format=yuv420p -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel nvdec -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf filter,hwupload,avgblur_vulkan,hwdownload,format=yuv420p -c:v libx264 -c:a copy output.mp4

DXVA2

デコード

ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -i input -vf hwdownload -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -i input -vf hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

CPUフィルタ

ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -i input -vf hwdownload,format=nv12,filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -i input -vf hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

QSVフィルタ(低速)

ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device qsv=qsv:hw -hwaccel qsv -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device qsv=qsv:hw -hwaccel qsv -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

QSVフィルタ(高速)

ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -i input -vf hwmap=derive_device=qsv,scale_qsv=w=1280:h=720 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device qsv=qsv:hw -hwaccel qsv -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

QSVフィルタからCPUフィルタ

ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device qsv=qsv:hw -hwaccel qsv -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12,filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device qsv=qsv:hw -hwaccel qsv -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

CPUフィルタからQSVフィルタ

ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device qsv=qsv:hw -filter_hw_device qsv -i input -vf hwdownload,format=nv12,scale=320:240,hwupload=extra_hw_frames=64,scale_qsv=1280:720 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device qsv=qsv:hw -filter_hw_device qsv -i input -vf hwdownload,format=nv12,scale=320:240,hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

NPPフィルタ

ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device cuda=cuda -filter_hw_device cuda -i input -vf hwdownload,format=nv12,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device cuda=cuda -filter_hw_device cuda -i input -vf hwdownload,format=nv12,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

NPPフィルタからCPUフィルタ

ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device cuda=cuda -filter_hw_device cuda -i input -vf hwdownload,format=nv12,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12,filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device cuda=cuda -filter_hw_device cuda -i input -vf hwdownload,format=nv12,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

CPUフィルタからNPPフィルタ

ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device cuda=cuda -filter_hw_device cuda -i input -vf hwdownload,format=nv12,scale=320:180,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device cuda=cuda -filter_hw_device cuda -i input -vf hwdownload,format=nv12,scale=320:180,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

OpenCLフィルタ(デバイス指定が可能)

ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,hwupload,roberts_opencl,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,hwupload,roberts_opencl,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

OpenCLフィルタ(CPU)

ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -i input -vf hwmap=derive_device=opencl,roberts_opencl,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -i input -vf hwmap=derive_device=opencl,roberts_opencl,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

OpenCLフィルタからCPUフィルタ

ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,hwupload,roberts_opencl,hwdownload,format=nv12,filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,hwupload,roberts_opencl,hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

CPUフィルタからOpenCLフィルタ

ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,filter,hwupload,roberts_opencl,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,filter,hwupload,roberts_opencl,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

Vulkanフィルタ

ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,hwupload,avgblur_vulkan,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,hwupload,avgblur_vulkan,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

VulkanフィルタからCPUフィルタ

ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,hwupload,avgblur_vulkan,hwdownload,format=nv12,avgblur -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,hwupload,avgblur_vulkan,hwdownload,format=nv12,avgblur -c:v libx264 -c:a copy output.mp4

CPUフィルタからVulkanフィルタ

ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,filter,hwupload,avgblur_vulkan,hwdownload,format=yuv420p -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel dxva2 -hwaccel_output_format dxva2_vld -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,filter,hwupload,avgblur_vulkan,hwdownload,format=yuv420p -c:v libx264 -c:a copy output.mp4

D3D11

デコード
-hwaccel_device で何番目のGPUを使うか指定している。

ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 0 -i input -vf hwdownload -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 0 -i input -vf hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

CPUフィルタ

ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 0 -i input -vf hwdownload,format=nv12,filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 0 -i input -vf hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

QSVフィルタ

ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 0 -init_hw_device qsv=qsv:hw -hwaccel qsv -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 0 -init_hw_device qsv=qsv:hw -hwaccel qsv -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

QSVフィルタからCPUフィルタ

ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 0 -init_hw_device qsv=qsv:hw -hwaccel qsv -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12,filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 0 -init_hw_device qsv=qsv:hw -hwaccel qsv -filter_hw_device qsv -i input -vf hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

CPUフィルタからQSVフィルタ

ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -init_hw_device qsv=qsv:hw -filter_hw_device qsv -i input -vf hwdownload,format=nv12,scale=320:240,hwupload=extra_hw_frames=64,scale_qsv=1280:720 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -init_hw_device qsv=qsv:hw -filter_hw_device qsv -i input -vf hwdownload,format=nv12,scale=320:240,hwupload=extra_hw_frames=64,scale_qsv=1280:720,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

NPPフィルタ

ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 1 -init_hw_device cuda=cuda -filter_hw_device cuda -i input -vf hwdownload,format=nv12,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 1 -init_hw_device cuda=cuda -filter_hw_device cuda -i input -vf hwdownload,format=nv12,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

NPPフィルタからCPUフィルタ

ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 1 -init_hw_device cuda=cuda -filter_hw_device cuda -i input -vf hwdownload,format=nv12,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12,filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 1 -init_hw_device cuda=cuda -filter_hw_device cuda -i input -vf hwdownload,format=nv12,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

CPUフィルタからNPPフィルタ

ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 1 -init_hw_device cuda=cuda -filter_hw_device cuda -i input -vf hwdownload,format=nv12,filter,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 1 -init_hw_device cuda=cuda -filter_hw_device cuda -i input -vf hwdownload,format=nv12,filter,hwupload_cuda,scale_npp=-2:720:interp_algo=lanczos,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

OpenCLフィルタ

ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 1 -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,hwupload,roberts_opencl,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 1 -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,hwupload,roberts_opencl,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

OpenCLフィルタからCPUフィルタ

ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 1 -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,hwupload,roberts_opencl,hwdownload,format=nv12,filter -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 1 -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,hwupload,roberts_opencl,hwdownload,format=nv12,filter -c:v libx264 -c:a copy output.mp4

CPUフィルタからOpenCLフィルタ

ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 1 -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,filter,hwupload,roberts_opencl,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -hwaccel_device 1 -init_hw_device opencl=ocl:1.0 -filter_hw_device ocl -i input -vf hwdownload,format=nv12,filter,hwupload,roberts_opencl,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

Vulkanフィルタ

ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,hwupload,avgblur_vulkan,hwdownload,format=nv12 -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,hwupload,avgblur_vulkan,hwdownload,format=nv12 -c:v libx264 -c:a copy output.mp4

VulkanフィルタからCPUフィルタ

ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,hwupload,avgblur_vulkan,hwdownload,format=nv12,avgblur -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,hwupload,avgblur_vulkan,hwdownload,format=nv12,avgblur -c:v libx264 -c:a copy output.mp4

CPUフィルタからVulkanフィルタ

ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,filter,hwupload,avgblur_vulkan,hwdownload,format=yuv420p -c:v h264_qsv -c:a copy output.mp4
ffmpeg -hwaccel d3d11va -hwaccel_output_format d3d11 -init_hw_device vulkan=vk:0 -filter_hw_device vk -i input -vf hwdownload,format=nv12,filter,hwupload,avgblur_vulkan,hwdownload,format=yuv420p -c:v libx264 -c:a copy output.mp4

コメントを残す

メールアドレスが公開されることはありません。

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)