i am using opencv for android in my project. But when i called method cvCreateFileCapture(), it always return NULL. I know this method needs codecs when working in Windows or Linux, So what can i do when i port this method to Android? Is FFMPEG working? How can i build opencv4android that using FFMPEG to decode the input video file? Thanks.
these are my codes:
//Retrieve data from Java, and construct needed structures or instances
char* filePath = (char*)env->GetStringUTFChars(aviPath, false);
int result=-1;
LOGD(filePath);
CvCapture* pCvCapture = cvCreateFileCapture( filePath );
//pCvCpature always NULL
if( NULL == pCvCapture)
{
result = -100;
}
else
{
cvReleaseCapture( &pCvCapture );
result = 100;
}
env->ReleaseStringUTFChars(aviPath, filePath);
return (jint)result;