Failed to set video format: Invalid argument VIDIOCGMBUF
Posted: Mon Jan 11, 2010 5:54 am
zmc exit status 255[error in zm_local_camera.cpp ] this issue fixed, new problem in reply post
zmc exited abnormally, exit status 255,Error in LocalCamera::Initialise() in DEBUG log
native uvcvideo drive seems works fine, I can use mplayer to view and mencoder to record.
DEBUG mode, messages are different when using V4L1/V4L2.
[V4L1 to captrure]
[V4L2 to captrure]
zmu works only at V4L V1.
v4lctl show the detail error message, that caused by ioctl: VIDIOC_G_STD
Some zm error messages
My webcam not support above v4l set operation.
mplayer seems notice these ioctl fail errors and try to fixed it following get/set way. And can I modify ZM to act this way?
mplayer/stream/tvi_v4l2.c [mlayer source code]
zmc exited abnormally, exit status 255,Error in LocalCamera::Initialise() in DEBUG log
native uvcvideo drive seems works fine, I can use mplayer to view and mencoder to record.
Code: Select all
mplayer -fps 15 tv:// -tv driver=v4l2:device=/dev/video0
mencoder tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -nosound -ovc lavc -o wcrecording.avi [driver=v4l1 not work]
Code: Select all
01/08/2010 14:22:44.069577 zmdc[20697].INF [Starting pending process, zmc -d /dev/video]
01/08/2010 14:22:44.074258 zmdc[20697].INF ['zmc -d /dev/video' starting at 10/01/08 14:22:44, pid = 28157]
01/08/2010 14:22:44.159869 zmdc[20697].ERR ['zmc -d /dev/video' exited abnormally, exit status 255]
[V4L1 to captrure]
Code: Select all
01/08/10 14:22:44.102250 zmc_dvideo[28157].INF-zm_debug.c/292 [New Debug Level = 4, New Debug Log = /tmp/zm_debug.log]
01/08/10 14:22:44.103669 zmc_dvideo[28157].DB1-zm_monitor.cpp/1712 [Got 1 monitors]
01/08/10 14:22:44.103898 zmc_dvideo[28157].DB2-zm_local_camera.cpp/286 [V4L2 support enabled, using V4L1 api]
01/08/10 14:22:44.104177 zmc_dvideo[28157].DB1-zm_monitor.cpp/338 [monitor purpose=1]
01/08/10 14:22:44.104242 zmc_dvideo[28157].DB1-zm_monitor.cpp/345 [mem.size=769192]
01/08/10 14:22:44.106260 zmc_dvideo[28157].DB1-zm_zone.cpp/50 [Initialised zone 0/All - 1 - 160x120 - Rgb:ff0000, CM:3, MnAT:15, MxAT:0, MnAP:50, MxAP:75000, FB:3x3, MnFP:50, MxFP:50000, MnBS:10, MxBS:0, MnB:0, MxB:0, OF: 0]
01/08/10 14:22:44.107180 zmc_dvideo[28157].DB1-zm_monitor.cpp/458 [Monitor Home has function 2]
01/08/10 14:22:44.107241 zmc_dvideo[28157].DB1-zm_monitor.cpp/459 [Monitor Home LBF = '%N - %y/%m/%d %H:%M:%S', LBX = 0, LBY = 0]
01/08/10 14:22:44.107285 zmc_dvideo[28157].DB1-zm_monitor.cpp/460 [Monitor Home IBC = 40, WUC = 25, pEC = 10, PEC = 10, EAF = 1, FRI = 1000, RBP = 7, FM = 0]
01/08/10 14:22:44.108264 zmc_dvideo[28157].DB1-zm_zone.cpp/889 [Got 1 zones for monitor Home]
01/08/10 14:22:44.108370 zmc_dvideo[28157].DB3-zm_zone.cpp/758 [Parsing polygon string '0,0 159,0 159,119 0,119']
01/08/10 14:22:44.108434 zmc_dvideo[28157].DB3-zm_zone.cpp/796 [Got coordinate 0,0 from polygon string]
01/08/10 14:22:44.108473 zmc_dvideo[28157].DB3-zm_zone.cpp/796 [Got coordinate 159,0 from polygon string]
01/08/10 14:22:44.108502 zmc_dvideo[28157].DB3-zm_zone.cpp/796 [Got coordinate 159,119 from polygon string]
01/08/10 14:22:44.108529 zmc_dvideo[28157].DB3-zm_zone.cpp/796 [Got coordinate 0,119 from polygon string]
01/08/10 14:22:44.108566 zmc_dvideo[28157].DB3-zm_zone.cpp/816 [Successfully parsed polygon string]
01/08/10 14:22:44.108604 zmc_dvideo[28157].DB1-zm_zone.cpp/50 [Initialised zone 1/All - 1 - 160x120 - Rgb:ff0000, CM:3, MnAT:25, MxAT:0, MnAP:576, MxAP:14400, FB:3x3, MnFP:576, MxFP:14400, MnBS:384, MxBS:0, MnB:1, MxB:0, OF: 0]
01/08/10 14:22:44.109449 zmc_dvideo[28157].DB1-zm_monitor.cpp/1814 [Loaded monitor 1(Home), 1 zones]
01/08/10 14:22:44.109519 zmc_dvideo[28157].INF-zmc.cpp/188 [Starting Capture]
01/08/10 14:22:44.109744 zmc_dvideo[28157].DB3-zm_local_camera.cpp/349 [Opening video device /dev/video]
01/08/10 14:22:44.109857 zmc_dvideo[28157].DB2-zm_local_camera.cpp/355 [V4L2 support enabled, using V4L1 api]
01/08/10 14:22:44.109900 zmc_dvideo[28157].DB3-zm_local_camera.cpp/502 [Configuring picture attributes]
01/08/10 14:22:44.131478 zmc_dvideo[28157].DB4-zm_local_camera.cpp/509 [Old P:0]
01/08/10 14:22:44.131564 zmc_dvideo[28157].DB4-zm_local_camera.cpp/510 [Old D:0]
01/08/10 14:22:44.131594 zmc_dvideo[28157].DB4-zm_local_camera.cpp/511 [Old B:32768]
01/08/10 14:22:44.131619 zmc_dvideo[28157].DB4-zm_local_camera.cpp/512 [Old h:32768]
01/08/10 14:22:44.131656 zmc_dvideo[28157].DB4-zm_local_camera.cpp/513 [Old Cl:20695]
01/08/10 14:22:44.131694 zmc_dvideo[28157].DB4-zm_local_camera.cpp/514 [Old Cn:31710]
01/08/10 14:22:44.156522 zmc_dvideo[28157].ERR-zm_local_camera.cpp/546 [Failed to set picture attributes: Invalid argument]
Code: Select all
01/08/10 13:38:47.120380 zmc_dvideo[27699].INF-zm_debug.c/292 [New Debug Level = 4, New Debug Log = /tmp/zm_debug.log]
01/08/10 13:38:47.122409 zmc_dvideo[27699].DB1-zm_monitor.cpp/1712 [Got 1 monitors]
01/08/10 13:38:47.122651 zmc_dvideo[27699].DB2-zm_local_camera.cpp/286 [V4L2 support enabled, using V4L2 api]
01/08/10 13:38:47.122930 zmc_dvideo[27699].DB1-zm_monitor.cpp/338 [monitor purpose=1]
01/08/10 13:38:47.122990 zmc_dvideo[27699].DB1-zm_monitor.cpp/345 [mem.size=769192]
01/08/10 13:38:47.125067 zmc_dvideo[27699].DB1-zm_zone.cpp/50 [Initialised zone 0/All - 1 - 160x120 - Rgb:ff0000, CM:3, MnAT:15, MxAT:0, MnAP:50, MxAP: 75000, FB:3x3, MnFP:50, MxFP:50000, MnBS:10, MxBS:0, MnB:0, MxB:0, OF: 0]
01/08/10 13:38:47.126114 zmc_dvideo[27699].DB1-zm_monitor.cpp/458 [Monitor Home has function 2]
01/08/10 13:38:47.126184 zmc_dvideo[27699].DB1-zm_monitor.cpp/459 [Monitor Home LBF = '%N - %y/%m/%d %H:%M:%S', LBX = 0, LBY = 0]
01/08/10 13:38:47.126233 zmc_dvideo[27699].DB1-zm_monitor.cpp/460 [Monitor Home IBC = 40, WUC = 25, pEC = 10, PEC = 10, EAF = 1, FRI = 1000, RBP = 7, FM = 0]
01/08/10 13:38:47.127858 zmc_dvideo[27699].DB1-zm_zone.cpp/889 [Got 1 zones for monitor Home]
01/08/10 13:38:47.127961 zmc_dvideo[27699].DB3-zm_zone.cpp/758 [Parsing polygon string '0,0 159,0 159,119 0,119']
01/08/10 13:38:47.128047 zmc_dvideo[27699].DB3-zm_zone.cpp/796 [Got coordinate 0,0 from polygon string]
01/08/10 13:38:47.128093 zmc_dvideo[27699].DB3-zm_zone.cpp/796 [Got coordinate 159,0 from polygon string]
01/08/10 13:38:47.128130 zmc_dvideo[27699].DB3-zm_zone.cpp/796 [Got coordinate 159,119 from polygon string]
01/08/10 13:38:47.128167 zmc_dvideo[27699].DB3-zm_zone.cpp/796 [Got coordinate 0,119 from polygon string]
01/08/10 13:38:47.128213 zmc_dvideo[27699].DB3-zm_zone.cpp/816 [Successfully parsed polygon string]
01/08/10 13:38:47.128257 zmc_dvideo[27699].DB1-zm_zone.cpp/50 [Initialised zone 1/All - 1 - 160x120 - Rgb:ff0000, CM:3, MnAT:25, MxAT:0, MnAP:576, MxAP: 14400, FB:3x3, MnFP:576, MxFP:14400, MnBS:384, MxBS:0, MnB:1, MxB:0, OF: 0]
01/08/10 13:38:47.129094 zmc_dvideo[27699].DB1-zm_monitor.cpp/1814 [Loaded monitor 1(Home), 1 zones]
01/08/10 13:38:47.129166 zmc_dvideo[27699].INF-zmc.cpp/188 [Starting Capture]
01/08/10 13:38:47.129818 zmc_dvideo[27699].DB3-zm_local_camera.cpp/349 [Opening video device /dev/video]
01/08/10 13:38:47.129949 zmc_dvideo[27699].DB2-zm_local_camera.cpp/355 [V4L2 support enabled, using V4L2 api]
01/08/10 13:38:47.129995 zmc_dvideo[27699].DB3-zm_local_camera.cpp/360 [Checking video device capabilities]
01/08/10 13:38:47.130107 zmc_dvideo[27699].DB3-zm_local_camera.cpp/370 [Setting up video format]
01/08/10 13:38:47.130216 zmc_dvideo[27699].FAT-zm_local_camera.cpp/386 [Failed to set video format: Invalid argument]
Code: Select all
[root@CentOS1 ~]# /usr/bin/zmu -d /dev/video0 -q -v
Error, failed to query crop /dev/video0: Invalid argument
[root@CentOS1 ~]# /usr/bin/zmu -d /dev/video0 -V 1 -q -v
Video Device: /dev/video0
Video Capabilities
Name: Saturn USB 2.0 Camera.
Type: 1
Can capture
Video Channels: 1
Audio Channels: 0
Maximum Width: 640
Maximum Height: 480
Minimum Width: 48
Minimum Height: 32
Window Attributes
X Offset: 0
Y Offset: 0
Width: 320
Height: 240
Picture Attributes
Palette: 0 - Unknown
Colour Depth: 0
Brightness: 32768
Hue: 32768
Colour :20695
Contrast: 31710
Whiteness: 43690
Channel 0 Attributes
Name: Camera 1
Channel: 0
Flags: 0
Type: 2 - Camera
Format: 0 - PAL
[root@CentOS1 ~]# /usr/bin/zmu -d /dev/video0 -V 2 -q -v
Error, failed to query crop /dev/video0: Invalid argument
Code: Select all
[root@CentOS1 ~]# v4lctl -c /dev/video0 list
ioctl: VIDIOC_G_STD(std=0x18c4b0bfa49978 [PAL_H,PAL_I,PAL_D,PAL_D1,PAL_M,PAL_60,NTSC_M,?,SECAM_G,SECAM_K1,?ATSC_8_VSB,ATSC_16_VSB,(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null)]): Invalid argument
attribute | type | current | default | comment
-----------+--------+---------+---------+-------------------------------------
norm | choice | (null) | (null) |
input | choice | Camera | Camera | Camera 1
bright | int | 0 | 0 | range is -16 => 16
contrast | int | 16 | 16 | range is 1 => 32
color | int | 6 | 6 | range is 0 => 19
hue | int | 0 | 0 | range is -45 => 45
White Bala | bool | on | on |
Gamma | int | 160 | 160 | range is 100 => 190
Gain | int | 192 | 96 | range is 64 => 192
Power Line | choice | 50 Hz | 50 Hz | Disabled 50 Hz 60 Hz
White Bala | int | 6500 | 6500 | range is 2800 => 6500
Sharpness | int | 2 | 2 | range is 0 => 15
Backlight | int | 1 | 0 | range is 0 => 1
Some zm error messages
Code: Select all
[zmu]
Error, failed to query crop /dev/video: Invalid argument
[zmc v4l2]
Failed to set picture attributes: Invalid argument
[zmc v4l1]
Failed to set video format: Invalid argument
My webcam not support above v4l set operation.
mplayer seems notice these ioctl fail errors and try to fixed it following get/set way. And can I modify ZM to act this way?
Code: Select all
[root@CentOS1 ~]# mplayer -fps 15 tv:// -tv driver=v4l2:device=/dev/video0
v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
Selected device: Saturn USB 2.0 Camera.
Capabilites: video capture streaming
supported norms:
inputs: 0 = Camera 1;
Current input: 0
Current format: MJPEG
mplayer/stream/tvi_v4l2.c [mlayer source code]
Code: Select all
/*
** Get current video capture standard.
*/
static int getstd(priv_t *priv)
{
v4l2_std_id id;
int i=0;
if (ioctl(priv->video_fd, VIDIOC_G_STD, &id) < 0) {
struct v4l2_streamparm parm;
parm.type=V4L2_BUF_TYPE_VIDEO_CAPTURE;
if(ioctl(priv->video_fd, VIDIOC_G_PARM, &parm) >= 0) {
mp_msg(MSGT_TV, MSGL_WARN, "%s: your device driver does not support VIDIOC_G_STD ioctl,"
" VIDIOC_G_PARM was used instead.\n", info.short_name);
priv->standard.index=0;
priv->standard.id=0;
priv->standard.frameperiod=parm.parm.capture.timeperframe;
return 0;
}
mp_msg(MSGT_TV, MSGL_ERR, "%s: ioctl get standard failed: %s\n",
info.short_name, strerror(errno));
return -1;
}
do {
priv->standard.index = i++;
if (ioctl(priv->video_fd, VIDIOC_ENUMSTD, &priv->standard) < 0) {
return -1;
}
} while (priv->standard.id != id);
return 0;
}