您当前的位置: 首页 > 

柳鲲鹏

暂无认证

  • 0浏览

    0关注

    4642博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

FFMpeg编译支持NVidia CODEC(成功)

柳鲲鹏 发布时间:2020-06-26 13:31:03 ,浏览量:0

  • 安装依赖库
yum install alsa-lib-devel
  • 下载头文件
git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git

cd nv-codec-headers

sudo make
sudo make install
  • 编译SDL2

https://blog.csdn.net/quantum7/article/details/104173159

  • 下载ffmpeg

http://ffmpeg.org/

最新的。

  • 重新编译 

# export is must use
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH}

pkg-config --modversion ffnvcodec

CUDA_PATH=nvcc=/usr/local/cuda-11.0

make clean

export ECFLAG="-fPIC"
./configure \
     --extra-cflags="-I/usr/local/cuda/include -fPIC " \
    --extra-ldflags="-L/usr/local/cuda/lib64   -ldl " \
    --pkg-config-flags=--static \
    --enable-shared \
    --enable-gpl --enable-libx264 \
    --enable-cuvid --enable-nvenc --enable-nonfree \
    --nvcc=${CUDA_PATH}/bin/nvcc

make

sudo make install
  • 更新库连接
echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig
  • 测试h264_nvenc
ffmpeg -h encoder=h264_nvenc
ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-39)
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Encoder h264_nvenc [NVIDIA NVENC H.264 encoder]:
    General capabilities: delay hardware 
    Threading capabilities: none
    Supported pixel formats: yuv420p nv12 p010le yuv444p p016le yuv444p16le bgr0 rgb0 cuda
h264_nvenc AVOptions:
  -preset                    E..V..... Set the encoding preset (from 0 to 11) (default medium)

  • test

    h264_cuvid

    ffmpeg -h decoder=h264_cuvid
    ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
      built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-39)
      libavutil      56. 31.100 / 56. 31.100
      libavcodec     58. 54.100 / 58. 54.100
      libavformat    58. 29.100 / 58. 29.100
      libavdevice    58.  8.100 / 58.  8.100
      libavfilter     7. 57.100 /  7. 57.100
      libswscale      5.  5.100 /  5.  5.100
      libswresample   3.  5.100 /  3.  5.100
      libpostproc    55.  5.100 / 55.  5.100
    Decoder h264_cuvid [Nvidia CUVID H264 decoder]:
        General capabilities: delay avoidprobe hardware 
        Threading capabilities: none
        Supported hardware devices: cuda 
        Supported pixel formats: cuda nv12 p010le p016le
    h264_cuvid AVOptions:
      -deint                     .D.V..... Set deinterlacing mode (from 0 to 2) (default weave)
         weave                        .D.V..... Weave deinterlacing (do nothing)
         bob                          .D.V..... Bob deinterlacing
         adaptive                     .D.V..... Adaptive deinterlacing
      -gpu                    .D.V..... GPU to be used for decoding
      -surfaces                  .D.V..... Maximum surfaces to be used for decoding (from 0 to INT_MAX) (default 25)
      -drop_second_field     .D.V..... Drop second field when deinterlacing (default false)
      -crop                   .D.V..... Crop (top)x(bottom)x(left)x(right)
      -resize                 .D.V..... Resize (width)x(height)
    

     

关注
打赏
1665724893
查看更多评论
立即登录/注册

微信扫码登录

0.0533s