Page 1 of 1

My USB webcam stopped working

Posted: Tue Mar 19, 2024 2:15 am
by boof

afaik it's a generic usb webcam. it's not detected by pupcam[era.?] it was ok a few weeks ago, but i can't remember.


Re: how do i view my webcam image, pls

Posted: Tue Mar 19, 2024 2:21 am
by nilsonmorales

Code: Select all

#!/bin/bash -x
export TEXTDOMAIN=webcamtest
export OUTPUT_CHARSET=UTF-8

# Obtén una lista de todos los dispositivos de video
devices=$(ls /dev | grep video)

# Crea un array para almacenar las opciones del diálogo
options=()

# Llena el array con los dispositivos de video
for device in $devices; do
  options+=("/dev/$device")
done

# Muestra el diálogo y guarda la selección del usuario
selected_device=$(yad --width=340 --height=150 --image="/usr/share/icons/Newaita-dark/devices/48/camera-web.svg" --window-icon="/usr/share/icons/Newaita-dark/devices/48/camera-web.svg" --title "$(gettext 'Select a video device')" --list --column "$(gettext 'Devices')": "${options[@]}")

# Elimina el carácter "|" del final de la selección del usuario
selected_device=${selected_device%|}

# Reproduce video desde el dispositivo seleccionado
if [ -n "$selected_device" ]; then
  ffplay -f v4l2 -video_size 640x480 -i "$selected_device"
fi

Try this script


Re: how do i view my webcam image, pls

Posted: Tue Mar 19, 2024 2:32 am
by mikewalsh

@nilsonmorales :-

Works nicely here, Nilson.....but then, my Logitech c920 IS Video4Linux-compliant anyway. :thumbup:

@boof :-

Boof, are you saying your webcam has simply stopped working? :?

In a terminal, what readout d'you get from

Code: Select all

lsusb

...??

Mike. :|


Re: how do i view my webcam image, pls

Posted: Fri Mar 22, 2024 7:00 pm
by boof

i'll check later thx. i've unplugged it temp.


Re: My USB webcam stopped working

Posted: Sun Apr 07, 2024 12:37 pm
by Geek3579

HI @nilsonmorales :-

This script works well. Now, how would I store the image from the webcam into a .jpg ???


Re: My USB webcam stopped working

Posted: Sun Apr 07, 2024 1:19 pm
by mikewalsh

@Geek3579 :-

Geek3579 wrote: Sun Apr 07, 2024 12:37 pm

HI @nilsonmorales :-

This script works well. Now, how would I store the image from the webcam into a .jpg ???

I don't think that would be possible with the script as-is. Currently, it's written to give a 'Live' videostream.....and from the sound of things, you're asking for a 'still' snapshot in JPG format. That would require some extra code, but.....heh; you've given ME something to research now, because it would be a useful addition to my 'CamRecord' utility.

Hmm. Now; let's see....

Mike. :D


Re: My USB webcam stopped working

Posted: Sun Apr 07, 2024 11:37 pm
by mikewalsh

@Geek3579 :-

You could try my latest creation if you ARE after capturing a 'still' JPG image.....FSWebcamGUI.

Entirely up to you.....unless of course, '.jpg' was a 'typo'..?

Mike. :lol: