MPEG Recorder编译过程

MPEG Recorder 是sourceforge上的一个开源项目,用于Windows平台下的实时音视频信号的压缩与存储,用到 MFC, DirectX, FFMPEG and MPEG4IP等。最近项目要用到视频的转码与存储,于是下载下来学习学习,用VS2008编译中碰到一些问题,解决过程如下:

1.在mpeg recorder solution下查看mpegrecorder工程的依赖库里面有strmbasd.lib,这当然需要安装directshow SDK并配置开发环境了,这些我都已经配置好了,此步就可以省略了。

2:编译libmp4v2 工程到pSlash =strchr(pRtpMap, '/');处报错: error C2440: '=' : cannot convert from 'const char *' to 'char *'。

将 char* pSlash; 改为const char* pSlash;

3:编译rtp工程报错:fatalerror C1083: Cannot open include file: 'winsock6.h': No such file or directory

暂时解决方法:在configuration manager 中将rtp工程从Debug IPv6 Musica 调整为Debug,

再次编译报错:error C2373: 'RegGetValueA' : redefinition; different type modifiers

注释掉config_win32.h文件中的RegGetValue(HKEY *, char *, char*, char*, int)函数声明

 

4:编译MPEGRecorder

报错a:error C2664: 'localtime' : cannot convert parameter 1 from 'long *'to 'const time_t *'

本人将出错代码:

strftime(buffer, sizeof(buffer),"%T", localtime(&thistime.tv_sec));

size = sprintf(str,"%s.%03ld-mp4live-7:", buffer, thistime.tv_usec / 1000);

修改为:

time_t rawtime;

struct tm * timeinfo;

time( &rawtime );

timeinfo = localtime ( &rawtime );

strftime(buffer, sizeof(buffer),"%T", timeinfo);

size =sprintf(str,"%s.%f03ld-mp4live-7: ", buffer, timeinfo->tm_sec /1000);

报错b:error C2440: '=' : cannot convert from 'const char *' to 'char *'

将char *szTemp; 修改为 const char *szTemp;

报错c:

error C2259: 'CTimeEventsContentHandler' :cannot instantiate abstract class

1>       due to following members:

1>       'HRESULT MSXML2::ISAXContentHandler::startPrefixMapping(unsigned short*,int,unsigned short *,int)' : is abstract

1>       d:\mpegrecorder_100118\debug\mpegrecorder\msxml3.tlh(690) : seedeclaration of 'MSXML2::ISAXContentHandler::startPrefixMapping'

1>       'HRESULT MSXML2::ISAXContentHandler::endPrefixMapping(unsigned short*,int)' : is abstract

1>       d:\mpegrecorder_100118\debug\mpegrecorder\msxml3.tlh(695) : seedeclaration of 'MSXML2::ISAXContentHandler::endPrefixMapping'

1>       'HRESULT MSXML2::ISAXContentHandler::startElement(unsigned short*,int,unsigned short *,int,unsigned short *,int,MSXML2::ISAXAttributes *)' : isabstract

1>       d:\mpegrecorder_100118\debug\mpegrecorder\msxml3.tlh(698) : seedeclaration of 'MSXML2::ISAXContentHandler::startElement'

1>       'HRESULT MSXML2::ISAXContentHandler::endElement(unsigned short*,int,unsigned short *,int,unsigned short *,int)' : is abstract

1>       d:\mpegrecorder_100118\debug\mpegrecorder\msxml3.tlh(706) : seedeclaration of 'MSXML2::ISAXContentHandler::endElement'

1>       'HRESULT MSXML2::ISAXContentHandler::characters(unsigned short *,int)' :is abstract

1>       d:\mpegrecorder_100118\debug\mpegrecorder\msxml3.tlh(713) : seedeclaration of 'MSXML2::ISAXContentHandler::characters'

1>       'HRESULT MSXML2::ISAXContentHandler::ignorableWhitespace(unsigned short*,int)' : is abstract

1>       d:\mpegrecorder_100118\debug\mpegrecorder\msxml3.tlh(716) : seedeclaration of 'MSXML2::ISAXContentHandler::ignorableWhitespace'

1>       'HRESULTMSXML2::ISAXContentHandler::processingInstruction(unsigned short *,int,unsignedshort *,int)' : is abstract

1>       d:\mpegrecorder_100118\debug\mpegrecorder\msxml3.tlh(719) : seedeclaration of 'MSXML2::ISAXContentHandler::processingInstruction'

1>       'HRESULT MSXML2::ISAXContentHandler::skippedEntity(unsigned short*,int)' : is abstract

1>       d:\mpegrecorder_100118\debug\mpegrecorder\msxml3.tlh(724) : seedeclaration of 'MSXML2::ISAXContentHandler::skippedEntity'

报错原因:

Visual Studio 2008中 wchar_t *与unsignedshort *不兼容

修改:将SAXContentHandlerImpl.h 和SAXContentHandlerImpl.cpp文件中各函数中wchar_t*类型修改为unsignedshort *

报错c: error C2664: 'MSXML2::ISAXXMLReader::parseURL' : cannot convertparameter 1 from 'wchar_t [1000]' to 'unsigned short *'

本人将pReader->parseURL(URL);修改为pReader->parseURL((unsignedshort*)URL);编译通过。

 

5报错e:cannot openinput file 'libmedia.lib'

            libmedia.lib是FFMPEG的动态lib,MPEG Recorder.ext 运行时需要libmedia.dll,网上找到这两个文件添加入工程。

 

运行程序:

来源:http://blog.csdn.net/lezhiyong

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值