Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    problem with USB camera based on Video4Linux

    hi,everyone i got a troublesome issue.My camera's chip is OV511 and i use some ioctl() Functions to print the following informations about it.such as:

    type=513,channels=1,maxwidth=640,maxheight:480,min width:64,minheight: 48
    palette=10 /* YUV420 format*/
    chromakey=0,clipcount=0,width: 320,height: 240
    VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */

    i grabbed one frame image successfully by using mmap case and throw it to frambuffer which i'd mmapped.Then this image display on screen immediately but just in black and white colour.All the parameters when calling ioctl() Functions such ioctl(vd->fd, VIDIOCGCAP, &(vd->capability),ioctl(vd->fd, VIDIOCGPICT, &(vd->picture),etc haven't been changed while using the default only.I guess the datas throwed to frambuffer should be conveted into RGB format.if it's true how can i do that?Anyone has some useful Function so i can do it easily? I need you help and i'm appreciate.Thanks a lot.

  2. #2
    Linux Newbie dilbert's Avatar
    Join Date
    Sep 2006
    Lima, Peru
    At first, if I understand your post aright, then you should probabably have better posted this in an application section as the hardware of this peripheral seems to work perfectly.

    Where are you using those ioctl functions? I presume in a self-written or modified application program or do those ioctls pop up in a GUI program?

    Don't you get that frame as a file onto the disks of your computer where you could apply all sorts of programs to that file containing the frame?
    Bus Error: Passengers dumped. Hech gap yo'q.

  3. #3
    Thank you for reply above all,i show those head files in my program.
    #include <unistd.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <stdio.h>
    #include <sys/ioctl.h>
    #include <stdlib.h>

    #include <linux/types.h>
    #include <linux/videodev.h>
    #include <linux/mman.h>
    #include <linux/fb.h>
    all ioctl() functions i used is just from above files.After I grabbed one frame image,i can save it into a iamge file or display it directly on screen by frambuffer.But it's just black and white only anyway,that's the point.

    Well i'll adopt your suggestion to post in Application section,and thank you again.

  4. $spacer_open
  5. #4
    Linux Newbie dilbert's Avatar
    Join Date
    Sep 2006
    Lima, Peru
    I guess when you copy the image file from the camera file system onto your computer's file system and it is already b/w then maybe it's a configuration of the camera itself.

    Because a simple file copy is highly unlikely than it changes the contents of the image file.

    But if you "grab" as you say the file already with your program then it might copy AND modify it, not at the same time, but in one go, as a sequential process. In that case one of your arguments in one of those ioctl calls might not be the right one.
    Bus Error: Passengers dumped. Hech gap yo'q.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts