My USB webcam stopped working

Moderator: Forum moderators

Post Reply
boof
Posts: 559
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

My USB webcam stopped working

Post 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.

User avatar
nilsonmorales
Posts: 177
Joined: Thu Dec 26, 2019 1:47 am
Location: El Salvador
Has thanked: 67 times
Been thanked: 105 times
Contact:

Re: how do i view my webcam image, pls

Post 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

User avatar
mikewalsh
Moderator
Posts: 6115
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 779 times
Been thanked: 1952 times

Re: how do i view my webcam image, pls

Post 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. :|

boof
Posts: 559
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 8 times

Re: how do i view my webcam image, pls

Post by boof »

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

Geek3579
Posts: 269
Joined: Sat Jul 18, 2020 1:07 pm
Has thanked: 80 times
Been thanked: 68 times

Re: My USB webcam stopped working

Post by Geek3579 »

HI @nilsonmorales :-

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

User avatar
mikewalsh
Moderator
Posts: 6115
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 779 times
Been thanked: 1952 times

Re: My USB webcam stopped working

Post 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

User avatar
mikewalsh
Moderator
Posts: 6115
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 779 times
Been thanked: 1952 times

Re: My USB webcam stopped working

Post 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:

Post Reply

Return to “F96-CE”