You can look at ztk-v4l-video-bloger/recorder for an example. You really need to find out what type of camera you will be using first. Old NTSC , and Pal cameras need different handling than the newer USB cameras. There are also IP cameras, which are probably the most useful.

From my experience, the apps "mencoder" and "mplayer" are your best bets. They are available on Windows. If you are on linux, you may have to use a usb microphone to get recording, you can google for setting up alsa for a usb microphone recording session. See USB_mic_on_linux

Here is a simple mencoder string for a usb mic, listed as hw2 in the usb list. Linux hasn't good support for built-in mikes yet. :-( So your built-in mic is hw 1) Google for more mencoder examples. If you want to see how to control mplayer and mencoder from Perl with IPC::Open3, see ztk-v4l-video-bloger/recorder

mencoder tv:// -tv \ driver=v4l2:device=/dev/video0:width=320:height=240:adevice=/dev/dsp:f +orceaudio:alsa:adevice=hw.2,0 \ -ofps 15 -oac mp3lame -lameopts cbr:br=32 -ovc lavc -lavcopts \ vbitrate=92 -o ./out-low-quality.avi # You can change framerate up to 25, video bitrate to 800 # and sound bitrate to 128 or greater to get excellent quality.

#########################################

and here is a simple snapshot app.... just press "s"

############################################

mplayer -vf screenshot tv:// driver=v4l2:width=800:height=600:device=/ +dev/video0 -fps 15 # and that gave me 800x600 video, and after I pressed 's' i obtained 8 +00x600 in the snapshot. # q to quit # I did the same for 1024x768, 1280x1024, and 1600x1200 and obtained a + 1024x768, # 1280x1024, and 1600x1200 video and snapshot respectively. # or get shots from a video # mplayer -vf screenshot some.avi

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

In reply to Re: control webcam by zentara
in thread control webcam by xiaoyafeng

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.