Problem capturing webcam (ESCAPI)

Hey guys,

I'm using ESPCAPI - https://github.com/jarikomppa/escapi to capture my webcam, but when I run the program it seems like either there is an initialisation error or it fails to find the devices.

I'm using MSVC 2017, but from what I have read is that all you need to do is include the escapi.cpp file into the project directory and that will take care of it for you but again as I said the if statement gets executed

anybody ever work with escapi have similar issues?

thanks

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

#include <iostream>
#include "escapi.h"

using namespace std;

int main() {

	int devices = setupESCAPI();
    
	if (devices == 0) {

		cout << "problem" << endl;
	}

	cout << "hiii" << endl;
	system("pause");
	return 0;
}
all you need to do is include the escapi.cpp file into the project directory and that will take care of it for you

this seems unlikely. You probably NEED to add the .cpp file to the project, though I could have missed something. Maybe everything in the folder is pulled in now?

but it ran, so clearly it found *something*.
I would try to debug it and step into setupESCAPI to see what is going on. Or read the docs on that function, to see what can cause it to return 0.
Last edited on
I stepped into the setupESCAPI() function in my program, and the it seems as it is returning NULL therefore returning, probably meaning it can't find the dll.

1
2
3
4
 HMODULE capdll = LoadLibraryA("escapi.dll");
  if (capdll == NULL)
    return 0;


the escapi.dll is placed in the same folder as the project, I'm not sure if this is a relative path? also I tried adding the full path but the same result :/
if there is a dll, there should (or may?) also be a .lib ... if you have a .lib, add THAT to your project.
Last edited on
no .lib files needed as far as I know.

I hardcoded the path to the dll into the escapi.cpp ( full path ) and seemed to work, although strange that it doesn't work with a relative path :/
Last edited on
Print the working directory of your program by doing system("cd");.
Place whatever file is needed to be loaded in that folder. Then relative paths should work.
Topic archived. No new replies allowed.