zoukankan      html  css  js  c++  java
  • ffmpeg+cuda+opencv

    为了让ffmpeg使用gpu进行解码,可以按以下步骤:

    1 下载nvidia官网提供的ffmpeg,编译安装

    https://developer.nvidia.com/ffmpeg

    注意原来的选项上还需要添加上 --enable-shared

    如果出现编译错误

    ERROR: cuda requested, but not all dependencies are satisfied: ffnvcodec
    参考:https://superuser.com/questions/1299064/error-cuvid-requested-but-not-all-dependencies-are-satisfied-cuda-ffnvcodec
    git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
    make
    sudo make install
     

    2 编译opencv

    可以采用2.4.13.6

    注意会出现报错

    error: ‘CODEC_FLAG_GLOBAL_HEADER’ was not declared in this scope
    解决办法参考 https://stackoverflow.com/questions/46884682/error-in-building-opencv-with-ffmpeg
    即把以下三行拷贝到 cap_ffmpeg_impl.hpp 开头
    #define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)
    #define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
    #define AVFMT_RAWPICTURE 0x0020
    

  • 相关阅读:
    重塑矩阵
    数组拆分
    最大连续1的个数
    石子游戏
    概率与期望知识总结
    洛谷 P3951 NOIP 2017 小凯的疑惑
    关于结构体的初始化
    山海经:线段树维护最大子段和
    偏序 分块+bitset
    分块练习C. interval
  • 原文地址:https://www.cnblogs.com/rabitvision/p/9237855.html
Copyright © 2011-2022 走看看