我是靠谱客的博主 俭朴夕阳,这篇文章主要介绍ffmpeg升级4.3.1版本,套用2.4.2版本静态库编译环境,编译不过问题,现在分享给大家,希望可以做个参考。

ffmpeg升级4.3.1版本,套用2.4.2版本静态库编译环境,编译不过问题

之前的静态库编译脚本,直接将需要编译的文件全部放入编译列表编译即可,最新的ffmpeg下载下来以后,为了省事,直接套用老的方式,各种编不过,本人编译ffmpeg静态库只用到了libavutil libavformat libavcodec,其它几个未涉及~
下面说一下遇到的问题及解决方式:

1.许多地方提示函数在声明之前被调用的问题,统一加宏处理,config.h文件加入如下宏:
#define HAVE_COPYSIGN 1
#define HAVE_ERF 1
#define HAVE_ISFINITE 1
#define HAVE_HYPOT 1
#define HAVE_AVX512 0
#define CONFIG_OSSFUZZ 1

2.编译提示缺少各种*_list.c文件,编译出错,例如打印:

复制代码
1
2
3
4
5
6
7
8
9
10
11
bsf.c: In function 'av_bsf_list_parse_str': bsf.c:541:5: warning: suggest parentheses around assignment used as truth value [-Wparentheses] while (bsf_str = av_strtok(buf, ",", &saveptr)) { ^ bitstream_filters.c: In function 'av_bsf_iterate': bitstream_filters.c:69:34: error: 'bitstream_filters' undeclared (first use in this function) const AVBitStreamFilter *f = bitstream_filters[i]; ^ bitstream_filters.c:69:34: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [bitstream_filters.o] 错误 1

这个查了好久的相关资料,没有运行configure脚本,导致没有生成这些list.c文件,相关说明去这里,传送阵:https://my.oschina.net/u/2326611/blog/798200

3.有些比较老的编译器,不支持if条件判断中定义变量,如下:
if(int i = 0; …),编译直接报错,这个没啥好说的,手动一个一个的改吧,把定义放到“int i = 0”放到外面就好了;

4.说一下*_list.c文件生成方式,linux下进入ffmpeg目录下,看一下有没有configure文件,有的话再进行命令操作;

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
[@localhost ffmpeg]$ ls Changelog CONTRIBUTING.md COPYING.LGPLv2.1 doc INSTALL.md libavfilter libavutil libswscale Makefile RELEASE VERSION compat COPYING.GPLv2 COPYING.LGPLv3 ffbuild libavcodec libavformat libpostproc LICENSE.md presets tests configure COPYING.GPLv3 CREDITS fftools libavdevice libavresample libswresample MAINTAINERS README.md tools [@localhost ffmpeg]$ ./configure tput: unknown terminal "xterm" tput: unknown terminal "xterm" nasm/yasm not found or too old. Use --disable-x86asm for a crippled build. If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file "ffbuild/config.log" produced by configure as this will help solve the problem. [@localhost ffmpeg]$ ./configure --disable-x86asm tput: unknown terminal "xterm" tput: unknown terminal "xterm" install prefix /usr/local source path . C compiler gcc C library glibc ARCH x86 (generic) big-endian no runtime cpu detection yes standalone assembly no x86 assembler nasm MMX enabled yes MMXEXT enabled yes

configure内容太多,没怎么研究,直接执行了,需要等好几分钟来执行这个脚本,打印太多,就不全部贴出来了,成功后就会在所有lib*目录下生成编译缺失的各种list.c文件了

最后

以上就是俭朴夕阳最近收集整理的关于ffmpeg升级4.3.1版本,套用2.4.2版本静态库编译环境,编译不过问题的全部内容,更多相关ffmpeg升级4内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(96)

评论列表共有 0 条评论

立即
投稿
返回
顶部