• 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
    

  • 相关阅读:
    AGC015E Mr.Aoki Incubator
    luogu P3520 [POI2011]SMI-Garbage
    442.Find All Duplicates in an Array
    SICP_2.61-2.62
    sicp_2.59-2.60
    SICP_2.58
    SICP_2.56-2.57
    SICP_2.53-2.55
    SICP_2.52-2.53
    SICP_2.50-2.51
  • 原文地址:https://www.cnblogs.com/rabitvision/p/9237855.html
Copyright © 2020-2023  润新知