• FFMPEG 库移植到 VC 需要的步骤


    在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

    (3)在_mingw.h文件的结尾处(在#endif 一行之前)添加了一行:
    #define __restrict__

    (4)把所有long long改成了__int64,如果是直接在vs2008下编译,则这个修改应该是不需要的(这步我没有遇到)

    (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")

    (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

  • 相关阅读:
    Spring注解
    [Exception Android 22]
    Android中Word转Html
    [Exception Android 20]
    POI-word转html
    【JS设计模式】装饰者模式
    C语言中的传值调用
    Spring Aop基础总结
    Android开发-状态栏着色原理和API版本号兼容处理
    9.12測试(二)——国际象棋
  • 原文地址:https://www.cnblogs.com/lidabo/p/4590520.html
Copyright © 2020-2023  润新知