Display captured data from usb camera in real time - Linux

This is a discussion on Display captured data from usb camera in real time - Linux ; Hi, I'm hoping this the correct group for my enquiry... I'm using a USB camera (Sentech C83) with Linux and I'd like to display the images from the camera on the screen in real time. I've got a driver that ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Display captured data from usb camera in real time

  1. Display captured data from usb camera in real time

    Hi,
    I'm hoping this the correct group for my enquiry...

    I'm using a USB camera (Sentech C83) with Linux and I'd like to
    display the images from the camera on the screen in real time. I've
    got a driver that uses v4l to get the data, and I've got some C code
    that can take this raw data from the driver. From here, I can save
    the raw data to disk and that works fine. How do I display this data
    on the screen instead? I believe that it should be possible to write
    it directly to the video buffer, but I've never done that before and
    frankly I'm not sure where to start! My searching on google hasn't
    given any promising leads yet, can anyone here help? Also of use
    would be a way to use C to convert the data to suitable format for
    storing (jpeg for still images, some form of compressed AVI for the
    moving images).

    Thanks in advance,
    Rob

  2. Re: Display captured data from usb camera in real time

    rgagarrett@gmail.com wrote:
    > Hi,
    > I'm hoping this the correct group for my enquiry...
    >
    > I'm using a USB camera (Sentech C83) with Linux and I'd like to
    > display the images from the camera on the screen in real time. I've
    > got a driver that uses v4l to get the data, and I've got some C code
    > that can take this raw data from the driver. From here, I can save
    > the raw data to disk and that works fine. How do I display this data
    > on the screen instead? I believe that it should be possible to write
    > it directly to the video buffer, but I've never done that before and
    > frankly I'm not sure where to start! My searching on google hasn't
    > given any promising leads yet, can anyone here help? Also of use
    > would be a way to use C to convert the data to suitable format for
    > storing (jpeg for still images, some form of compressed AVI for the
    > moving images).


    There are a number of utilities that already do this. E.g. I use
    camstream when I play with my camera. It can do "real-time" display as
    well as (repeated) snapshots.
    You could try and get the source of one of these utilities and see how
    they do it.
    --
    These are my personal views and not those of Fujitsu Siemens Computers!
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize (T. Pratchett)
    Company Details: http://www.fujitsu-siemens.com/imprint.html

  3. Re: Display captured data from usb camera in real time

    Hi,

    > I'm using a USB camera (Sentech C83) with Linux and I'd like to

    [...]

    If you get compressed data, you need to find out how to decompress it
    first - I do remember older cameras giving corrupt MJPEG data and the like.

    To display raw pictures on the screen in (near-) real-time, have a look
    at libSDL (Simple Direct Layer; get it from your distribution's install
    server/CD). This one was designed for game development and brings all
    the blitting, overlay... functions you need. The C interface is very
    well designed and easy to understand. It also brings some code to
    decompress images, probably just what you need anyway.

    good luck....


  4. Re: Display captured data from usb camera in real time


    On 2008-08-13, rgagarrett@gmail.com wrote:
    > Hi,
    > I'm hoping this the correct group for my enquiry...
    >
    > I'm using a USB camera (Sentech C83) with Linux and I'd like to
    > display the images from the camera on the screen in real time. I've
    > got a driver that uses v4l to get the data, and I've got some C code
    > that can take this raw data from the driver. From here, I can save
    > the raw data to disk and that works fine. How do I display this data
    > on the screen instead?


    I would use vlc ("vlc media player")

    It does all that, (and most of what you describe below)

    > I believe that it should be possible to write
    > it directly to the video buffer, but I've never done that before and
    > frankly I'm not sure where to start!


    libsvga, framebuffer, or X?
    with X you really shouldn't be doing direct writes (unless you're
    writing a X server) libsvga and framebuffer give you access to the
    video memory but are incompatible with X.

    look at the vlc source it handles all of the above...

    > My searching on google hasn't
    > given any promising leads yet, can anyone here help? Also of use
    > would be a way to use C to convert the data to suitable format for
    > storing (jpeg for still images, some form of compressed AVI for the
    > moving images).


    for stills libjpeg-dev (or the libjpeg source)

    avi is a container class it can contain many sorts of compressed stream
    variants include mjpeg (for which much of the jpeg stuff can be reused)
    and a whole swag of others (including mpeg2 and mpeg4...) again look at
    the mplayer and vlc source.

    Bye.
    Jasen

+ Reply to Thread