PJMEDIA-VideoDev

PJMEDIA Video Device API is PJMEDIA framework for cross-platform video device abstraction, with focus to video streaming applications.

API Reference

Supported devices

Supported capture devices:

Supported renderer devices:

The following devices are no longer supported:

Android Camera2

This is a capture device based on Android Camera2 framework. Support for this device is enabled automatically for Android build (reference: PJMEDIA_VIDEO_DEV_HAS_ANDROID=1 macro).

References:

AVI virtual device

Virtual camera device that reads video from AVI file, enabling streaming of AVI files.

AVFoundation (Mac and iOS) and UIView (iOS)

AVFoundation capture device is available on Mac OS X and iOS. UIView renderer is available on iOS. These devices are enabled automatically if PJMEDIA_HAS_VIDEO is set to 1 for Mac OS and iOS build.

Colorbar

A very basic virtual camera that outputs colorbar. Useful for initial porting to new platform.

DirectShow (Windows)

On Visual Studio, add this in config_site.h to enable it:

#define PJMEDIA_VIDEO_DEV_HAS_DSHOW  1

Experimental: with Mingw64, enable it with ./configure --enable-video=yes (see https://github.com/pjsip/pjproject/pull/2589).

FFMPEG

PJMEDIA uses FFMPEG to provide codecs and video capture device.

See Adding FFMPEG support.

OpenGL (desktops)/OpenGL ES 2 (Android, iOS)

The OpenGL renderer can be used wheverer OpenGL SDK is available (Windows, Mac OS X, Linux, and so on). The OpenGL ES is available on iOS and Android.

To enable OpenGL in the build, declare this in config_site.h:

#define PJMEDIA_VIDEO_DEV_HAS_OPENGL     1

In addition to above, declare these to use OpenGL ES:

#define PJMEDIA_VIDEO_DEV_HAS_OPENGL_ES  1

And add this for iOS:

#define PJMEDIA_VIDEO_DEV_HAS_IOS_OPENGL 1

References:

QuickTime

Note

Note that QuickTime has been deprecated in favor of AVFoundation framework. See AVFoundation (Mac and iOS) and UIView (iOS)

This device implement QT capture for Mac and capture and render devices for iOS.

References:

SDL

Quoting http://www.libsdl.org/ website:

Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D

In PJMEDIA, currently we use SDL as renderer device.

Adding SDL support

On Debian based distributions:

sudo apt-get install libsdl2-dev

For other systems, follow the instructions in http://www.libsdl.org/. Make sure headers and libraries are accessible in build search paths after installation.

Building PJPROJECT with SDL support

autoconf build system

With the configure script, SDL support can be detected and enabled automatically, or explicitly with --with-sdl=DIR option.

Notice the following output:

checking for sdl2-config... /usr/bin/sdl2-config
checking SDL availability... 2.0.10

Note that support can be explicitly disabled with --disable-sdl option.

Visual Studio

Declare this in config_site.h and rebuild:

#define PJMEDIA_VIDEO_DEV_HAS_SDL     1

Video4Linux

Adding Video4Linux support

On Debian based systems:

sudo apt-get install libv4l-dev

For other systems, find the appropriate instructions. Make sure headers and libraries are accessible in build search paths after installation.

Building PJPROJECT with V4L support

autoconf build system

With the configure script, support is detected and enabled automatically. Notice the following output:

checking for v4l2_open in -lv4l2... yes

Support for V4L can be disabled by explicitly specifying --disable-v4l2.