Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Other discussions > Linux and software for Linux
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 05-03-2010, 04:15 AM
Stream Recorder
 
Posts: n/a
Default

zmu -d /dev/video0 -q -v: Error, failed to query crop /dev/video0: Invalid argument


When I launch
Code:
zmu -d /dev/video0 -q -v
I get the following error:
Code:
Error, failed to query crop /dev/video0: Invalid argument
I've tried to chmod 777 my web cam:
Code:
sudo chmod 777 /dev/video0
but the I was getting the same error.

However
Code:
zmu -d /dev/video0 -V 1 -q -v
is working fine in Ubuntu 10.04 Lucid:
Code:
Video Device: /dev/video0
Video Capabilities
  Name: Slim 1322 AF
  Type: 1
    Can capture
  Video Channels: 1
  Audio Channels: 0
  Maximum Width: 1280
  Maximum Height: 1024
  Minimum Width: 48
  Minimum Height: 32
Window Attributes
  X Offset: 0
  Y Offset: 0
  Width: 640
  Height: 480
Picture Attributes
  Palette: 8 - YUYV
  Colour Depth: 16
  Brightness: 21959
  Hue: 32768
  Colour :44127
  Contrast: 0
  Whiteness: 0
Channel 0 Attributes
  Name: Camera 1
  Channel: 0
  Flags: 0
  Type: 2 - Camera
  Format: 0 - PAL
Reply With Quote
  #2  
Old 05-03-2010, 05:14 AM
Stream Recorder
 
Posts: n/a
Default

Re: zmu -d /dev/video0 -q -v: Error, failed to query crop /dev/video0: Invalid argume


A USB camera that doesn't support cropping will produce an error message
Code:
Error, failed to query crop: /dev/video0: Invalid argument
from
Code:
zmu -d /dev/video0 -q -v

Fix for the problem:
Quote:
Failures are exhibited in zmu, and other places that rely on LocalCamera::GetCurrentSettings.

The fault is in LocalCamera::GetCurrentSettings.

The error arises from the fact that ioctl VIDIOC_G_CROP returns -1 and errno = EINVAL to indicate that cropping is not supported. LocalCamera::GetCurrentSettings treats any negative rc from ioctl VIDIOC_G_CROP as grounds for abnormal termination.

The fix is straightforward and short. All changes are in zm_local_camera.cpp as follows:
Code:
911,912c911 
<        int crop_rc = vidioctl( vid_fd, VIDIOC_G_CROP, &crop ); 
<             if ((crop_rc  < 0 ) && (errno != EINVAL)) 
--- 
>             if ( vidioctl( vid_fd, VIDIOC_G_CROP, &crop ) < 0 ) 
921,928c920,921 
<             if ( verbose ) { 
<       if (crop_rc >= 0) { 
<                    sprintf( output+strlen(output), "  Current: %d x %d\n", crop.c.width, crop.c.height ); 
<       } 
<       else { 
<          sprintf( output+strlen(output), "  Current: Cropping is not supported\n"); 
<       } 
<        } 
--- 
>             if ( verbose ) 
>                 sprintf( output+strlen(output), "  Current: %d x %d\n", crop.c.width, crop.c.height );
Reply With Quote
Reply Post New Thread
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 07:40 AM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons