织梦CMS - 轻松建站从此开始!

罗索

MPEG Recorder编译过程

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

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

1.在mpeg recorder solution下查看mpeg recorder工程的依赖库里面有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工程报错:fatal error 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) : see declaration of 'MSXML2::ISAXContentHandler::startPrefixMapping'
1>        'HRESULT MSXML2::ISAXContentHandler::endPrefixMapping(unsigned short *,int)' : is abstract
1>        d:\mpegrecorder_100118\debug\mpegrecorder\msxml3.tlh(695) : see declaration of 'MSXML2::ISAXContentHandler::endPrefixMapping'
1>        'HRESULT MSXML2::ISAXContentHandler::startElement(unsigned short *,int,unsigned short *,int,unsigned short *,int,MSXML2::ISAXAttributes *)' : is abstract
1>        d:\mpegrecorder_100118\debug\mpegrecorder\msxml3.tlh(698) : see declaration 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) : see declaration of 'MSXML2::ISAXContentHandler::endElement'
1>        'HRESULT MSXML2::ISAXContentHandler::characters(unsigned short *,int)' : is abstract
1>        d:\mpegrecorder_100118\debug\mpegrecorder\msxml3.tlh(713) : see declaration of 'MSXML2::ISAXContentHandler::characters'
1>        'HRESULT MSXML2::ISAXContentHandler::ignorableWhitespace(unsigned short *,int)' : is abstract
1>        d:\mpegrecorder_100118\debug\mpegrecorder\msxml3.tlh(716) : see declaration of 'MSXML2::ISAXContentHandler::ignorableWhitespace'
1>        'HRESULT MSXML2::ISAXContentHandler::processingInstruction(unsigned short *,int,unsigned short *,int)' : is abstract
1>        d:\mpegrecorder_100118\debug\mpegrecorder\msxml3.tlh(719) : see declaration of 'MSXML2::ISAXContentHandler::processingInstruction'
1>        'HRESULT MSXML2::ISAXContentHandler::skippedEntity(unsigned short *,int)' : is abstract
1>        d:\mpegrecorder_100118\debug\mpegrecorder\msxml3.tlh(724) : see declaration of 'MSXML2::ISAXContentHandler::skippedEntity'
报错原因:
Visual Studio 2008中 wchar_t *与unsigned short *不兼容
修改:将SAXContentHandlerImpl.h 和SAXContentHandlerImpl.cpp文件中各函数中wchar_t*类型修改为unsigned short *
报错c: error C2664: 'MSXML2::ISAXXMLReader::parseURL' : cannot convert parameter 1 from 'wchar_t [1000]' to 'unsigned short *'
本人将pReader->parseURL(URL);修改为pReader->parseURL((unsigned short*)URL);编译通过。

5报错e:cannot open input file 'libmedia.lib'
             libmedia.lib是FFMPEG的动态lib,MPEG Recorder.ext 运行时 需要libmedia.dll,网上找到这两个文件添 加入工程。

(colorlab)
本站文章除注明转载外,均为本站原创或编译欢迎任何形式的转载,但请务必注明出处,尊重他人劳动,同学习共成长。转载请注明:文章转载自:罗索实验室 [http://www.rosoo.net/a/201109/15015.html]
本文出处:hi.baidu.com/colorlab 作者:colorlab
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片
栏目列表
将本文分享到微信
织梦二维码生成器
推荐内容