OpenWrt Forum Archive

Topic: Problems with spcacat

The content of this topic has been archived on 19 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi

I have a "ASUS WL-500g Premium" with two "Labtec Webcam Pro [0x46d/0x8a2]" cams.

I have tried several methods to get pictures from two cams in to jpg files.

1.)

Starting twice the spcacat for both cams in different directories:

 cd /tmp/cam1
 spcacat -d /dev/video0 -g -f jpg -s 640x480 -p 1000 -o > /dev/null &
 cd /tmp/cam2
 spcacat -d /dev/video1 -g -f jpg -s 640x480 -p 1000 -o > /dev/null &

But the saved images have sometimes errors in the image (broken in the middle, false colours or other errors)

So I thought I access the halve written File through the web browser.

2.)

To compensate this I let the spcacat write continuous files:

 cd /tmp/cam1
 spcacat -d /dev/video0 -g -f jpg -s 640x480 -p 1000 > /dev/null &
 cd /tmp/cam2
 spcacat -d /dev/video1 -g -f jpg -s 640x480 -p 1000 > /dev/null &

After a while I have al lot of saved images but sometimes the have also the errors in the files.

3.)

My new idea is to start the spcacat alternating in a script:

while [ 1 = 1 ]
 do

###### CAM 1 BEGIN ######
  if [ -e /dev/video0 ]; 
   then
    cd /tmp/cam1/
    /usr/bin/spcacat -d /dev/video0 -g -f jpg -s 640x480 -N 1 -o 
    mv /tmp/cam1/SpcaPict.jpg /tmp/webcam1.jpg
  fi 
###### CAM 1 END ######

###### CAM 2 BEGIN ######
  if [ -e /dev/video1 ]; 
   then
    cd /tmp/cam2/
    /usr/bin/spcacat -d /dev/video1 -g -f jpg -s 640x480 -N 1 -o 
    mv /tmp/cam2/SpcaPict.jpg /tmp/webcam2.jpg
  fi 
###### CAM 2 END ######

 done

That works fine but had a very poor refresh rate.
The spcacat always test the device every loop.
For two cams it will approximately take 6 seconds.

It looks like the image errors occurs when two grabber using the same USB line at the same time.

So my question is now is there a way to tell the spcacat to skip the init test sequence or to force it to use pre selected pallets and size through parameters?

If not where I get the source code to alter the spcacat.

My wish is a config file like motion where I can describe two or more cams with different output files and maybe output size.


thanks Jakson

The discussion might have continued from here.