About 8-12 months ago I wrote a script that pulled together several mplayer commands to perform various activities. One allowed me to press the s-key to take snapshots with my webcam. Useful for recording the sensors I build.
Now it:
vd=0
bash-4.1$ TV1="-tv driver=v4l2:device=/dev/video${vd}:width=320:height=240"
bash-4.1$ TV2="norm=NTSC:chanlist=us-cable:input=0:noaudio:outfmt=i420"
bash-4.1$ OUT="-fps 30 -cache 128"
bash-4.1$ PIC="-hue 0 -brightness 0 -contrast 0 -saturation 0 -aspect 4:3"
bash-4.1$ mplayer tv:// $TV1:$TV2 $OUT $PIC -vf screenshot -vo xv,x11
no longer works under Slackware 13.37 and mplayer (phonon-mplayer-20101213-i486-1).
I scanned the web for working commands and what I found also does not work:
1) mplayer tv:// -tv driver=v4l2:width=640:height=480:outfmt=rgb24:device=/dev/video0 -fps 15 -vo png
2) mplayer tv:// -tv driver=v4l2:device=/dev/video0 -vo png:z=9 -frames 1
3) mplayer -vo png -frames 1 tv://
4) mplayer tv:// -vf-pre pp=hb:a/vb:a/dr:a/al:a,hqdn3d -tv driver=v4l2:device=/dev/video0:width=640:height=480:noaudio
Most yielded:
tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
v4l2: ioctl enum norm failed: Invalid argument
Error: Cannot set norm!
Selected input hasn't got a tuner!
v4l2: Cannot get fps
v4l2: ioctl set mute failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
Cannot find codec matching selected -vo and video format 0x31384142.
My initial command produces:
v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
Selected device: SN9C1xx PC Camera
Capabilities: video capture read/write streaming
supported norms:
inputs: 0 = Camera;
Current input: 0
Current format: unknown (0x31384142)
tv.c: norm_from_string(NTSC): Bogus norm parameter, setting default.
v4l2: ioctl enum norm failed: Invalid argument
Error: Cannot set norm!
Selected input hasn't got a tuner!
v4l2: Cannot get fps
v4l2: ioctl set mute failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
Opening video filter: [screenshot]
==========================================================================
Cannot find codec matching selected -vo and video format 0x31384142.
==========================================================================
v4l2: select timeout
v4l2: ioctl set mute failed: Invalid argument
v4l2: 0 frames successfully processed, 1 frames dropped.
for vd=1 as well.
I am currently using Slackware 13.37. Under 13.0 there was a problem of /dev/video0 and /dev/video1 getting assignments exchanged on different boots. Since the webcam should not have a tuner that error is suspicious.
The video format 0x31384142 is not one which I have seen before. The inability to set norm to NTSC and getting fps is also questioned.
Anyone see a failing? Suggestions & comments welcomed.