vs2017编译 ffmpeg

ffmpeg下载

ffmpeg下载地址

下载

将上面下载地址中的工程全部进行下载,然后建立目录ffmpeg里面创建目录code将见上面下载工程全部复制进去。
建立文件夹F:\ShiftMediaProject\msvc\include,并在下面建立gl、KHR、ffnvcodec、AMF四个目录

下载
到gl

下载 到KHR

clone 将include下的文件拷贝到ffnvcodec

colne 将amf/public/include下的内容(components、core两个文件夹)拷贝到AMF

clone ,执行install_script.bat安装nasm,如果执行不了,可以手动安装。

以vs2017为例

即将nasm.props nasm.targets nasm.xml拷贝到C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations

下载nasm,install_script.bat中找到所用的版本号,根据系统选择64位或32位,将下载的文件(如nasm-2.13.03-win64.zip)解压,将nasm.exe拷贝至C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC

clone 按nasm一样的步骤操作。

下载打包好的文件,里面包含yasm-32.exe、yasm-64.exe,选择需要的改名yasm.exe拷贝

其他版本vs存放路径可以在install_script.bat中查看出来

添加新文件

最新版ffmpeg中在gnutls库中是缺少文件需要自己添加到gnulib\lib目录下面
我是在缺少文件下载目录1下载,
在这个里面添加文件后发现还缺少三个文件需要自己在网上找。
c-strcase.h

/* Case-insensitive string comparison functions in C locale.
   Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2012 Free Software
   Foundation, Inc.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, see <http://www.gnu.org/licenses/>.  */

#ifndef C_STRCASE_H
#define C_STRCASE_H

#include <stddef.h>


/* The functions defined in this file assume the "C" locale and a character
   set without diacritics (ASCII-US or EBCDIC-US or something like that).
   Even if the "C" locale on a particular system is an extension of the ASCII
   character set (like on BeOS, where it is UTF-8, or on AmigaOS, where it
   is ISO-8859-1), the functions in this file recognize only the ASCII
   characters.  More precisely, one of the string arguments must be an ASCII
   string; the other one can also contain non-ASCII characters (but then
   the comparison result will be nonzero).  */


#ifdef __cplusplus
extern "C" {
#endif


/* Compare strings S1 and S2, ignoring case, returning less than, equal to or
   greater than zero if S1 is lexicographically less than, equal to or greater
   than S2.  */
extern int c_strcasecmp (const char *s1, const char *s2) _GL_ATTRIBUTE_PURE;

/* Compare no more than N characters of strings S1 and S2, ignoring case,
   returning less than, equal to or greater than zero if S1 is
   lexicographically less than, equal to or greater than S2.  */
extern int c_strncasecmp (const char *s1, const char *s2, size_t n)
  _GL_ATTRIBUTE_PURE;


#ifdef __cplusplus
}
#endif


#endif /* C_STRCASE_H */

c-strcasecmp.c

   /* c-strcasecmp.c -- case insensitive string comparator in C locale
    2    Copyright (C) 1998-1999, 2005-2006, 2009-2018 Free Software Foundation, Inc.
    3 
    4    This program is free software; you can redistribute it and/or modify
    5    it under the terms of the GNU General Public License as published by
    6    the Free Software Foundation; either version 3, or (at your option)
    7    any later version.
    8 
    9    This program is distributed in the hope that it will be useful,
   10    but WITHOUT ANY WARRANTY; without even the implied warranty of
   11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12    GNU General Public License for more details.
   13 
   14    You should have received a copy of the GNU General Public License
   15    along with this program; if not, see <https://www.gnu.org/licenses/>.  */
   
    #include <config.h>
    
    /* Specification.  */
    #include "c-strcase.h"
    
    #include <limits.h>
    
    #include "c-ctype.h"
    
    int
    c_strcasecmp (const char *s1, const char *s2)
    {
      register const unsigned char *p1 = (const unsigned char *) s1;
      register const unsigned char *p2 = (const unsigned char *) s2;
      unsigned char c1, c2;
    
      if (p1 == p2)
        return 0;
    
      do
        {
          c1 = c_tolower (*p1);
          c2 = c_tolower (*p2);
    
          if (c1 == '\0')
            break;
    
          ++p1;
          ++p2;
        }
      while (c1 == c2);
    
      if (UCHAR_MAX <= INT_MAX)
        return c1 - c2;
      else
        /* On machines where 'char' and 'int' are types of the same size, the
           difference of two 'unsigned char' values - including the sign bit -
           doesn't fit in an 'int'.  */
        return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
    }

c-strncasecmp.c

/* c-strncasecmp.c -- case insensitive string comparator in C locale
   Copyright (C) 1998-1999, 2005-2006, 2009-2012 Free Software Foundation, Inc.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, see <http://www.gnu.org/licenses/>.  */

#include <config.h>

/* Specification.  */
#include "c-strcase.h"

#include <limits.h>

#include "c-ctype.h"

int
c_strncasecmp (const char *s1, const char *s2, size_t n)
{
  register const unsigned char *p1 = (const unsigned char *) s1;
  register const unsigned char *p2 = (const unsigned char *) s2;
  unsigned char c1, c2;

  if (p1 == p2 || n == 0)
    return 0;

  do
    {
      c1 = c_tolower (*p1);
      c2 = c_tolower (*p2);

      if (--n == 0 || c1 == '\0')
        break;

      ++p1;
      ++p2;
    }
  while (c1 == c2);

  if (UCHAR_MAX <= INT_MAX)
    return c1 - c2;
  else
    /* On machines where 'char' and 'int' are types of the same size, the
       difference of two 'unsigned char' values - including the sign bit -
       doesn't fit in an 'int'.  */
    return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
}

或者可以自行下载gnulib进行添加

编译

打开\code\Ffmpeg\SMP\ ffmpeg_deps.sln ,选好配置项,编译ffmpeg、ffplay、ffprobe,会自动编译依赖项,可以根据自己需求编译动态库和静态库。生成文件会在msvc目录下。

参考博客

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值