R
R
RoboSloNE2011-10-20 20:19:30
linux
RoboSloNE, 2011-10-20 20:19:30

Webcam from linux console (specifically archlinux) WITHOUT xserver?

Actually a subject.
Is it possible to take video/snapshot from webcam without using xserver from archlinux console?
The options with mplayer did not suit me, maybe I'm doing something wrong?
Is there any console utility for taking snapshots from a webcam?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Eddy_Em, 2011-10-26
@Eddy_Em

Yes, if you do not have a framebuffer configured, you can still watch:
mplayer tv:// -vo caca

B
bagyr, 2011-10-20
@bagyr

You can look at this: github.com/fsphil/fswebcam
In general, Google gives a lot of things for the v4l2 command line request.

E
Eddy_Em, 2011-10-26
@Eddy_Em

This is easily implemented even by mplayer'om, even mencoder'om, even ffmpeg'om.
For example, I use this script on a netbook:

#!/bin/sh
cd /tmp
mencoder tv:// -tv driver=v4l2:width=640:height=480:noaudio:outfmt=uyvy:fps=3 -ss 1 -endpos 1.5 -ovc copy -o 1.avi
mplayer 1.avi -vo jpeg
rm -rf 1.avi 00000001.jpg 00000002.jpg 00000003.jpg
cd ~/.screenshots
for num in `seq 8 -1 0`
do
    [ -f $num.jpg ] && mv $num.jpg $[ $num + 1 ].jpg
    [ -f $num-a.jpg ] && mv $num-a.jpg $[ $num + 1 ]-a.jpg
done
mv /tmp/00000005.jpg 0.jpg
mv /tmp/00000004.jpg 0-a.jpg

It does the following: first, we record 1.5s of video at a frequency of 3 frames per second (we get 5 frames); then we delete the first three (on them the webcam is adjusted to brightness, so they are usually unsuccessful); then the remaining 2 frames are saved in the directory with "screenshots" with the "rotation" of numbers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question