Author Topic: i need an USB cam which can be handled directly as /dev/video0  (Read 3027 times)

0 Members and 1 Guest are viewing this topic.

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
i need an USB cam which can be handled directly as /dev/video0
« on: November 16, 2014, 02:05:20 pm »
hi guyes
i 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 have

  • jpeg library do decode the CAM stream -> i need a raw data, not compressed, usb-cam
  • UAV dependent cam (which requires other libraries and support) -> i need a dummy char dev device, accessible as "file"

to examplify, i need something like this

Code: [Select]
#include <stdio.h>
#include <stdlib.h>
#define SIZE    307200 // number of pixels (640x480)
int main()
{
    FILE  *camera;
    FILE  *grab;
    float data[SIZE];
    long  len;

    camera = fopen("/dev/video0", "rb");
    if (camera != NULL)
    {
        grab = fopen("grab.raw", "wb");
        if (grab != NULL)
        {
            len = fread(data, sizeof(data[0]), SIZE, camera);
            fwrite(data, sizeof(data[0]), 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 directly


any suggestion/experience ?
 

Online coppice

  • Super Contributor
  • ***
  • Posts: 9565
  • Country: gb
Re: i need an USB cam which can be handled directly as /dev/video0
« Reply #1 on: November 16, 2014, 02:12:02 pm »
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.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: i need an USB cam which can be handled directly as /dev/video0
« Reply #2 on: November 16, 2014, 02:22:44 pm »
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.

too many dependencies, i have no space to accommodate all the libraries it needs
my rootfs is running in ram, must run in ram, ant i have 20Mbyte of space for the whole
in alternative, do you have an extreme-size-reduced application that uses uvcvideo ?
if so, which one ? any git/repo ?
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: i need an USB cam which can be handled directly as /dev/video0
« Reply #3 on: November 16, 2014, 02:25:08 pm »
about the kernel linux, this is the video4linux/uvcvideo documentation

 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: i need an USB cam which can be handled directly as /dev/video0
« Reply #4 on: November 16, 2014, 02:37:07 pm »
i know mjpg-streamer, which has been used with tiny router, like this, 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 libjpeg

any other application that can take a shot from an usb cam ? i need something very essential

p.s.
is it possible to configure the usb using a direct way ? i am reading the documentation … too bloody
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: i need an USB cam which can be handled directly as /dev/video0
« Reply #5 on: November 16, 2014, 08:36:36 pm »
this guy has my idea and unfortunately he got a jpeg camera :-/O
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: i need an USB cam which can be handled directly as /dev/video0
« Reply #6 on: November 16, 2014, 08:39:00 pm »
here it is the documentation of v4l-api
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: i need an USB cam which can be handled directly as /dev/video0
« Reply #7 on: November 16, 2014, 09:12:44 pm »
i have found these examples
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf