{"id":20400076,"url":"https://github.com/codebrainz/libfg2","last_synced_at":"2025-04-12T13:50:56.833Z","repository":{"id":1190082,"uuid":"1093684","full_name":"codebrainz/libfg2","owner":"codebrainz","description":"Simple Linux video capture library.","archived":false,"fork":false,"pushed_at":"2017-05-16T07:07:22.000Z","size":298,"stargazers_count":7,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T08:23:30.599Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codebrainz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-11-19T03:29:20.000Z","updated_at":"2023-02-07T14:03:29.000Z","dependencies_parsed_at":"2022-07-06T11:21:22.625Z","dependency_job_id":null,"html_url":"https://github.com/codebrainz/libfg2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Flibfg2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Flibfg2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Flibfg2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Flibfg2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codebrainz","download_url":"https://codeload.github.com/codebrainz/libfg2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248575647,"owners_count":21127225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T04:38:20.122Z","updated_at":"2025-04-12T13:50:56.811Z","avatar_url":"https://github.com/codebrainz.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"libfg2 - Simple Linux Video Capture Library\n===========================================\n\nIntroduction\n------------\n\nLibfg2 is a C library which provides access to video input devices such \nas frame grabber cards, webcams, and TV tuner devices under kernels \nwhich support Video4Linux2.  Using the excellent libv4l library, libfg2 \nprovides access to most devices, independent of which pixel formats \nthey use.\n\nThe library began with me hacking on the libfg library to support the \nVideo4Linux2 API.  I just started going through each function modifying \neach one to work with V4L2, renaming a few things along the way, and \nLibfg2 is the result.\n\nExample\n-------\n\nHere's a minimal example of use:\n\n```c\n#include \u003clibfg2.h\u003e\n\nint main(int argc, char *argv[])\n{\n\n    /* get name of video device or default */\n    char *device = (argc\u003e1) ? argv[1] : \"/dev/video0\";\n\n    /* get name of snapshot file or default */\n    char *snap_file = (argc\u003e2) ? argv[2] : \"snapshot.jpg\";\n\n    /* open and initialize the fg_grabber */\n    fg_grabber *fg = fg_open(device);\n\n    /* allocate a new fg_frame and fill it with data */\n    fg_frame *fr = fg_grab(fg);\n\n    /* save the fg_frame as a JPEG */\n    fg_frame_save(fr, snap_file);\n\n    /* free memory for fg_frame */\n    fg_frame_release(fr);\n\n    /* free memory for fg_grabber and close device */\n    fg_close(fg);\n\n    return 0;\n}\n```\n\nYou can compile the example using:\n\n    gcc `pkg-config --cflags --libs libfg2` -o example example.c\n\nBuilding and Installing\n-----------------------\n\nTo checkout, build and install libfg2 you'll need to do the following:\n\n    $ git clone git://github.com/codebrainz/libfg2.git\n    $ cd libfg2\n    $ ./autogen.sh\n    $ ./configure [options] # use --help to see options\n    $ make\n    $ make install # possibly as root\n\nDependencies\n------------\n\nLibfg2 has two dependencies, one required and one option.\n\n### Required\n\n* [LibV4L](http://people.atrpms.net/~hdegoede)\n\n### Optional\n\nOnly required for saving frames to file.\n\n* [JPEG Library](http://ijg.org)\n\nSee `./configure --help` for more information on configuring the library.\n\nUsing Ubuntu, both dependencies can be installed using the following \ncommand (only tested on Ubuntu 16.04):\n\n    $ sudo apt-get install libv4l-dev libjpeg-dev\n\nOther distributions should have equivalent packages available.\n\nDocumentation\n-------------\n\nTo generate API documentation in HTML, LaTeX, and Manpage formats:\n\n    $ cd doc\n    $ make\n\nTo generate API documentation in PDF format, use above commands then:\n\n    $ cd reference/latex\n    $ make pdf\n\nTo generate the documentation, you will need \n[Doxygen](http://www.stack.nl/~dimitri/doxygen).  Eventually the \ndocumentation generation will be integrated into the Autotools build \nsystem and available online.\n\nLicense\n-------\n\nLibfg2 is licensed under the\n[GNU Lesser General Public License](https://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html),\nsee the\n[COPYING.md file](https://github.com/codebrainz/libfg2/blob/master/COPYING).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebrainz%2Flibfg2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodebrainz%2Flibfg2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebrainz%2Flibfg2/lists"}