是否有适用于 video4linux2 设备的 CLI 网络摄像头图像采集器?

Joh*_*ero 10 video webcam

我已经尝试了一切

apt-cache search webcam |sort -u
Run Code Online (Sandbox Code Playgroud)

一切都有问题。纠正任何语法错误,展示如何使用 CLI 中的“仅 GUI”或一个好的 ffmpeg/mencoder/vlc one-liner 将回答我的问题。或者因为我知道如何让 ffmpeg 取一个短的 MJPEG,展示如何剥离第一个 jpeg 会起作用,我猜。不过,这应该比那更直接。

$ camgrab
/dev/video0: no v4l device
Run Code Online (Sandbox Code Playgroud)

(camgrab 可能不处理 v4l2)

$ fswebcam --list-inputs
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
--- Available inputs:
0: Camera 1
No input was specified, using the first.
Adjusting resolution from 384x288 to 352x288.
--- Capturing frame...
Premature end of JPEG file
Captured frame in 0.00 seconds.
--- Processing captured image...
There are unsaved changes to the image.
$ fswebcam --input 0 boo.jpg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.jjjjjjjjj
Adjusting resolution from 384x288 to 352x288.
--- Capturing frame...
Premature end of JPEG file
Captured frame in 0.00 seconds.
--- Processing captured image...
Writing JPEG image to 'boo.jpg'.
Run Code Online (Sandbox Code Playgroud)

产生这个

$ motion
Run Code Online (Sandbox Code Playgroud)

超出了我。

$ uvccapture -oboo.jpg 
$ file boo.jpg        
boo.jpg: data
$ qiv -t boo.jpg 
Unable to read file: Failed to load image 'boo.jpg': Error interpreting JPEG image file (Not a JPEG file: starts with 0x8f 0x5a)
Run Code Online (Sandbox Code Playgroud)

不是真正的图像。

$ /usr/bin/vgrabbj -d /dev/video0 -f boo.jpg
Could not open configfile /usr/etc/vgrabbj.conf, ignoring
Reading image from /dev/video0
Run Code Online (Sandbox Code Playgroud)

产生这个

$ webcamd
RTFM, missing template (/home/$USER/.webcamd/index_up.html)
$ man webcamd |cat
WEBCAMD(1)                                                                     WEBCAMD(1)
NAME
    webcamd - Take a image from your webcam
SYNOPSIS
    webcamd [ start | stop | refresh ]
DESCRIPTION
    This manual page documents briefly the webcamd daemon.
    This manual page was written for the Debian distribution because the original pro?
    gram does not have a manual page.
    webcamd is a program that take images from your webcam and put it on a ftp  server
    on a local (web) directory
OPTIONS
    start  Start the daemon.
    stop   Stop the daemon.
    refresh Take a shot !
AUTHOR
    This  manual  page  was  written by Julien Danjou <acid@debian.org> for the Debian
    system (but may be used by others).  Permission is  granted  to  copy,  distribute
    and/or modify this document under the terms of the GNU Free Documentation License,
    Version 1.1 or any later version published by the Free Software  Foundation;  with
    no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts.
                                  2002 april 21                            WEBCAMD(1)
$ webcamd start
RTFM, missing template (/home/$USER/.webcamd/index_up.html)
$ webcamd refresh
RTFM, missing template (/home/$USER/.webcamd/index_up.html)
Run Code Online (Sandbox Code Playgroud)

网络摄像头似乎要求我在某处设置一个配置文件来 ftp 图像,并且默认情况下似乎什么都不做

$ /usr/bin/webcam 
reading config file: /home/$USER/.webcamrc
video4linux webcam v1.5 - (c) 1998-2002 Gerd Knorr
grabber config:
  size 320x240 [none]
  input (null), norm (null), jpeg quality 75
  rotate=0, top=0, left=0, bottom=240, right=320
Run Code Online (Sandbox Code Playgroud)
  • 仅图形用户界面
    • 迷彩
    • 起司
    • 卡莫索
    • 卢克维

Rob*_*ans 9

这里

Streamer

Streamer (http://linux.bytesex.org/xawtv/) is a versatile program that allows a
capture from a webcam or video device using only the command line. It may be offered 
in your Linux distribution's Xawtv package. To install streamer try

# sudo apt-get install xawtv

To take a standard JPEG picture from the command line where the camera is accessed 
through /dev/video0:

#streamer -c /dev/video0 -b 16 -o outfile.jpeg

Where > -b is the number of colors (in bpp,whether 15, 16, 24 or 32)
& -o is the output filename in the current directory

If you are going to capture multiple images be sure to append the output file name 
with zeros, as streamer can name the capture files in sequence, i.e., -o 
outfile000.jpeg becomes outfile001.jpeg, outfile002.jpeg, and so on.  
Run Code Online (Sandbox Code Playgroud)

来自评论:流光不包含在 xawtv 包中, sudo apt-get install streamer