Gael_G
Posts: 6
Joined: Thu Aug 28, 2014 1:52 pm

fswebcam Unable to find a compatible palette format

Fri Sep 05, 2014 8:46 pm

Hello, I try to make a little surveillance system.
For that, I'm just trying to capture an image from my webcam at regular intervals, the image is displayed on a web page and a Jquery script reload it to always display the last one. It works for 4 or 5 images, but suddenly fswebcam displays the error message "Unable to find a compatible palette format" for no apparent reason. My webcam is a Logitech QuickCam E3500 and I use the following command to get an image from the webcam:

Code: Select all

fswebcam -r 640x480 -l 5 /var/www/cam/image.jpg
I think that my RPi is up-to-date.
Could someone help me? Thank you in advance!

phack
Posts: 2
Joined: Wed Dec 05, 2012 2:53 am

Re: fswebcam Unable to find a compatible palette format

Tue Oct 07, 2014 3:09 am

I am having the same issue. cannot view the webcam output while running fswebcam -r 640x480 --jpeg 85 -q -d /dev/video1 testimg.jpg

Running motion does not work either. Have two USB webcams plugged in (one in video0, one in video1)

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: fswebcam Unable to find a compatible palette format

Tue Oct 07, 2014 10:13 am

Sounds like an incompatible webcam. Many old USB1.1 types just don't work on the Pi despite the drivers being in place for them. (I've half a dozen that don't work with the Pi)
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

PeDrOo
Posts: 1
Joined: Thu Feb 20, 2014 9:50 am

Re: fswebcam Unable to find a compatible palette format

Mon Oct 27, 2014 8:55 am

Hello, I have the same problem with a Quickcam pro5000.
The script I made and put in the cron, take one picture every 30 min. It works for one week, or two hours.... it depends (but of what I can't find for the moment)
And it stops working with the ouput error : Unable to find a compatible palette format.

I am still searching for a solution, if I foind something I let you know.

For information, I have only one USB used with this webcam on a Raspberry PI B, with a Raspbian distrib.

Regards,

Pedroo

youssefaoun
Posts: 1
Joined: Sat Nov 29, 2014 12:52 pm

Re: fswebcam Unable to find a compatible palette format

Sat Nov 29, 2014 12:54 pm

Hello,
I also have Logitech, Inc. QuickCam Pro 5000 and I am encountering the same problem
Note that I tried a "LabTec" camera and the same problem appears.

Did anyone find a solution?

Regards,

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: fswebcam Unable to find a compatible palette format

Sat Nov 29, 2014 5:59 pm

The accepted solution with webcams and the Pi is to buy one that does work. I favour the Microsoft VX-800 Lifecam. Available cheap (refurbished) on Ebay. Many old USB webcams just don't work.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

mpinder0
Posts: 2
Joined: Thu Feb 05, 2015 8:44 am

Re: fswebcam Unable to find a compatible palette format

Thu Feb 05, 2015 8:53 am

I'm suffering from the same issue, using a logitech C310 camera (a supported UVC/V4L device).
The camera will successfully make several captures before repeatedly failing with the "Unable to find a compatible palette format" error.
To reset the fault I have to unplug and plug the camera back in or reboot the pi.

Has anyone found a solution for this, or have any Ideas?

mpinder0
Posts: 2
Joined: Thu Feb 05, 2015 8:44 am

Re: fswebcam Unable to find a compatible palette format

Mon Feb 09, 2015 10:23 am

Having added -D 1 (1 sec delay) to the fswebcam call, it seems much more stable. Have been running on a 120 sec loop for 3 days now without issue.

jertuo
Posts: 4
Joined: Mon Mar 16, 2015 6:27 pm

Re: fswebcam Unable to find a compatible palette format

Mon Mar 16, 2015 6:50 pm

Hi,

I have the same issue with a following setup which idea is to record pictures from a webcam for a timelapse movie. Please let us know if anyone has found the reason for the scripts to work for about < 5 minutes and then crashing. The error can be checked by running in terminal "fswebcam image.jpg" and getting error below.
  • Raspberry Pi 2 Model B
    Raspbian OS with latest "sudo apt-get update & upgrade"
    Logitech Quickcam Pro 9000 - http://support.logitech.com/product/quickcam-pro-9000
    webcam.sh bash script saving picture from webcam to a file with fswebcam command
    Crontab -e scheduling webcam.sh script to run every 15 seconds
lsusb

Code: Select all

[email protected] ~ $ lsusb
Bus 001 Device 005: ID 046d:0990 Logitech, Inc. QuickCam Pro 9000
[email protected] ~ $
webcam.sh

Code: Select all

#!/bin/bash
DATE=$(date +"%Y-%m-%d_%H%M%S")
fswebcam -r 960x720 /home/pi/webcam/$DATE.jpg
crontab -e

Code: Select all

* * * * * /home/pi/webcam.sh
* * * * * sleep 15;/home/pi/webcam.sh
* * * * * sleep 30;/home/pi/webcam.sh
* * * * * sleep 45;/home/pi/webcam.sh
Error can be found after about < 5 minutes with the following way...

Code: Select all

[email protected] ~ $ fswebcam test.jpg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Unable to find a compatible palette format.
[email protected] ~ $ 

jertuo
Posts: 4
Joined: Mon Mar 16, 2015 6:27 pm

Re: fswebcam Unable to find a compatible palette format

Tue Mar 17, 2015 12:08 am

Tried to do the same task without cron by using fswebcam with loop 15 option. It started to give errors after first minute (4 photos)...

webcam.sh

Code: Select all

#!/bin/bash
DATE=$(date +"%Y-%m-%d_%H%M%S")
fswebcam -l 15 -r 960x720 /home/pi/webcam/$DATE.jpg
running the bash script succesfully for 1 minute ending to an error "Unable to find a compatible palette format".

Code: Select all

[email protected] ~ $ ./webcam.sh
>>> Next image due: 2015-03-17 02:09:45 (EET)
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
--- Capturing frame...
Captured frame in 0.00 seconds.
--- Processing captured image...
Writing JPEG image to '/home/pi/webcam/2015-03-17_020944.jpg'.
>>> Next image due: 2015-03-17 02:10:00 (EET)
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
--- Capturing frame...
Captured frame in 0.00 seconds.
--- Processing captured image...
Writing JPEG image to '/home/pi/webcam/2015-03-17_020944.jpg'.
>>> Next image due: 2015-03-17 02:10:15 (EET)
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
--- Capturing frame...
Captured frame in 0.00 seconds.
--- Processing captured image...
Writing JPEG image to '/home/pi/webcam/2015-03-17_020944.jpg'.
>>> Next image due: 2015-03-17 02:10:30 (EET)
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
--- Capturing frame...
Captured frame in 0.00 seconds.
--- Processing captured image...
Writing JPEG image to '/home/pi/webcam/2015-03-17_020944.jpg'.
>>> Next image due: 2015-03-17 02:10:45 (EET)
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Unable to find a compatible palette format.

jertuo
Posts: 4
Joined: Mon Mar 16, 2015 6:27 pm

Re: fswebcam Unable to find a compatible palette format

Tue Mar 17, 2015 10:41 pm

jertuo wrote:Hi,

I have the same issue with a following setup which idea is to record pictures from a webcam for a timelapse movie. Please let us know if anyone has found the reason for the scripts to work for about < 5 minutes and then crashing. The error can be checked by running in terminal "fswebcam image.jpg" and getting error below.
  • Raspberry Pi 2 Model B
    Raspbian OS with latest "sudo apt-get update & upgrade"
    Logitech Quickcam Pro 9000 - http://support.logitech.com/product/quickcam-pro-9000
    webcam.sh bash script saving picture from webcam to a file with fswebcam command
    Crontab -e scheduling webcam.sh script to run every 15 seconds
I just tried this same setup with old Ubuntu laptop and it works like a Buick! So the problem can't be in the webcam? It has to be in Raspberry Pi limited harware??

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: fswebcam Unable to find a compatible palette format

Tue Mar 17, 2015 11:24 pm

jertuo wrote: I just tried this same setup with old Ubuntu laptop and it works like a Buick! So the problem can't be in the webcam? It has to be in Raspberry Pi limited harware??
Got it in one. The Pi has long had USB problems, mostly resolved these days but many webcams still don't work. I've several webcams that work fine on Linux on PC hardware that the Pi won't entertain.

Answer is the same as I've given twice before. Buy one that does with the Pi.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

jertuo
Posts: 4
Joined: Mon Mar 16, 2015 6:27 pm

Re: fswebcam Unable to find a compatible palette format

Wed Mar 18, 2015 11:49 am

I found this RPi USB Webcams compatibility list but according to that my Logitech Quickcam Pro 9000 should work just fine but it doesn't. So it seems that you just need lots of good luck when selecting a webcam for RPi :-/

http://elinux.org/RPi_USB_Webcams

bountyday
Posts: 1
Joined: Wed Mar 18, 2015 4:37 pm

Re: fswebcam Unable to find a compatible palette format

Wed Mar 18, 2015 4:39 pm

Having added -D 1 (1 sec delay) to the fswebcam call, it seems much more stable. Have been running on a 120 sec loop for 3 days now without issue.
worked for me - thanks

thexjib
Posts: 2
Joined: Mon Apr 20, 2015 9:52 pm

Re: fswebcam Unable to find a compatible palette format

Mon Apr 20, 2015 10:15 pm

For the people who are having the problem of fswebcam crapping out after a few shots I have found a work around.

https://gist.github.com/x2q/5124616is a C program that will reset usb devices by bus and device number

save the code as

Code: Select all

usbreset.c
in your home folder

then compile

Code: Select all

$ cc usbreset.c -o usbreset
then make executable

Code: Select all

$ chmod +x usbreset
type

Code: Select all

lsusb
and find the device and bus number of your camera

sample output

Code: Select all

 [[email protected] ~]$ lsusb
Bus 001 Device 005: ID 0846:9041 NetGear, Inc. WNA1000M 802.11bgn [Realtek RTL8188CUS]
Bus 001 Device 099: ID 046d:0825 Logitech, Inc. Webcam C270   <------------------------------- This is what you are looking for
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

then test usbreset. With your webcam plugged in do

Code: Select all

$ sudo ~/usbreset /dev/bus/usb/0XX/0XX
(replace 0XX with the output from lsusb)

if you did it correctly the shell should output something like

Code: Select all

reset successful 
or something like that

now we need to create a bash script to run fswebcam and reset the cam every few shots, here is what I came up with. Note that you need to change the line "Logitech" to whatever your manufacture output is from lsusb and you need to run the script as root (sudo)so you don't have to put in a password every time the webcam resets. The following script takes four shots five seconds apart and then reset the webcam and keeps doing that until I stop it [ctrl+c to stop]. The usbreset takes about 7 seconds from shot to shot. To get this to work for you you will have to tweak the file paths to fit your setup. Good luck and if you have any question just ask.


Code: Select all

 #!/bin/bash

##configure here
#type your username for the variable USER if you run with sudo, otherwise bash will use root.
USER=
#put the path to this bash script here
pathtoscript=
bs=`lsusb | grep Logitech | cut -c5-7`
dve=`lsusb | grep Logitech | cut -c16-18`


cam() {

for n in {1..3}; do

fswebcam  /home/$USER/media/%H%M%S.jpg  -D 1

sleep 4

done

}

cam

sudo /home/$USER/usbreset /dev/bus/usb/$bs/$dve

sudo $pathtoscript 

kmvar
Posts: 1
Joined: Sun Jun 07, 2015 9:17 pm

Re: fswebcam Unable to find a compatible palette format

Sun Jun 07, 2015 9:22 pm

Good job thexjib 8-) :D

I had a problem with my Logitech 905.

MbG Daniel

g1naveen
Posts: 5
Joined: Sun Dec 07, 2014 7:56 am
Location: India

Re: fswebcam Unable to find a compatible palette format

Mon Jun 15, 2015 8:31 am

thexjib wrote:For the people who are having the problem of fswebcam crapping out after a few shots I have found a work around.

https://gist.github.com/x2q/5124616is a C program that will reset usb devices by bus and device number

save the code as

Code: Select all

usbreset.c
in your home folder

then compile

Code: Select all

$ cc usbreset.c -o usbreset
then make executable

Code: Select all

$ chmod +x usbreset
type

Code: Select all

lsusb
and find the device and bus number of your camera

sample output

Code: Select all

 [[email protected] ~]$ lsusb
Bus 001 Device 005: ID 0846:9041 NetGear, Inc. WNA1000M 802.11bgn [Realtek RTL8188CUS]
Bus 001 Device 099: ID 046d:0825 Logitech, Inc. Webcam C270   <------------------------------- This is what you are looking for
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

then test usbreset. With your webcam plugged in do

Code: Select all

$ sudo ~/usbreset /dev/bus/usb/0XX/0XX
(replace 0XX with the output from lsusb)

if you did it correctly the shell should output something like

Code: Select all

reset successful 
or something like that

now we need to create a bash script to run fswebcam and reset the cam every few shots, here is what I came up with. Note that you need to change the line "Logitech" to whatever your manufacture output is from lsusb and you need to run the script as root (sudo)so you don't have to put in a password every time the webcam resets. The following script takes four shots five seconds apart and then reset the webcam and keeps doing that until I stop it [ctrl+c to stop]. The usbreset takes about 7 seconds from shot to shot. To get this to work for you you will have to tweak the file paths to fit your setup. Good luck and if you have any question just ask.


Code: Select all

 #!/bin/bash

##configure here
#type your username for the variable USER if you run with sudo, otherwise bash will use root.
USER=
#put the path to this bash script here
pathtoscript=
bs=`lsusb | grep Logitech | cut -c5-7`
dve=`lsusb | grep Logitech | cut -c16-18`


cam() {

for n in {1..3}; do

fswebcam  /home/$USER/media/%H%M%S.jpg  -D 1

sleep 4

done

}

cam

sudo /home/$USER/usbreset /dev/bus/usb/$bs/$dve

sudo $pathtoscript 
--------------------------
When i attempted your code, it gives an error like this:

Error opening output file: No such file or directory

thexjib
Posts: 2
Joined: Mon Apr 20, 2015 9:52 pm

Re: fswebcam Unable to find a compatible palette format

Wed Sep 02, 2015 1:28 pm

g1naveen try making a directory called "media" in your home folder and try again

kmvar I am glad I could help

Ruralkan
Posts: 1
Joined: Wed Dec 09, 2015 8:00 pm

Re: fswebcam Unable to find a compatible palette format

Wed Dec 09, 2015 8:04 pm

You can try to use:
first in terminal:

Code: Select all

locate v4l1compat.so
say you directories of v4l1

Code: Select all

usr/lib/your-path-to-lib/v4l1compat.so
after, you use this information:

Code: Select all

LD_PRELOAD=/usr/lib/your-path-to-lib/v4l1compat.so fswebcam

gotel
Posts: 2
Joined: Fri Jan 15, 2016 8:36 pm

Re: fswebcam Unable to find a compatible palette format

Fri Jan 15, 2016 8:43 pm

I had the same error with a Logitech C210 on raspbian jessie, but providing the appropriate resolution with the -r switch did solve the problem. I looked up resolution on http://elinux.org/RPi_USB_Webcams. For the C210 it is 320x240 and 640x480.

So I did somethin like fswebcam -r 320x240 test.jpg and it worked perfectly.

Hope that solves the issue for you guys too.

gotel
Posts: 2
Joined: Fri Jan 15, 2016 8:36 pm

Re: fswebcam Unable to find a compatible palette format

Wed Jan 20, 2016 4:33 am

Hi, please forget my last post. It did not work either. Same error after 5 hours. I tried the usbreset code from poster above and I now reset the USB device each time before I take a photo. That works now for 4 days. This is my code

Code: Select all

while /bin/true;
do

 # determine device
 # relevant output line from lsusb is:
 # Bus 001 Device 028: ID 046d:0819 Logitech, Inc. Webcam C210
 idpair=`lsusb |sed -ne '/Logi/ s/Bus \(...\) Device \(...\):.*/\1\/\2/p'`
 device=/dev/bus/usb/$idpair
 
 # actually resetting the device
 echo +++ reset usb $device
 sudo usbreset $device

 echo +++ take picture
 fswebcam -s 3 -D 2 -r 320x240 -s Brightness=200 -s Contrast=70 bild.jpg
 sleep 300
done

Andras_
Posts: 2
Joined: Wed Mar 30, 2016 8:20 pm

Re: fswebcam Unable to find a compatible palette format

Wed Mar 30, 2016 8:28 pm

I think I found the solution. :)

The problem occurs when the webcam doesn't have enough juice, so I had to rise usb current by setting max_usb_current to 1.
After this setting the problem eliminated for me (up to now).

Andras_
Posts: 2
Joined: Wed Mar 30, 2016 8:20 pm

Re: fswebcam Unable to find a compatible palette format

Fri Apr 01, 2016 8:03 am

I haven't right. :(

roberg
Posts: 1
Joined: Mon Jul 11, 2016 9:36 am

Re: fswebcam Unable to find a compatible palette format

Mon Jul 11, 2016 9:44 am

To recover from this state you can reload the module instead of doing a restart (check which module using lsmod):

Code: Select all

sudo modprobe -r uvcvideo
sudo modprobe -r videobuf2_vmalloc
sudo modprobe videobuf2_vmalloc
sudo modprobe uvcvideo

CyberShadow
Posts: 1
Joined: Sun Mar 26, 2017 9:25 am

Re: fswebcam Unable to find a compatible palette format

Sun Mar 26, 2017 9:31 am

I was getting the "Unable to find a compatible palette format" error unconditionally. Then, I stumbled upon http://raspberrypi.stackexchange.com/qu ... tte-format.

This seems to work about half the time:

LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libv4l/v4l1compat.so fswebcam out.jpg

The other half, I get a "Resource temporarily unavailable" error.

Return to “Troubleshooting”