i need an USB cam which can be handled directly as /dev/video0 - Page 1
Forum section: electronics / general

author: legacy
author_rank: Super Contributor
timestamp: November 16, 2014, 02:05:20 pm
content: hi guyesi am developing an embedded application which has reduced size of rootfs, i have 20Mbyte of space an i can't use mjpeg_stream (plus its dependencies) in order to access the USB-camera; i need a dummy device which can be accessed directly by /dev/video0 without any need to havejpeg library do decode the CAM stream -> i need a raw data, not compressed, usb-camUAV dependent cam (which requires other libraries and support) -> i need a dummy char dev device, accessible as "file"to examplify, i need something like thisCode:#include <stdio.h>#include <stdlib.h>#define SIZE 307200 // number of pixels (640x480)int main(){FILE *camera;FILE *grab;float data;long len;camera = fopen("/dev/video0", "rb");if (camera != NULL){grab = fopen("grab.raw", "wb");if (grab != NULL){len = fread(data, sizeof(data), SIZE, camera);fwrite(data, sizeof(data), SIZE, grab);fclose(grab);if (len == 0){printf("camera has no data\n");}else{printf("camera has %lu data\n", len);}}fclose(camera);}else{printf("no camera device\n");}return 0;}actually i have a pair of Microsoft Corp. LifeCam HD-3000, it supported by linux but it does not seem to be possible to access and handle it directlyany suggestion/experience ?

author: coppice
author_rank: Super Contributor
timestamp: November 16, 2014, 02:12:02 pm
content: How could a camera work in as simple way as you wish? It needs some interaction to configure it. What's wrong with using the usual Linux video APIs? They aren't hard to work with, and there is adequate sample code to get you started.

author: legacy
author_rank: Super Contributor
timestamp: November 16, 2014, 02:22:44 pm
content: Quote from: coppice on November 16, 2014, 02:12:02 pmtoo many dependencies, i have no space to accommodate all the libraries it needsmy rootfs is running in ram, must run in ram, ant i have 20Mbyte of space for the wholein alternative, do you have an extreme-size-reduced application that uses uvcvideo ?if so, which one ? any git/repo ?

author: legacy
author_rank: Super Contributor
timestamp: November 16, 2014, 02:25:08 pm
content: about the kernel linux, this is thevideo4linux/uvcvideodocumentation

author: legacy
author_rank: Super Contributor
timestamp: November 16, 2014, 02:37:07 pm
content: i knowmjpg-streamer, which has been used with tiny router, likethis, unfortunately i have to use uclibc and i have issues in order to support this application, also i do not want any compressed stream, i need a bitmap, and i can't support the libjpegany other application that can take a shot from an usb cam ? i need something very essentialp.s.is it possible to configure the usb using a direct way ? i am reading the documentation … too bloody

author: legacy
author_rank: Super Contributor
timestamp: November 16, 2014, 08:36:36 pm
content: thisguy has my idea and unfortunately he got a jpeg camera

author: legacy
author_rank: Super Contributor
timestamp: November 16, 2014, 08:39:00 pm
content: here it is the documentation ofv4l-api

author: legacy
author_rank: Super Contributor
timestamp: November 16, 2014, 09:12:44 pm
content: i have foundtheseexamples