我正在一個iPhone應用程序內和Xcode 4.3.3和OpenCV 2.4cvCreateFileCapture總是返回「NULL」
我使用了「cvCreateFileCapture(」 simtom.mp4「)」擺脫」的MP4' 文件框但不幸的是,cvCreateFileCapture()總是返回「NULL」。
什麼問題?
這是我的源代碼。
CvCapture *m_pMusicVideo;
m_pMusicVideo = cvCreateFileCapture("simtom.mp4");
我搬到了 「simtom.mp4」 路徑 「/用戶/ 1w1w /庫/開發商/ Xcode中/ DerivedData/ARDemo-hiarxwwvdhkhsceukxohkbyxxguy /編譯/產品/調試-的iPhoneOS /」 然而cvCreateFileCapture()仍然返回NULL。 我該如何解決這個cvCreateFileCapture()問題? – user1553247 2012-08-03 19:40:08
哦。我看到你編輯的答案。所以我知道我的「simtom.mp4」不在「Bundle Resources」中。然後我在「Bundle Resources」中添加了我的「simtom.mp4」。所以我正確地檢查了我的「simtom.mp4」是「Bundle Resources」。但是我的cvCreateFileCapture()仍然返回NULL。 我在我的「Bundle資源」中明確添加了「simtom.mp4」。 所以我猜opencv 2.4可能有一些問題來處理'.mp4'文件。你知道關於opencv 2.4中cvCreateFileCapture()的內容嗎? – user1553247 2012-08-04 02:20:24
無法用'cvCreateFileCapture(「simtom.mp4」)打開它;'.mp4文件與包中的可執行文件不在同一文件夾中。您需要預先安裝文件路徑。這就是'[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@「simtom.mp4」];'是for。 – SSteve 2012-08-04 16:19:37