• Stars
    star
    177
  • Rank 208,676 (Top 5 %)
  • Language
    C++
  • License
    The Unlicense
  • Created over 8 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Extremely Simple Capture API (ESCAPI) - simple webcam API for windows

ESCAPI

Extremely Simple Capture API

Copyright (c)2015 Jari Komppa http://iki.fi/sol

Binaries

Binaries available at http://iki.fi/sol/zip/escapi3.zip

Usage

Add escapi.cpp to your project. This file contains code to load the escapi.dll. See the samples ('simplest' recommended) for API usage.

Rust Bindings Usage

Just add the crate in your project and start using it. NOTE: make sure that Windows SDK and Media Foundation headers are accessible for your Rust toolchain, otherwise the library build will fail (i.e. it should work fine with MSVC toolchain and it might require some changes if you're using mingw toolchain).

License

ESCAPI is released under the unlicense. In short, use for any purpose as long as you don't hold me responsible for anything. It would be nice if you'd toss me a mail if you play with this thing.

Some examples use external libraries with different licenses.

What is ESCAPI?

A fairly easy to use webcam (or other video input device) capture API.

Version 2.0 adds support for multiple capture devices and requesting the capture device names, as well as new examples.

Version 2.1 updates the examples, including purebasic and blizmax examples, as well as an OpenGL based 'funny mirrors'-example, and fills out the top 8 "alpha" bits in the captured data with 0xff.

Version 3.0 is complete rewrite using windows media foundation instead of directshow. The version adds interface for playing with camera properties, new examples, automatic camera resolution selection, 64 bit builds, and source release. Version 3.0 onwards requires windows vista or later (7, 8, 8.1, 10..).

Motivation

One of the last things that I added to 'textmedia' was webcam support. I got interested in webcams for a while, thinking I might whip up some kind of "eye toy"-ish game using a web cam.

One of the bad sides about webcams is that the programming API is so complicated - the only way to use them back then was through DirectShow. Simply getting data from the camera is a fairly complicated process, while not giving you much control.

So, to get rid of the directmedia SDK requirement, I split the required code into a separate DLL, and now I present to you the ESCAPI:

  • setupESCAPI - Initialize the whole library. (in escapi.cpp)
  • countCaptureDevices - Request number of capture devices available.
  • getCaptureDeviceName - Request the printable name of a capture device.
  • initCapture - Tries to open the video capture device. Returns 0 on failure, 1 on success.
  • doCapture - Requests a video frame to be captured.
  • isCaptureDone - Returns 1 when the requested frame has been captured.
  • deinitCapture - Closes the video capture device.

So basically, you call setup to initialize the library, call init to start the capture device, and call doCapture to start the capture process. When the capture is done, you can ask for another frame. Etc.

Unfortunately, "eye toy"-wise, the webcams on PCs are quite laggy, and this varies from a camera to the next. My logitech messenger camera has a lag or about one second, while my creative instant camera is has a more tolerable lag. Both cameras also perform some automatic contrast trickery and other stuff like that which won't be quite game-friendly.

Thus, I never ended up doing that "eye toy"-like game. Maybe one day =)

Dependencies

Some of the examples use external libraries:

More Repositories

1

soloud

Free, easy, portable audio engine for games
C
1,617
star
2

proctree

Procedural tree mesh generator (and editor)
C
190
star
3

ipc

Public domain single header inter process communication primitives
C
122
star
4

emu8051

8051/8052 emulator with curses-based UI
C
102
star
5

atanua

Atanua Real-Time Logic Simulator
C
102
star
6

sassy

Sassy Audio Spreadsheet
C
92
star
7

dxwrapper

DirectX 1-7 wrapper project for making old games run on new hardware
C++
78
star
8

img2spec

Image Spectrumizer - convert RGB images into zx spectrum -friendly data
C++
76
star
9

speccy

zx spectrum development tools
C
61
star
10

specnext

Collection of my projects for zx spectrum next
C
43
star
11

shadertoolkit

A toolkit of public domain single-header libraries for shader-based opengl apps
C
39
star
12

covert_action

Sid Meier's Covert Action (1990) modding tools
C
19
star
13

textgl

Software rendered GL subset for text mode demos
C++
18
star
14

spriterotator

non-destructive sprite rotator
C
16
star
15

lfac

LFAC - Low Fidelity Audio Codec
C++
14
star
16

physfs_magicstream

PhysFS fork with magic streams
C
12
star
17

d3

DialogTree (d3) game dialogue engine
C++
9
star
18

adventofcode2021

Advent of code 2021 framework, c/c++
C++
8
star
19

munray

MunRay - a raytracer with no redeeming value
C++
8
star
20

solvbe

Universal VESA VBE 1.2 emulator for windows XP (and later) command prompt
C++
7
star
21

tiefighter-ddwrapper

DirectDraw wrapper for Star Wars - TIE Fighter (1998)
C++
6
star
22

interjector

C code instrumenting tool
C++
6
star
23

litterae_finis

Text mode demo "Litterae Finis" (2013) source code
C++
6
star
24

2dglbasecode

Sol's 2d GL basecode
C
4
star
25

dmlitefix

Hack to make the Alesis DM Lite drumkit usable with VSTs.
C++
3
star
26

nextfli

ZX Spectrum Next specific animation encoder (autodesk flic inspired)
C
3
star
27

zak

Zak file format, for register dump-based music (mos 6581sid, mos 8580 sid, ay-3-8910, ym2149f, etc)
C++
3
star
28

cfl

Compressed File Library, a doom wad-like virtual filesystem for games
C++
2
star
29

lcov-latex

LaTeX output from LCOV
Perl
2
star
30

wordchain

Word chain generator, analyses word chain probabilities in text and generates new text randomly
C++
2
star