Main Page | Report this Page
 
   
Linux Forum Index  »  Linux Development - Applications  »  Display captured data from usb camera in real time...
Page 1 of 1    
Author Message
...
Posted: Tue Aug 12, 2008 11:34 pm
Guest
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
Josef Moellers...
Posted: Wed Aug 13, 2008 4:45 am
Guest
rgagarrett at (no spam) gmail.com wrote:
Quote:
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
Bernhard Agthe...
Posted: Wed Aug 13, 2008 8:00 am
Guest
Hi,

Quote:
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....
Jasen Betts...
Posted: Thu Aug 14, 2008 2:50 am
Guest
On 2008-08-13, rgagarrett at (no spam) gmail.com <rgagarrett at (no spam) gmail.com> wrote:
Quote:
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 Smile ("vlc media player")

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

Quote:
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...

Quote:
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
 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Sat Nov 22, 2008 11:18 am