The Still Capture Library is a set of functions that allows C/C++ developers to add still capture from webcams, DV camcorders and other cameras to their applications in just a few lines of code. The library is based on the DirectShow API but all the complexity is invisible to the developer.

The library is composed of the include file (scapi.h), the library files (scapi32.lib and scapi64.lib) to link to your modules, the redistributable library (scapi32.dll and scapi64.dll), the sample source codes in C++, binaries and some test applications.

The library also include stillcap.exe, a console application that allows you to easily make still captures from a script, an application, a command prompt, the Task Scheduler, etc.

Download Purchase soon

Version 1.4 - 1.5 MB

The download is a free trial version with some limitations. See the Terms of Service for details.

Key Features

  • Complete Device & Capability Management
    The library includes everything needed to interact cleanly with any connected webcam: initialization and cleanup routines, device enumeration, supported resolution discovery, and full access to device capabilities. It also exposes all standard camera controls—UVC properties, CameraControl options, and VideoProcAmp settings—allowing fine-tuned configuration of exposure, focus, brightness, and more.
  • Flexible Preview & Video Routing
    You can manage the live video preview with precise control over position, visibility, and pause state. The library also handles video input routing through crossbar management, making it easy to select the correct source when working with multi-input capture devices.
  • Reliable Still Capture & Output Options
    Stills can be captured through either software triggers or hardware-based triggers when available. Captured frames can be saved directly to a file, copied to the clipboard, retrieved as an HBITMAP handle, or obtained as a packed Device-Independent Bitmap (DIB), offering maximum flexibility for downstream processing.
  • Robust Error & Event Handling
    The library provides meaningful error messages, handles plug-and-play events to react correctly to device connections or removals, and includes crossbar input selection functionality to simplify dynamic source changes.

Still Capture API

The current version of the library implements the following functions:

Still Capture API
HRESULT SCAPI StillCapInitialize(PHSCSESSION phSession, DWORD dwFlags, UINT *pcDevices);
HRESULT SCAPI StillCapUninitialize(HSCSESSION hSession);
HRESULT SCAPI StillCapEnableDeviceChangeNotifications(HSCSESSION hSession, HWND hWnd);
HRESULT SCAPI StillCapDeviceChange(HSCSESSION hSession, UINT nEventType, DWORD_PTR dwData);
HRESULT SCAPI StillCapGetDeviceCount(HSCSESSION hSession, UINT *pcDevices);
HRESULT SCAPI StillCapFindDeviceA(HSCSESSION hSession, LPCSTR pszDeviceName, BOOL bPartial, UINT *pnIndex);
HRESULT SCAPI StillCapFindDeviceW(HSCSESSION hSession, LPCWSTR pwszDeviceName, BOOL bPartial, UINT *pnIndex);
HRESULT SCAPI StillCapGetDeviceNameA(HSCSESSION hSession, UINT nDevice, LPSTR pszName, DWORD dwSize);
HRESULT SCAPI StillCapGetDeviceNameW(HSCSESSION hSession, UINT nDevice, LPWSTR pwszName, DWORD dwSize);
HRESULT SCAPI StillCapGetDeviceCaps(HSCSESSION hSession, UINT nDevice, LPDWORD pdwCaps);
HRESULT SCAPI StillCapGetDeviceResolutions(HSCSESSION hSession, UINT nDevice, DWORD dwFlags, PSTILL_DEVICE_RESOLUTIONS pResolutions, LPDWORD pdwSize);
HRESULT SCAPI StillCapOpenDevice(HSCSESSION hSession, UINT nDevice, PSTILL_DEVICE_PARAMETERS pParameters, PHSCDEVICE phDevice);
HRESULT SCAPI StillCapGetDeviceIndex(HSCDEVICE hDevice, UINT *pnIndex);
HRESULT SCAPI StillCapCloseDevice(HSCDEVICE hDevice);
HRESULT SCAPI StillCapGetDeviceProperty(HSCDEVICE hDevice, LONG lProperty, PSTILL_DEVICE_PROPERTY pProperty);
HRESULT SCAPI StillCapSetDeviceProperty(HSCDEVICE hDevice, LONG lProperty, LONG lValue, LONG lFlags);
HRESULT SCAPI StillCapGetCaptureCaps(HSCDEVICE hDevice, LPDWORD pdwCaps);
HRESULT SCAPI StillCapFlipCapture(HSCDEVICE hDevice, DWORD dwFlags);
HRESULT SCAPI StillCapSetPreviewPosition(HSCDEVICE hDevice, LPCRECT lpRect);
HRESULT SCAPI StillCapShowPreview(HSCDEVICE hDevice, BOOL bShow);
HRESULT SCAPI StillCapPausePreview(HSCDEVICE hDevice, BOOL bPause);
HRESULT SCAPI StillCapIsPreviewPaused(HSCDEVICE hDevice);
HRESULT SCAPI StillCapGetInputCount(HSCDEVICE hDevice, LONG *pcInputs);
HRESULT SCAPI StillCapGetInputNameA(HSCDEVICE hDevice, LONG lInput, LPSTR pszName, DWORD dwSize);
HRESULT SCAPI StillCapGetInputNameW(HSCDEVICE hDevice, LONG lInput, LPWSTR pwszName, DWORD dwSize);
HRESULT SCAPI StillCapSetInput(HSCDEVICE hDevice, LONG lInput);
HRESULT SCAPI StillCapTrigger(HSCDEVICE hDevice);
HRESULT SCAPI StillCapWaitForTrigger(HSCDEVICE hDevice);
HRESULT SCAPI StillCapGetSample(HSCDEVICE hDevice, HBITMAP* phSample);
HRESULT SCAPI StillCapGetSampleAsDIB(HSCDEVICE hDevice, HGLOBAL* phDIB);
HRESULT SCAPI StillCapSaveSampleToFileA(HSCDEVICE hDevice, LPCSTR pszFileName, LONG lQuality);
HRESULT SCAPI StillCapSaveSampleToFileW(HSCDEVICE hDevice, LPCWSTR pwszFileName, LONG lQuality);
HRESULT SCAPI StillCapSaveBitmapToFileA(HBITMAP hBitmap, LPCSTR pszFileName, LONG lQuality, BOOL bAutoDelete);
HRESULT SCAPI StillCapSaveBitmapToFileW(HBITMAP hBitmap, LPCWSTR pwszFileName, LONG lQuality, BOOL bAutoDelete);
HRESULT SCAPI StillCapCopySampleToClipboard(HSCDEVICE hDevice);
HRESULT SCAPI StillCapCopyBitmapToClipboard(HBITMAP hBitmap);
HRESULT SCAPI StillCapGetBitmapFromClipboard(HBITMAP *phBitmap);
HRESULT SCAPI StillCapGetUvcProperty(HSCDEVICE hDevice, REFGUID propSetId, DWORD dwPropertyId, BYTE* pData, DWORD dwSize);
HRESULT SCAPI StillCapSetUvcProperty(HSCDEVICE hDevice, REFGUID propSetId, DWORD dwPropertyId, BYTE* pData, DWORD dwSize);
HRESULT SCAPI StillCapGetErrorA(HRESULT hr, LPSTR pszError, DWORD dwSize);
HRESULT SCAPI StillCapGetErrorW(HRESULT hr, LPWSTR pwszError, DWORD dwSize);
HRESULT SCAPI StillCapSubtypeToStringA(REFGUID rSubType, BOOL bFourCC, LPSTR pszSubType, DWORD dwSize);
HRESULT SCAPI StillCapSubtypeToStringW(REFGUID rSubType, BOOL bFourCC, LPWSTR pwszSubType, DWORD dwSize);
HRESULT SCAPI StillCapPlaySound();

Please refer to the provided sample source codes and the whole scapi.h header for reference. All the functions return S_OK (or possibly S_FALSE) when they succeed. Use the StillCapGetError function to retrieve the error message if a function fails.

Examples

Default location: %ProgramFiles%\Noël Danjou\Still Capture Library\Samples (or %ProgramFiles(x86)%\Noël Danjou\Still Capture Library\Samples on x64 systems).

DemoCap

A console application that introduces all the functions of the library. Open the DemoCap.cpp file for more information.

DlgCap

A dialog-based application that shows how to use the library in a graphical user interface and how to manage live video preview and Plug-and-Play notifications.

MultiCap

A console application that shows how to capture a serie of still images and also measures capture and processing times.

Notes

  • The provided sample source codes are written in C++ and require Microsoft Visual Studio 2010 or later.
  • It is highly recommended to keep all the examples untouched and copy their source codes to a folder of your choice to compile and modify them.
  • All the functions of this trial version of the Still Capture library are fully functional, the only limitation is that the captured pictures are watermarked.

Getting Started

The DemoCap sample source code introduces all the supported functions of the library but you don't have to write as much code to acquire one or more still images in your own programs. Acquiring a still image using the library only requires 6 easy steps as shown in the code snippet below.

// 1 - Configure dependencies
#include <scapi.h>

#if defined(_WIN64)
	#pragma comment(lib, "scapi64.lib")
#else
	#pragma comment(lib, "scapi32.lib")
#endif

// 2 - Initialize the library
HSCSESSION hSession = NULL;
HRESULT hr = StillCapInitialize(&hSession, 0, NULL);

if (hr == S_OK)
{
	// 3 - Open the capture device
	HSCDEVICE hDevice = NULL;
	STILL_DEVICE_PARAMETERS params;
	ZeroMemory(params, sizeof(STILL_DEVICE_PARAMETERS));
	params.lWidth = 640; // Standard resolution, 640x480 @ 25fps
	params.lHeight = 480;
	params.lFramerate = 25;

	hr = StillCapOpenDevice(hSession, 0, &params, &hDevice); // Use first device

	if (hr == S_OK)
	{
		// 4 - Acquire a still image
		HBITMAP hSample = NULL;
		hr = StillCapGetSample(hDevice, FALSE, &hSample);

		if (hr == S_OK)
		{
			// Use sample here then delete it
			DeleteObject(hSample);
		}

		// 5 - Close the capture device
		StillCapCloseDevice(hDevice);
	}

    // 6 - Uninitialize the library
    StillCapUninitialize(hSession);
}

Additionally, you have to specify the paths to the header file (Include) and to the library files (Lib) in your Visual Studio project before you can compile your program. To do so:

  • Right-click your project in Solution Explorer
  • Click Properties in the context-menu
  • Expand Configuration Properties > C++ > General
  • Type the path to the Include folder in Additional Include Directories
  • Expand Configuration Properties > Linker > General
  • Type the path to the Lib folder in Additional Library Directories
  • Click OK.