MPEG Recorder编译过程

本文档详细记录了MPEGRecorder项目的编译过程及遇到的问题解决方案。MPEGRecorder是一款用于Windows平台的音视频压缩与存储软件,使用MFC、DirectX、FFMPEG等技术。文章解决了编译过程中出现的各种错误,包括类型转换、文件缺失等问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

              MPEG Recorder编译过程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,网上找到这两个文件添 加入工程

运行程序:



   



转自 http://hi.baidu.com/colorlab/blog/item/b9aae3b7be406dc537d3ca2e.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值