GithubHelp home page GithubHelp logo

jmhobbs / libvcvideo Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 180 KB

A super-simple video device library.

Home Page: http://static.velvetcache.org/projects/libvcvideo/doc/active/

License: GNU General Public License v3.0

C++ 100.00%

libvcvideo's Introduction

What is it?

libvcvideo is targeted as a super-simple cross platform video device library. It's starting with the most basic features and building up, all while keeping a simple API and strong documentation for beginners.

Currently only select devices are supported and it is in pre-release condition. It only has compatibility with webcam devices that use the original V4L specifications and output RGB24 data. This is actually a very large set of devices, as that is the generic description for most spca5xx and gspca devices. This is limited because that is the only type of device I posses at this time, more will be added as I can find devices or the time to research them.

Additionally, libvcvideo has plugin based effects support and a small sample of effects are included with the install.

Though incomplete, if you have the right device it is super simple. Counting variable declaration you only need four lines of library code to get a frame from a camera, as the basic example shows below.

Brief Example

#include <iostream>
using std::cerr;
using std::endl;
#include <string>
using std::string;

#include <libvcvideo/videoDevice.h>

int main (int argc, char ** argv) {
	vc::videoDevice device ("/dev/video0");
	vc::vdFrame frame;

	try {
		device.init();
	}
	catch(string s) {
		cerr << "Device initialization failed: " << s << endl;
		exit(1);
	}

	try {
		device.getFrame(frame);
	}
	catch(string s) {
		cout << "Failed to get frame: " << s << endl;
		exit(1);
	}
}

That has error checking in it, but you could strip it down to nine lines...

Really, Really Brief Example

#include <string>
using std::string;
#include <libvcvideo/videoDevice.h>
int main (int argc, char ** argv) {
	vc::videoDevice device ("/dev/video0");
	vc::vdFrame frame;
	device.init();
	device.getFrame(frame);
}

Documentation

Get it at http://static.velvetcache.org/projects/libvcvideo/doc/active/

Dependencies

  • A modern kernel with V4L.
  • A compatible video device.
  • glib (for effects, need gmodule)
  • libsigc++ (optional)
  • libmagick++ (optional, for example programs)
  • gtkmm (optional, for example programs)

Compilation

To compile a program, use the following flags:

  • Compile Flags: -I/usr/include/libvcvideo
  • Linker Flags: -lvcvideo pkg-config gmodule-2.0 --libs

If using effects, you need these in additional flags.

  • Compile Flags: pkg-config gmodule-2.0 --cflags

Lastly, if your version was compiled with libsigc++ you need this flag:

  • Compile Flags: -DSIGCPP

Credits

This library would not exist without the wonderful documentation of V4L2

And the mediocre documentation of V4L :-)

I was also inspired through the use of OpenCV

libvcvideo's People

Contributors

jmhobbs avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.