FFMpeg编译支持NVidia CODEC(成功)

简介: FFMpeg编译支持NVidia CODEC(成功)

安装依赖库

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            <int>        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             <int>        .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               <string>     .D.V..... GPU to be used for decoding
  -surfaces          <int>        .D.V..... Maximum surfaces to be used for decoding (from 0 to INT_MAX) (default 25)
  -drop_second_field <boolean>    .D.V..... Drop second field when deinterlacing (default false)
  -crop              <string>     .D.V..... Crop (top)x(bottom)x(left)x(right)
  -resize            <string>     .D.V..... Resize (width)x(height)

 

目录
相关文章
|
开发工具
使用FFmpeg4.3.1的SDK官方开发包编译ffmpeg.c(三)
使用FFmpeg4.3.1的SDK官方开发包编译ffmpeg.c(三)
490 0
|
Linux
Linux编译FFmpeg
Linux编译FFmpeg
615 0
|
Ubuntu 开发工具 git
Ubuntu编译ffmpeg解决错误:ERROR: avisynth/avisynth_c.h not found
通过本文的详细指导,您可以顺利地在Ubuntu系统上配置和编译FFmpeg,并解决Avisynth头文件缺失的问题。
881 27
|
缓存 并行计算 Ubuntu
Jetson 学习笔记(十一):jetson agx xavier 源码编译ffmpeg(3.4.1)和opencv(3.4.0)
本文是关于在Jetson AGX Xavier上编译FFmpeg(3.4.1)和OpenCV(3.4.0)的详细教程,包括编译需求、步骤、测试和可能遇到的问题及其解决方案。还提供了Jetson AGX Xavier编译CUDA版本的OpenCV 4.5.0的相关信息。
803 4
Jetson 学习笔记(十一):jetson agx xavier 源码编译ffmpeg(3.4.1)和opencv(3.4.0)
|
Ubuntu 应用服务中间件 nginx
Ubuntu安装笔记(三):ffmpeg(3.2.16)源码编译opencv(3.4.0)
本文是关于Ubuntu系统中使用ffmpeg 3.2.16源码编译OpenCV 3.4.0的安装笔记,包括安装ffmpeg、编译OpenCV、卸载OpenCV以及常见报错处理。
1482 2
Ubuntu安装笔记(三):ffmpeg(3.2.16)源码编译opencv(3.4.0)
|
Linux API 开发工具
FFmpeg开发笔记(五十九)Linux编译ijkplayer的Android平台so库
ijkplayer是由B站研发的移动端播放器,基于FFmpeg 3.4,支持Android和iOS。其源码托管于GitHub,截至2024年9月15日,获得了3.24万星标和0.81万分支,尽管已停止更新6年。本文档介绍了如何在Linux环境下编译ijkplayer的so库,以便在较新的开发环境中使用。首先需安装编译工具并调整/tmp分区大小,接着下载并安装Android SDK和NDK,最后下载ijkplayer源码并编译。详细步骤包括环境准备、工具安装及库编译等。更多FFmpeg开发知识可参考相关书籍。
1265 0
FFmpeg开发笔记(五十九)Linux编译ijkplayer的Android平台so库
|
Ubuntu
蓝易云 - Ubuntu18.04安装编译ffmpeg库
现在,你应该已经在你的Ubuntu 18.04系统上成功安装和编译了FFmpeg库。你可以通过运行 `ffmpeg -version`来验证安装是否成功。
775 0
|
Ubuntu Linux Shell
Android-NDK-clang 编译 FFmpeg
Android-NDK-clang 编译 FFmpeg
1337 0
|
移动开发 Unix Linux
ffmpeg编译so
ffmpeg编译so
532 0
|
开发工具
使用FFmpeg4.3.1的SDK官方开发包编译ffmpeg.c(二)
使用FFmpeg4.3.1的SDK官方开发包编译ffmpeg.c(二)
454 0