Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/141.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
直接放映(AMCap)-平台SDK 我试图同时捕获多个网络摄像头的图像,并用C++自动延迟最小延迟。我还希望该程序能够在需要时改变网络摄像机的参数。我希望在平台SDK上构建Direct show samples(AMCap),然后编辑代码以适合我的应用程序。但我总是出错_C++_Visual Studio 2008_Video_Directshow_Photo - Fatal编程技术网

直接放映(AMCap)-平台SDK 我试图同时捕获多个网络摄像头的图像,并用C++自动延迟最小延迟。我还希望该程序能够在需要时改变网络摄像机的参数。我希望在平台SDK上构建Direct show samples(AMCap),然后编辑代码以适合我的应用程序。但我总是出错

直接放映(AMCap)-平台SDK 我试图同时捕获多个网络摄像头的图像,并用C++自动延迟最小延迟。我还希望该程序能够在需要时改变网络摄像机的参数。我希望在平台SDK上构建Direct show samples(AMCap),然后编辑代码以适合我的应用程序。但我总是出错,c++,visual-studio-2008,video,directshow,photo,C++,Visual Studio 2008,Video,Directshow,Photo,我能够构建基类并在“include”和“library files”下包含路径。在尝试构建AMCap时,我遇到了以下错误。我正在使用VisualStudio2008开发XP Compiling... amcap.cpp d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(231) : error C2664: 'StringCchCatA' : can

我能够构建基类并在“include”和“library files”下包含路径。在尝试构建AMCap时,我遇到了以下错误。我正在使用VisualStudio2008开发XP

Compiling...
amcap.cpp
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(231) : error C2664: 'StringCchCatA' : cannot convert parameter 3 from 'WCHAR [260]' to 'STRSAFE_LPCSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(327) : error C2664: 'GetProfileStringA' : cannot convert parameter 4 from 'WCHAR [260]' to 'LPSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(2691) : error C2664: 'statusUpdateStatus' : cannot convert parameter 2 from 'WCHAR [120]' to 'LPCTSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(2698) : error C2664: 'StringCchCopyNA' : cannot convert parameter 1 from 'WCHAR [1024]' to 'STRSAFE_LPSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(2699) : error C2664: 'StringCchCopyNA' : cannot convert parameter 1 from 'WCHAR [1024]' to 'STRSAFE_LPSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(2831) : error C2664: 'AppendMenuA' : cannot convert parameter 4 from 'BSTR' to 'LPCSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(2887) : error C2664: 'AppendMenuA' : cannot convert parameter 4 from 'BSTR' to 'LPCSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(3792) : error C2664: 'StringCchCopyA' : cannot convert parameter 3 from 'WCHAR [260]' to 'STRSAFE_LPCSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(3838) : error C2664: 'OpenFileDialog' : cannot convert parameter 2 from 'WCHAR [260]' to 'LPTSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(3844) : error C2664: 'GetFileAttributesA' : cannot convert parameter 1 from 'WCHAR [260]' to 'LPCSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(3904) : error C2664: 'ICaptureGraphBuilder2::CopyCaptureFile' : cannot convert parameter 2 from 'TCHAR [260]' to 'LPOLESTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(4108) : error C2664: 'GetSize' : cannot convert parameter 1 from 'WCHAR [260]' to 'LPCTSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(4112) : error C2664: 'GetFreeDiskSpaceInKB' : cannot convert parameter 1 from 'WCHAR [260]' to 'LPTSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(4165) : error C2664: '_wtol' : cannot convert parameter 1 from 'TCHAR [21]' to 'const wchar_t *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(4240) : error C2664: '_wtof' : cannot convert parameter 1 from 'TCHAR [32]' to 'const wchar_t *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(4392) : error C2664: 'WriteProfileStringA' : cannot convert parameter 3 from 'WCHAR [260]' to 'LPCSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(4403) : error C2664: 'StringCchCopyNA' : cannot convert parameter 3 from 'WCHAR *' to 'STRSAFE_LPCSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\program files\microsoft sdks\windows\v6.1\samples\multimedia\directshow\capture\amcap\amcap.cpp(4421) : error C2664: 'StringCchCopyA' : cannot convert parameter 3 from 'WCHAR *' to 'STRSAFE_LPCSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
这些错误看起来像字符串不匹配错误,因此尝试使用unicode字符集构建它们,并得到以下错误

Compiling...
amcap.cpp
crossbar.cpp
SampleCGB.cpp
status.cpp
stdafx.cpp
Generating Code...
Compiling resources...
Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
Copyright (C) Microsoft Corporation.  All rights reserved.
Linking...
amcap.obj : error LNK2019: unresolved external symbol "void __stdcall DbgAssert(unsigned short const *,unsigned short const *,int)" (?DbgAssert@@YGXPBG0H@Z) referenced in function "int __cdecl AppInit(struct HINSTANCE__ *,struct HINSTANCE__ *,int)" (?AppInit@@YAHPAUHINSTANCE__@@0H@Z)
crossbar.obj : error LNK2001: unresolved external symbol "void __stdcall DbgAssert(unsigned short const *,unsigned short const *,int)" (?DbgAssert@@YGXPBG0H@Z)
SampleCGB.obj : error LNK2001: unresolved external symbol "void __stdcall DbgAssert(unsigned short const *,unsigned short const *,int)" (?DbgAssert@@YGXPBG0H@Z)
amcap.obj : error LNK2001: unresolved external symbol _AM_KSCATEGORY_CAPTURE
amcap.obj : error LNK2001: unresolved external symbol _IID_IBaseFilter
crossbar.obj : error LNK2001: unresolved external symbol _IID_IBaseFilter
SampleCGB.obj : error LNK2019: unresolved external symbol _IID_IBaseFilter referenced in function "protected: long __thiscall ISampleCaptureGraphBuilder::GetMedium(struct IPin *,struct __MIDL___MIDL_itf_strmif_0000_0022_0003 &)" (?GetMedium@ISampleCaptureGraphBuilder@@IAEJPAUIPin@@AAU__MIDL___MIDL_itf_strmif_0000_0022_0003@@@Z)
amcap.obj : error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function "long __stdcall AppWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?AppWndProc@@YGJPAUHWND__@@IIJ@Z)
amcap.obj : error LNK2001: unresolved external symbol _CLSID_CaptureGraphBuilder2
amcap.obj : error LNK2001: unresolved external symbol _IID_ICaptureGraphBuilder2
amcap.obj : error LNK2001: unresolved external symbol _CLSID_FilterGraph
amcap.obj : error LNK2001: unresolved external symbol _IID_IGraphBuilder
amcap.obj : error LNK2001: unresolved external symbol _PIN_CATEGORY_CC
amcap.obj : error LNK2001: unresolved external symbol _PIN_CATEGORY_VBI
amcap.obj : error LNK2001: unresolved external symbol _MEDIATYPE_Audio
SampleCGB.obj : error LNK2001: unresolved external symbol _MEDIATYPE_Audio
amcap.obj : error LNK2001: unresolved external symbol _PIN_CATEGORY_ANALOGVIDEOIN
amcap.obj : error LNK2001: unresolved external symbol _AMPROPSETID_Pin
amcap.obj : error LNK2001: unresolved external symbol _IID_IKsPropertySet
amcap.obj : error LNK2001: unresolved external symbol _IID_IAMVfwCaptureDialogs
amcap.obj : error LNK2019: unresolved external symbol "void __stdcall DeleteMediaType(struct _AMMediaType *)" (?DeleteMediaType@@YGXPAU_AMMediaType@@@Z) referenced in function "int __cdecl InitCapFilters(void)" (?InitCapFilters@@YAHXZ)
SampleCGB.obj : error LNK2001: unresolved external symbol "void __stdcall DeleteMediaType(struct _AMMediaType *)" (?DeleteMediaType@@YGXPAU_AMMediaType@@@Z)
amcap.obj : error LNK2001: unresolved external symbol _FORMAT_VideoInfo
amcap.obj : error LNK2001: unresolved external symbol _IID_IAMStreamConfig
amcap.obj : error LNK2001: unresolved external symbol _MEDIATYPE_Video
SampleCGB.obj : error LNK2001: unresolved external symbol _MEDIATYPE_Video
amcap.obj : error LNK2001: unresolved external symbol _PIN_CATEGORY_CAPTURE
amcap.obj : error LNK2001: unresolved external symbol _MEDIATYPE_Interleaved
amcap.obj : error LNK2001: unresolved external symbol _IID_IAMVideoCompression
amcap.obj : error LNK2001: unresolved external symbol _IID_IMediaEventEx
amcap.obj : error LNK2001: unresolved external symbol _IID_IVideoWindow
amcap.obj : error LNK2001: unresolved external symbol _MEDIATYPE_Stream
SampleCGB.obj : error LNK2001: unresolved external symbol _MEDIATYPE_Stream
amcap.obj : error LNK2001: unresolved external symbol _PIN_CATEGORY_PREVIEW
amcap.obj : error LNK2001: unresolved external symbol _IID_IConfigAviMux
amcap.obj : error LNK2001: unresolved external symbol _MEDIASUBTYPE_Avi
amcap.obj : error LNK2001: unresolved external symbol _IID_IBasicVideo
amcap.obj : error LNK2001: unresolved external symbol _FORMAT_DvInfo
amcap.obj : error LNK2001: unresolved external symbol _IID_IMediaControl
amcap.obj : error LNK2001: unresolved external symbol _IID_IAMDroppedFrames
amcap.obj : error LNK2001: unresolved external symbol _IID_IAMTVAudio
amcap.obj : error LNK2001: unresolved external symbol _IID_IAMTVTuner
amcap.obj : error LNK2001: unresolved external symbol _LOOK_UPSTREAM_ONLY
amcap.obj : error LNK2001: unresolved external symbol _IID_IAMCrossbar
crossbar.obj : error LNK2001: unresolved external symbol _IID_IAMCrossbar
amcap.obj : error LNK2001: unresolved external symbol _CLSID_AudioInputDeviceCategory
amcap.obj : error LNK2001: unresolved external symbol _CLSID_VideoInputDeviceCategory
amcap.obj : error LNK2001: unresolved external symbol _CLSID_SystemDeviceEnum
SampleCGB.obj : error LNK2001: unresolved external symbol _CLSID_SystemDeviceEnum
amcap.obj : error LNK2001: unresolved external symbol _IID_ICreateDevEnum
SampleCGB.obj : error LNK2001: unresolved external symbol _IID_ICreateDevEnum
amcap.obj : error LNK2019: unresolved external symbol _acmFormatChooseW@4 referenced in function "void __cdecl ChooseAudioFormat(void)" (?ChooseAudioFormat@@YAXXZ)
amcap.obj : error LNK2019: unresolved external symbol _acmMetrics@12 referenced in function "void __cdecl ChooseAudioFormat(void)" (?ChooseAudioFormat@@YAXXZ)
amcap.obj : error LNK2001: unresolved external symbol _IID_IAMCopyCaptureFileProgress
crossbar.obj : error LNK2019: unresolved external symbol "void __cdecl DbgLogInfo(unsigned long,unsigned long,unsigned short const *,...)" (?DbgLogInfo@@YAXKKPBGZZ) referenced in function "public: __thiscall CCrossbar::CCrossbar(struct IPin *,long *)" (??0CCrossbar@@QAE@PAUIPin@@PAJ@Z)
crossbar.obj : error LNK2019: unresolved external symbol "public: __thiscall CBaseList::~CBaseList(void)" (??1CBaseList@@QAE@XZ) referenced in function "public: __thiscall CGenericList::~CGenericList(void)" (??1?$CGenericList@VCRouting@@@@QAE@XZ)
crossbar.obj : error LNK2019: unresolved external symbol "public: __thiscall CBaseList::CBaseList(unsigned short const *,int)" (??0CBaseList@@QAE@PBGH@Z) referenced in function "public: __thiscall CGenericList::CGenericList(unsigned short const *,int,int,int)" (??0?$CGenericList@VCRouting@@@@QAE@PBGHHH@Z)
crossbar.obj : error LNK2019: unresolved external symbol "protected: void * __thiscall CBaseList::GetNextI(struct __POSITION * &)const " (?GetNextI@CBaseList@@IBEPAXAAPAU__POSITION@@@Z) referenced in function "public: class CRouting * __thiscall CGenericList::GetNext(struct __POSITION * &)const " (?GetNext@?$CGenericList@VCRouting@@@@QBEPAVCRouting@@AAPAU__POSITION@@@Z)
crossbar.obj : error LNK2019: unresolved external symbol "protected: void * __thiscall CBaseList::RemoveHeadI(void)" (?RemoveHeadI@CBaseList@@IAEPAXXZ) referenced in function "public: class CRouting * __thiscall CGenericList::RemoveHead(void)" (?RemoveHead@?$CGenericList@VCRouting@@@@QAEPAVCRouting@@XZ)
crossbar.obj : error LNK2019: unresolved external symbol "protected: struct __POSITION * __thiscall CBaseList::AddTailI(void *)" (?AddTailI@CBaseList@@IAEPAU__POSITION@@PAX@Z) referenced in function "public: struct __POSITION * __thiscall CGenericList::AddTail(class CRouting *)" (?AddTail@?$CGenericList@VCRouting@@@@QAEPAU__POSITION@@PAVCRouting@@@Z)
crossbar.obj : error LNK2019: unresolved external symbol "protected: void * __thiscall CBaseList::GetI(struct __POSITION *)const " (?GetI@CBaseList@@IBEPAXPAU__POSITION@@@Z) referenced in function "public: class CRouting * __thiscall CGenericList::Get(struct __POSITION *)const " (?Get@?$CGenericList@VCRouting@@@@QBEPAVCRouting@@PAU__POSITION@@@Z)
SampleCGB.obj : error LNK2001: unresolved external symbol _MEDIASUBTYPE_MPEG2_PROGRAM
SampleCGB.obj : error LNK2001: unresolved external symbol _MEDIASUBTYPE_MPEG2_VIDEO
SampleCGB.obj : error LNK2001: unresolved external symbol _CLSID_FilterMapper2
SampleCGB.obj : error LNK2001: unresolved external symbol _IID_IFilterMapper2
SampleCGB.obj : error LNK2001: unresolved external symbol _IID_IKsPin
SampleCGB.obj : error LNK2001: unresolved external symbol _CLSID_MPEG2Demultiplexer
SampleCGB.obj : error LNK2001: unresolved external symbol _FORMAT_MPEG2Video
SampleCGB.obj : error LNK2001: unresolved external symbol _FORMAT_WaveFormatEx
SampleCGB.obj : error LNK2001: unresolved external symbol _MEDIASUBTYPE_MPEG2_AUDIO
SampleCGB.obj : error LNK2001: unresolved external symbol _IID_IMpeg2Demultiplexer
D:\Documents and Settings\Chris Salthouse\My Documents\Visual Studio 2008\Projects\AMCap\Debug\AMCap.exe : fatal error LNK1120:60 unresolved externals

我应该使用Unicode还是多字节?我不明白是什么引起了这个问题。任何帮助或建议都将不胜感激。非常感谢您抽出时间

只要在基类项目和amcap项目中具有相同的设置,就可以使用多字节或unicode。检查unicode与multibyte,并检查运行时(静态或dll)wchar\u t内置的是/否、调用约定等设置。确保所有这些匹配

只要在基类项目和amcap项目中具有相同的设置,就可以使用多字节或unicode。检查unicode与multibyte,并检查运行时(静态或dll)wchar\u t内置的是/否、调用约定等设置。确保所有这些匹配

库目录中是否包含基类?您需要让您的链接器找到Strmbase.lib(release)或Strmbasd.lib(debug)


编辑:我将vs2005与PSDK 6.0一起使用,它对我来说运行良好。

在库目录中包含基类了吗?您需要让您的链接器找到Strmbase.lib(release)或Strmbasd.lib(debug)


编辑:我将vs2005与PSDK 6.0一起使用,它对我来说运行良好。

我已对属性页进行了所有必需的更改。wchar_t build设置为NO,并附加在附加include目录下的Common。其他一切都有默认设置。我是否遗漏了什么?我已对属性页进行了所有必需的更改。wchar_t build设置为NO,并附加在附加include目录下的Common。其他一切都有默认设置。我错过什么了吗?嘿!在我明确附加了库文件之后,我终于能够构建它了!非常感谢你的帮助。。。。但现在我需要帮助!AMCap能够处理2个或多个网络摄像头,我如何修改程序以便同时使用它们…比如按下一个显示“开始捕获”的按钮并确保所有摄像头开始捕获,以及按下一个显示“停止捕获”的按钮停止所有摄像头。再次感谢!第一件事。我不是真正的DShow专家,所以我要说的可能是错误的。*每个网络摄像头都是一个源。*您可以使用DirectShow编辑服务构建包含多个源的内容。我自己也不知道这件事。我不确定您是否可以提供多个网络摄像头源。*您可以构建多个过滤器图,并同时启动/停止它们。*您可以通过修改AMCap或在GrapherEdit中构建过滤图来实现这一点。:)好的。。是否有任何特定的论坛可以提出这个问题?非常感谢你的帮助。。我真的很感激!我想你可以把它放在DirectShow论坛上,或者找一些DirectShow教程。嘿!在我明确附加了库文件之后,我终于能够构建它了!非常感谢你的帮助。。。。但现在我需要帮助!AMCap能够处理2个或多个网络摄像头,我如何修改程序以便同时使用它们…比如按下一个显示“开始捕获”的按钮并确保所有摄像头开始捕获,以及按下一个显示“停止捕获”的按钮停止所有摄像头。再次感谢!第一件事。我不是真正的DShow专家,所以我要说的可能是错误的。*每个网络摄像头都是一个源。*您可以使用DirectShow编辑服务构建包含多个源的内容。我自己也不知道这件事。我不确定您是否可以提供多个网络摄像头源。*您可以构建多个过滤器图,并同时启动/停止它们。*您可以通过修改AMCap或在GrapherEdit中构建过滤图来实现这一点。:)好的。。是否有任何特定的论坛可以提出这个问题?非常感谢你的帮助。。我真的很感激!我想你可以把它放在DirectShow论坛上,或者找一些DirectShow教程。