CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了CentOS6.2下编译mpeg4ip大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

一、环境 1、操作系统版本 CentOS 6.2 64位 uname -a的输出: Linux localhost.localdomain 2.6.32-220.17.1.el6.x86_64 #1 SMP Wed May 16 00:01:37 BST 2012 x86_64 x86_64 x86_64 GNU/Linux 2、mpeg4ip版本 版本:1.6.1 下载链接: http://pe

一、环境

1、操作系统版本

CentOS 6.2 64

uname -a输出

Linux localhost.localdomain 2.6.32-220.17.1.el6.x86_64 #1 SMP Wed May 16 00:01:37 BST 2012 x86_64 x86_64 x86_64 GNU/Linux

2@H_921_24@mpeg4ip版本

版本:1.6.1

下载链接

http://people.freebsd.org/~ahze/distfiles/mpeg4ip-1.6.1.tar.gz

二、编译

1、编译@H_921_24@mpeg4ip需要的库

首先安装libtool库,命令如下:

yum install libtool

然后进入到@H_921_24@mpeg4ip的目录,运行./bootstrap进行配置,如果出错,是因bash版本及名称的问题,修改bootstrap文件中第一行,改sh bash.或运行 bash ./bootstrap

@L_197_6@如下:

*** ffmpeg encoder is not installed *** xvid encoder is not installed *** x264 encoder is not installed *** lame encoder is not installed *** faac encoder is not installed *** twolame encoder is not installed

安装相应库:

yum install ffmpeg-devel xvidcore-devel twolame-devel x264-devel

编译:@H_401_171@make

2、编译中的错误处理

2.1 报错内容

In file included from config_opts.cpp:1: /include/mpeg4ip.h:126: error: new declaration 'char* strcasestr(const char*, const char*)' /usr/include/String.h:369: error: ambiguates old declaration 'const char* strcasestr(const char*,const char*)'

解决办法:

vi include/mpeg4ip.h

注释掉函数声明,如下所示:

2.2 报错内容

cc1plus: warnings being treated as errors sys_decoder_blkdec.cpp:190: error: suggest parentheses around '&&' within '||' sys_decoder_blkdec.cpp:205: error: suggest parentheses around '&&' within '||'

如图所示:

解决办法:

vi common/video/iso-mpeg4/src/Makefile

去掉Werror

vi命令:%s/-Werror//

2.3 报错内容

type_basic.cpp:320: error: '<anonymous>' has incomplete type type_basic.cpp:320: error: invalid use of 'Void' type_basic.cpp:320: error: prototype for 'Void CMotionVector::setToZero(<type error>)' does not match any in class 'CMotionVector' ./../include/basic.hpp:441: error: candidate is: Void CMotionVector::setToZero()

解决办法:

vi common/video/iso-mpeg4/src/type_basic.cpp

320行去掉括号内的Void,如图所示:

2.4 报错内容

cc1: warnings being treated as errors config.c: In function 'enter_chn': config.c:636: error: array subscript is above array bounds config.c:637: error: array subscript is above array bounds

解决办法:

vi player/lib/audio/faad/Makefile

去掉2.5 报错内容

/usr/local/include/libavutil/common.h: In function ‘int32_t av_clipl_int32(int64_t)’: /usr/local/include/libavutil/common.h:154: error: ‘UINT64_C’ was not declared in this scope ...

解决办法:

涉及到标准cc99的问题,在出问题的文件加上下面三句话就好了

#ifndef UINT64_C #define UINT64_C(value)__CONCAT(value,ULL)
#endif

2.6 报错内容

In file included from ffmpeg.cpp:26: ffmpeg.h:29:28: error: ffmpeg/avcodec.h: No such file or directory ...

解决办法:

版本遗留问题,修改下路径就行了。其实这是一类问题,接下来还会遇到好多次,以这个为例展例下,其它的照此修改就OK了。

vi player/plugin/audio/ffmpeg/ffmpeg.h

在第30行进行修改,替换成完整路径:

#include <ffmpeg-spice/libavcodec/avcodec.h>

2.7报错内容

ffmpeg.cpp: In function 'codec_data_t* ffmpeg_create(const char*,const char*,int,format_list_t*,audio_info_t*,const uint8_t*,uint32_t,audio_vft_t*, void*)': ffmpeg.cpp:180: error: 'AVCODEC_MAX_AUdio_FRAME_SIZE' was not declared in this scope ffmpeg.cpp: In function 'int ffmpeg_decode(codec_data_t*,frame_timestamp_t*,int*,uint8_t*,void*)':

解决办法:

vi /usr/include/ffmpeg-spice/libavcodec/avcodec.h

查找 AVCODEC_MAX_AUdio_FRAME_SIZE,得到如下结果:

复制其值到文件player/plugin/audio/ffmpeg/ffmpeg.h,并把Q去掉:

vi player/plugin/audio/ffmpeg/ffmpeg.h

添加如下内容

#define AVCODEC_MAX_AUdio_FRAME_SIZE 192000

2.8 报错内容

@H_230_147@media_utils.cpp: In function 'int create_media_for_iptv(CPlayerSession*, control_callBACk_vft_t*)': media_utils.cpp:613: error: invalid conversion from 'const char*' to 'char*'

解决办法:

vi player/src/media_utils.cpp

613行,对name变量进行强制类型转换,如图所示:

2.9 报错内容

../server/mp4live/video_util_resize.h:93: error: conflicTing declaration 'uint8_t* fV' ../server/mp4live/video_util_resize.h:91: error: 'fV' has a prevIoUs declaration as 'const uint8_t* fV' ../server/mp4live/video_util_resize.h:94: error: redeFinition of 'uint32_t tvStride' ../server/mp4live/video_util_resize.h:94: error: 'uint32_t tvStride' prevIoUsly declared here
@H_223_502@解决办法:
这个就是函数声明的时候变量重名了,把名字修改的不同就OK了。这是我修改
voidCopyYuv(constuint8_t*fY,constuint8_t*fU,constuint8_t*fV,uint32_tfyStride,uint32_tfuStride,uint32_tfvStride2,uint8_t*tY,uint8_t*tU,uint8_t*fV2,uint32_ttyStride,uint32_ttvStride,uint32_ttvStride2,uint32_tw,uint32_th); 
@H_223_502@2.10 报错内容
video_ffmpeg.cpp:124: error: 'struct AVCodecContext' has no member named 'frame_rate' video_ffmpeg.cpp:125: error: 'struct AVCodecContext' has no member named 'frame_rate_base' video_ffmpeg.cpp:136: error: 'struct AVCodecContext' has no member named 'aspect_ratio'
@H_223_502@解决办法: 这几个错误影响不大,就直接注释掉了,我主要用@H_824_352@mp4live
vi server/mp4live/video_ffmpeg.cpp

好,编译成功,@H_824_352@make install 即可使用。

三、安装使用

1、安装

@H_347_377@make install

2、使用@H_824_352@mp4live

大佬总结

以上是大佬教程为你收集整理的CentOS6.2下编译mpeg4ip全部内容,希望文章能够帮你解决CentOS6.2下编译mpeg4ip所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。