Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18
Dear all, I am very desperate in learning how to actually write a code to capture video output from an external camera which is connected to a video card MSMG104+ ...
  1. #1
    Just Joined!
    Join Date
    Aug 2008
    Posts
    14

    How to write code to capture video from analog video?

    Dear all,

    I am very desperate in learning how to actually write a code to capture video output from an external camera which is connected to a video card MSMG104+ to my PC. How do I start about writing a code to capture the video output from this camera to my screen in Linux OS. I am using netbeans 6.1 IDE.

    I have written code to get laser data, ultrasonic data and now, the camera is something new to me. How do I go about writing code to obtain the video from the camera and output to my PC via coding?

    I might need to code for more than 2 cameras in the near future. So meanwhile, i would really appreciate if someone can show me some light on how to go about with it. I have read countless threads, being to countless forums... I just couldn't get anything out of those.. I really hope someone around here can help.

    I have got a normal camera as well. So.... please.... help me..... =0(

    Thanks and best regards
    LE81

  2. #2
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    You will want to use Video for Linux Video4Linux - Wikipedia, the free encyclopedia.
    Debian GNU/Linux -- You know you want it.

  3. #3
    Linux User peteh's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    337
    Are you wanting to view the camera output on-screen or capture it to the hard disk?
    I use Kdetv tuned in to the video source channel to view and ffmpeg to capture and convert.
    If you download ffmpeg from your repository and read the man pages it's fairly straightforward.
    Come back with queries if you have any once you get started.
    Pete

  4. #4
    Just Joined!
    Join Date
    Aug 2008
    Posts
    14
    Dear both,

    I manage to find some source code which I integrate them together to form a project in Netbeans 6.1 IDE. I compiled and tried to troubleshoot along the way.

    The weird thing is I received these error:

    /root/NetBeansProjects/Video_Dev01/display.c:114: undefined reference to `XShmCreateImage'
    /root/NetBeansProjects/Video_Dev01/display.c:140: undefined reference to `XShmAttach'
    /root/NetBeansProjects/Video_Dev01/display.c:150: undefined reference to `XCreateImage'
    /root/NetBeansProjects/Video_Dev01/display.c:167: undefined reference to `XSync'
    build/Debug/GNU-Linux-x86/display.o: In function `_vlDestroyImage':
    /root/NetBeansProjects/Video_Dev01/display.c:184: undefined reference to `XShmDetach'
    build/Debug/GNU-Linux-x86/display.o: In function `_vlSetWindowSize':
    /root/NetBeansProjects/Video_Dev01/display.c:235: undefined reference to `XSetNormalHints'
    /root/NetBeansProjects/Video_Dev01/display.c:236: undefined reference to `XResizeWindow'
    build/Debug/GNU-Linux-x86/display.o: In function `_vlDisplayImage':
    /root/NetBeansProjects/Video_Dev01/display.c:367: undefined reference to `XShmPutImage'
    /root/NetBeansProjects/Video_Dev01/display.c:371: undefined reference to `XPutImage'
    /root/NetBeansProjects/Video_Dev01/display.c:376: undefined reference to `XSync'
    build/Debug/GNU-Linux-x86/display.o: In function `vlDisplayInit':
    /root/NetBeansProjects/Video_Dev01/display.c:435: undefined reference to `XOpenDisplay'
    /root/NetBeansProjects/Video_Dev01/display.c:451: undefined reference to `XGetVisualInfo'
    /root/NetBeansProjects/Video_Dev01/display.c:467: undefined reference to `XFree'
    /root/NetBeansProjects/Video_Dev01/display.c:488: undefined reference to `XCreateColormap'
    /root/NetBeansProjects/Video_Dev01/display.c:499: undefined reference to `XCreateWindow'
    /root/NetBeansProjects/Video_Dev01/display.c:517: undefined reference to `XStoreName'
    /root/NetBeansProjects/Video_Dev01/display.c:518: undefined reference to `XSetIconName'
    /root/NetBeansProjects/Video_Dev01/display.c:521: undefined reference to `XMapWindow'
    /root/NetBeansProjects/Video_Dev01/display.c:524: undefined reference to `XSelectInput'
    /root/NetBeansProjects/Video_Dev01/display.c:527: undefined reference to `XCreateGC'
    build/Debug/GNU-Linux-x86/display.o: In function `vlDisplayShutdown':
    /root/NetBeansProjects/Video_Dev01/display.c:568: undefined reference to `XFreeGC'
    /root/NetBeansProjects/Video_Dev01/display.c:569: undefined reference to `XUnmapWindow'
    /root/NetBeansProjects/Video_Dev01/display.c:570: undefined reference to `XDestroyWindow'
    build/Debug/GNU-Linux-x86/display.o: In function `vlEvent':
    /root/NetBeansProjects/Video_Dev01/display.c:711: undefined reference to `XEventsQueued'
    build/Debug/GNU-Linux-x86/display.o: In function `vlButtonPress':
    /root/NetBeansProjects/Video_Dev01/display.c:729: undefined reference to `XCheckMaskEvent'
    /root/NetBeansProjects/Video_Dev01/display.c:730: undefined reference to `XPutBackEvent'
    build/Debug/GNU-Linux-x86/display.o: In function `vlGetPoint':
    /root/NetBeansProjects/Video_Dev01/display.c:769: undefined reference to `XNextEvent'
    build/Debug/GNU-Linux-x86/display.o: In function `vlGetRect':
    /root/NetBeansProjects/Video_Dev01/display.c:808: undefined reference to `XNextEvent'
    /root/NetBeansProjects/Video_Dev01/display.c:817: undefined reference to `XNextEvent'

    What I noticed is that all these so-called "undefined reference", I have included my code with the following header file:

    #include <stdio.h>
    #include <malloc.h>
    #include </usr/include/X11/Xlib.h>
    #include </usr/include/X11/Intrinsic.h>
    #include </usr/include/X11/StringDefs.h>
    #include </usr/include/X11/keysym.h>
    #include <sys/ipc.h>
    #include <sys/shm.h>
    #include </usr/include/X11/extensions/XShm.h>
    #include <signal.h> /* signal */
    #include <stdlib.h>

    #include "vislib.h"

    I checked and found that the "undefined reference" can actually be found in the "#include </usr/include/X11/extensions/XShm.h>" header. Anyone, please enlighten me where went wrong?

    I am now a desperado.... =0(

    Thanks and best regards
    LE81

  5. #5
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    It is the linker who complains, not the compiler.
    You need to link in the proper libraries to your executable.
    Debian GNU/Linux -- You know you want it.

  6. #6
    Just Joined!
    Join Date
    Aug 2008
    Posts
    14
    Hi,
    Thanks for the advice on my linking error, managed to resolve that. However. when i tried to run my program, the error I got this time while running was:

    "vlGrabInit: ioctl(METEORSETGEO): Inappropriate ioctl device
    vlInit: error: unable to initialise framegrabber"

    What went wrong?

    Please enlighten me.... A million thanks

    Thanks and best regards
    LE81

  7. #7
    Just Joined!
    Join Date
    Aug 2008
    Posts
    14
    Anyone out there? Any clues? Please.... help me.... =0(

    Thanks and best regards
    LE81

  8. #8
    Just Joined!
    Join Date
    Aug 2008
    Posts
    14
    Sorry to sound irritating here, but I am really lost. Basically, I am using a MSMG104+ video card. I type dmesg in the command prompt and it tells me that
    bttv0: using ******unknown/device******* card=0 found.

    However I can't seems to run my camera with this card. It cannot capture anything. Please help me... really appreciate it...

    Thanks and best regards
    LE81

  9. #9
    Just Joined!
    Join Date
    Aug 2008
    Posts
    14
    I shall restate my problem and hopefully some kind soul can help me out on this.

    Basically, I am using a BT878 chipset for frame grabber, which is written as frame grabber V2.0. I am not sure if my understanding is correct, that's why I am here to ask for advice on how to start.

    The video card I am using is MSMG104+ and I have got a 12V DC powered camera with a video signal feed into this board.

    How do I actually write a proper source code to extra the video image from my camera?

    I have read countless and tried countless method to get them up but it seemed fruitless.

    Please help, need the help really very badly...

    A million thanks.

    Best regards
    LE81

  10. #10
    Linux User peteh's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    337
    Have you tried ffmpeg yet?
    I've done several analog vhs video tapes with it. It picks up from your tv input and converts to most digital formats. Read the man pages. I'm no expert but got it working pretty well.
    Pete

Page 1 of 2 1 2 LastLast

Posting Permissions

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