My USB webcam stopped working

Moderator: Forum moderators

Post Reply
boof
Posts: 518
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 5 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: 107
Joined: Thu Dec 26, 2019 1:47 am
Location: El Salvador
Has thanked: 46 times
Been thanked: 57 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: 5575
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 570 times
Been thanked: 1681 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. :|

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

boof
Posts: 518
Joined: Sat Aug 15, 2020 9:17 am
Been thanked: 5 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: 245
Joined: Sat Jul 18, 2020 1:07 pm
Has thanked: 68 times
Been thanked: 62 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: 5575
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 570 times
Been thanked: 1681 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

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

User avatar
mikewalsh
Moderator
Posts: 5575
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 570 times
Been thanked: 1681 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:

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

Post Reply

Return to “F96-CE”