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