gabrield/v4l-lua
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
v4l-lua is a small library binding V4L2 CAMERA API to Lua.
See the example "capture.lua" to see how easy is to capture from V4L2 cameras :D
To compile v4l-lua, you'll need the v4lconvert and Lua development files.
WARNING: THIS LIBRARY STILL IS IN ALPHA STAGE! Plese, report bugs ;)
Usage:
local v4l = require 'v4l'
dev = v4l.open(device_name, width, height)
-- opens a v4l camera, where: device_name is usually '/dev/video0', and the
-- optional params width and height can be used to suggest a resolution,
-- although a similar one may be chosen...
array = dev:getframe()
-- returns a table with the rgb values for the pixels from left to right
-- top to bottom, in other words the the pixel (x,y) will appear at
-- array[c + 3 * (x + y * dev:width())], assuming (0,0) to be the
-- top left corner, and c=1 for red, c=2 for green and c=3 for blue.
str = dev:getframestr()
-- similar to getframe, but the values will be returned via a string
-- instead of a table; you can use the string.byte for fast access.
w = dev:width() -- return effective width
h = dev:height() -- and effective height
fd = dev:fd() -- file descriptor number, if you need it for concurrent I/O with other files
dev:close() -- closes the camera freeing any resources
About
v4l-lua small library binding V4L2 CAMERA API to Lua.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published