最終更新:2020-05-15 (金) 07:50:25 (1442d)  

FFmpeg/CUDA
Top / FFmpeg / CUDA

https://developer.nvidia.com/ffmpeg

メモ

有効化

  • 必要なライブラリを指定してコンパイル
  • configure
    ./configure --enable-cuda-sdk --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
  • ビルド
    make -j 10
  • 実行
    ffmpeg -y -hwaccel cuvid -c:v h264_cuvid -vsync 0 -i <input.mp4> -vf scale_npp=1920:1072 -vcodec h264_nvenc <output0.264> -vf scale_npp=1280:720 -vcodec h264_nvenc <output1.264>

コマンド

  • ffmpeg -vsync 0 -c:v h264_cuvid -i <input.mp4> -f rawvideo <output.yuv>

高速化

モジュール

CUVID

コマンドメモ

  • ffmpeg -hwaccel? cuda -i input output
  • ffmpeg -c:v h264_cuvid? -i input output
  • ffmpeg -hwaccel? cuda -hwaccel_output_format cuda -i input -c:v h264_nvenc -preset slow output

詳細オプション

  • ffmpeg -h encoder=h264_nvenc?
  • ffmpeg -h encoder=hevc_nvenc?

コーデック

  • h264_nvenc?NVIDIA NVENC H.264 encoder (codec h264)
    nvenc?NVIDIA NVENC H.264 encoder (codec h264)
    nvenc_h264?NVIDIA NVENC H.264 encoder (codec h264)
    nvenc_hevc?NVIDIA NVENC hevc encoder (codec hevc)
    hevc_nvenc?NVIDIA NVENC hevc encoder (codec hevc)

関連

参考