zoukankan      html  css  js  c++  java
  • 【转】FFMPEG 库移植到 VC 需要的步骤

    原文:http://blog.csdn.net/leixiaohua1020/article/details/12747899

    在VC下使用FFMPEG编译好的库,不仅仅是把.h,.lib,.dll拷贝到工程中就行了,还需要做以下几步。(此方法适用于自己使用MinGW编译的库,也同样适用于从网上下载的编译好的库,例如http://ffmpeg.zeranoe.com/builds/)。

    (1)像其他额外库一样,设置VC的Include路径为你c:msyslocalinclude,

       

      设置VClib路径为次c:msyslocalin,

      增加操作系统的一个Path c:msyslocalin(这一步好像不是必须的)。


    (2)将mingw安装目录下的include的inttypes.h,stdint.h,_mingw.h三个文件拷到你ffmpeg库的目录下的include
      

    Latest Zeranoe FFmpeg Build Version: git-e9aea6d (2015-11-17)已不需要

    (3)在_mingw.h文件的结尾处(在#endif 一行之前)添加了一行:
    #define __restrict__
    Latest Zeranoe FFmpeg Build Version: git-e9aea6d (2015-11-17)已不需要
    (4)把所有long long改成了__int64,如果是直接在vs2008下编译,则这个修改应该是不需要的(这步我没有遇到)
    Latest Zeranoe FFmpeg Build Version: git-e9aea6d (2015-11-17)已不需要
    (5)
    #ifdef __cplusplus

    #include "stdio.h"
    #include "stdlib.h"
    #include "string.h"
    #include "SDL/SDL.h"
    //#include "windows.h"

    extern "C"
    {
            #include "ffmpeg/avutil.h"
            #include "ffmpeg/avcodec.h"
            #include "ffmpeg/avformat.h"
    }

    #endif
            
    #pragma comment(lib,"avutil.lib")
    #pragma comment(lib,"avcodec.lib")
    #pragma comment(lib,"avformat.lib")
    Latest Zeranoe FFmpeg Build Version: git-e9aea6d (2015-11-17)已不需要
    (6)如果遇到error C3861: 'UINT64_C': identifier not found
    在common.h里加入定义如下:
    #ifndef INT64_C
    #define INT64_C(c) (c ## LL)
    #define UINT64_C(c) (c ## ULL)

    #endif

    原文地址:http://blog.sina.com.cn/s/blog_6bcde18101011v2h.html

  • 相关阅读:
    7.31 "简单"(大嘘)DP
    P2014 选课
    7.30 "简单"(大嘘)DP
    Codeforce 1131C Birthday (构造数组)
    洛谷 P1074【靶形数独】(DFS)
    NOIP2004【虫食算】(DFS)
    洛谷 P1025【数的划分】(DFS dp)
    洛谷P1019【单词接龙】(DFS)
    洛谷P1162【机器人搬重物】(BFS)
    洛谷P1141【01迷宫】
  • 原文地址:https://www.cnblogs.com/nightnine/p/4976711.html
Copyright © 2011-2022 走看看