CentOS 6.2下编译mpeg4ip(2)

/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> 

CentOS 6.2下编译mpeg4ip

2.7 报错内容: 

ffmpeg.cpp: In function 'codec_data_t* ffmpeg_create(const char*, const char*, int, 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, int*, uint8_t*, uint32_t, void*)':

解决办法:

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

查找 AVCODEC_MAX_AUDIO_FRAME_SIZE,得到如下结果: 

CentOS 6.2下编译mpeg4ip

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

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

添加如下内容:

#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 

CentOS 6.2下编译mpeg4ip

2.8 报错内容: 

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

解决办法:

vi player/src/media_utils.cpp

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

CentOS 6.2下编译mpeg4ip

 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

解决办法:
这个就是函数声明的时候变量重名了,把名字修改的不同就OK了。这是我修改:

void CopyYuv(const uint8_t *fY, const uint8_t *fU, const uint8_t *fV,              uint32_t fyStride, uint32_t fuStride, uint32_t fvStride2,              uint8_t *tY, uint8_t *tU, uint8_t *fV2,              uint32_t tyStride, uint32_t tvStride, uint32_t tvStride2,              uint32_t w, uint32_t h);

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'

解决办法: 这几个错误影响不大,就直接注释掉了,我主要用mp4live 

CentOS 6.2下编译mpeg4ip

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

三、安装使用

1、安装

make install

2、使用mp4live

CentOS 6.2下编译mpeg4ip

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/21588.html