{"id":18794875,"url":"https://github.com/acerv/camera_acquisition","last_synced_at":"2026-04-26T16:32:40.544Z","repository":{"id":122919129,"uuid":"54129928","full_name":"acerv/camera_acquisition","owner":"acerv","description":"Camera acquisition library","archived":false,"fork":false,"pushed_at":"2016-11-27T07:18:49.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-21T16:49:36.728Z","etag":null,"topics":["camera","camera-acquisition","linux","v4l2"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acerv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-17T15:34:42.000Z","updated_at":"2016-03-17T15:45:41.000Z","dependencies_parsed_at":"2024-07-24T12:34:12.418Z","dependency_job_id":null,"html_url":"https://github.com/acerv/camera_acquisition","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/acerv/camera_acquisition","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acerv%2Fcamera_acquisition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acerv%2Fcamera_acquisition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acerv%2Fcamera_acquisition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acerv%2Fcamera_acquisition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acerv","download_url":"https://codeload.github.com/acerv/camera_acquisition/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acerv%2Fcamera_acquisition/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32305035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["camera","camera-acquisition","linux","v4l2"],"created_at":"2024-11-07T21:31:29.916Z","updated_at":"2026-04-26T16:32:40.513Z","avatar_url":"https://github.com/acerv.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Camera acquisition library\n\n[![Build Status](https://travis-ci.org/acerv/camera_acquisition.svg?branch=master)](https://travis-ci.org/acerv/camera_acquisition)\n\n## Introduction\nThis is a library that I wrote to play with CMOS cameras such as the Imaging Source DFK72BUC02 that I own.\nFor now, the program only supports Linux (using Video4Linux library and mmap method), but in the future the goal is to port\nthe code on Windows as well.\n\n## Usage\nThe example provides a tester, which can be compiled using make. The tester help is the following:\n```\nUsage: ./tester [options]\n\nVersion 1.0\nOptions:\n-h | --help          Print this message\n-d | --device name   Video device name [default: /dev/video0]\n-f | --format name   The acquisition format rgb32, uyvy, yuyv, jmpeg, grey [default: rgb32]\n-c | --counts num    The number of frames to acquire [default: 5]\n-w | --width  num    The horizontal resolution [default: 1024]\n-v | --height num    The vertical resolution [default: 768]\n```\n\n## Tests in Linux\nTo know what resolutions and formats can be supported by the camera in Linux, use the v4l2-ctl tool.\nThe Imaging Source DFK72BUC02 camera has been tested with the Raspberry Pi 3 device and, according with the \nv4l2-ctl tools, the supported resolutions and format are the following:\n* Resolutions:  1296x1944, 1024x768\n* Formats:      UYVY, YUYV\n\nThis is weird, since it's possible to acquire RGB32 data with 2592x1944 resolution.. \n\n## Introduction to the Video4Linux2 library\n### From v4l2 documentation (Streaming I/O Memory Mapping chap.3 documentation):\n    Streaming is an I/O method where only pointers to buffers are exchanged between application and driver, the data\n    itself is not copied. Memory mapping is primarily intended to map buffers in device memory into the application's\n    address space. Device memory can be, for example, the video memory on a graphics card with a video capture add-on.\n    However, being the most efficient I/O method available for a long time, many other drivers support streaming as\n    well, allocating buffers in DMA-able main memory.\n\n### How the streaming buffer works:\n    There are two buffer queues: the incoming queue and the outgoing queue. The incoming queue is the one that contains \n    buffers from user space which must be filled during frames acquisition. When a buffer is filled, it's removed from \n    the incoming queue and moved in the outgoing queue. At this point, the buffer can be read at user space.\n\n### ioctl commands explanation:\n    VIDIOC_QUERYCAP: it asks for device capabilities\n    VIDIOC_S_FMT: it sets the acquisition format\n    VIDIOC_REQBUFS: it selects the acquisition method and it sets the number of buffers to acquire.\n                    If requested method is not supported, ioctl returns -1 value.\n    VIDIOC_QUERYBUF: this command is used to know the acquisition buffer's registers.\n                    After the command execution, the v4l2_buffer will contain the \"m.offset\" and \"m.length\" values,\n                    which can be used to access the memory space with the mmap() routine.\n                    NOTE: the buffer is always stored in the physical memory and it can't be swapped. So, call\n                    munmap() to release the resources as soon as possible.\n    VIDIOC_QBUF/VIDIOC_DQBUF: queue and dequeue a buffer in the input queue of the device.\n                    Use VIDIOC_QBUF to enqueue a buffer, then use VIDIOC_DQBUF when the buffer is filled.\n                    By using VIDIOC_QUERYBUF command, it's possible to know the status of a buffer in any time.\n    VIDIOC_STREAMON/VIDIOC_STREAMOFF: these routines start/stop the streaming communication with the device\n\n### v4l2_capability flags:\n    V4L2_CAP_READWRITE: flag that indicates if device supports read() or write() operations. If I/O is supported,\n                        then select() and poll() must be supported as well\n    V4L2_CAP_STREAMING: flag that indicates if device supports userptr or mmap methods\n\n### v4l2_buffer flags:\n    V4L2_BUF_FLAG_MAPPED: the buffer resides in the device memory and it has been mapped in the user space addresses\n    V4L2_BUF_FLAG_QUEUED: the buffer is queued in the incoming queue\n    V4L2_BUF_FLAG_DONE: the buffer has been moved in the outgoing queue and it has been filled\n    V4L2_BUF_FLAG_ERROR: the buffer is correctly acquired, but data can be corrupted\n\n## Userful Links\n\n* http://www.theimagingsource.com/en_US/products/cameras/usb-ccd-color/dfk72buc02/\n* http://linuxtv.org/downloads/v4l-dvb-apis/buffer.html#v4l2-buffer\n* http://linuxtv.org/downloads/v4l-dvb-apis/mmap.html\n* https://github.com/torvalds/linux/blob/master/include/uapi/linux/videodev2.h\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facerv%2Fcamera_acquisition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facerv%2Fcamera_acquisition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facerv%2Fcamera_acquisition/lists"}