In the first part of this tutorial you learned how to configure your webcam with Arduino Yun and how to capture static images; today you’ll learn how to change the image resolution and how to watch the video stream in realtime…
“ruined” pictured
Sometimes using fswebcam I got “ruined” images like the following one:
I was able to solve the problem using the –skip n option that tells fswebcam to skip the first n images from the webcam before capturing one:
Resolution
Every webcam supports a fixed number of resolutions (= the number of pixels that form the image).
You can find the supported resolutions using a couple of Linux commands:
- first get the numeric ID (VID and PID) of your webcam with lsusb:
- then display the details of that device with lsusb -d 045e:0779 -v (change the ID with your one). EachVideoStreaming Interface Descriptor section contains one supported resolution:
- Using grep you can filter out only the resolutions list:
fswebcam has the -r option to specify the desired image resolution (widthxheight):
And the result:
In the next page I’m going to show how to display a realtime video stream…
Hi Luca:
Regards from Spain.
Thanks for sharing this information. Your tutorials are very well written. For some people like me Yun is the first approach to Linux so we are a bit lost.
Thanks again.
Hi Francisco, thanks for your comment!
Ciao,il mio problema è che il mio arduino non fa piu l’accesspoint ma si collega direttamente al wifi e in questo modo non mi fa entrare in ssh…come dovrei fare???
Grazie
Salve Luca,
ho seguito il tutorial Colleghiamo una webcam parte 1 e 2, andato tutto a buon fine, ma vado in http://arduino.local:8080 e quello che mi esce è la pagina web di mjpd-streamer. Il problema sta che dove dovrebbe uscire lo streaming della webcam ho uno sfondo bianco… Come potrei risolvere questo problema? Grazie in anticipo
Ciao Antonio, quindi non vedi proprio il filmato? Mentre riesci ad acquisire una immagine statica?
“ReadResponse() failed: The server did not return a response for this request”. Questo è quello che il browser risponde quando apro la pagina http://arduino.local:8080. Che succede??
Grazie mille per la risposta
Per prima cosa ti volevo ringraziare per il tuo post! 🙂
Come posso aggiornare la versione di linino? non sono un esperto… 🙂
Perchè installando la webcam credo che la riconosca infatti digitando “lsusb” mi dice la marca della webcam ma nella cartella /dev non trovo il file video()…
Grazie 1000.
Lorenzo
Ciao Lorenzo, l’aggiornamento è molto semplice (si tratta di copiare il nuovo firmware sulla SD e lanciare la procedura dalla web interface):
http://www.lucadentella.it/2014/02/03/yun-factory-reset-per-linino/
thanks alot. god bless you
Ciao, c’è un modo per registrare lo streaming video su hd esterno o su sd? grazie
ciao, si puoi usare il plugin output_file.so come spiegato in questo articolo.
Intanto grazie, mi potresti aiutare, perché non ne capisco granché, io ho seguito la tua guida e per adesso vedo via browser quello che inquadra la webcam. Quello che vorrei fare è che oltre vederlo venga registrato in un hd esterno, cancellando di volta in volta i file più vecchi.
Buona sera Luca,
Vorrei un tuo parere,secondo te è fattibile connettere due webcam alla yun tramite uno splitter per poi scegliere quale webcam vuoi utilizzare tramite una pagina web?
grazie
Nevio
Ciao Nevio, vedo più facile collegare le due webcam ad un hub USB e collegare questo allo Yun… poi in qualche modo via software (= pagina web) decidere quale device utilizzare
Ciao Luca complimenti per il post. Io non ho problemi fino a quando vado a fare opkg install mjpg-streamer.ipk, dove mi appare la schermata:
root@Arduino:/tmp# opkg install mjpg-streamer.ipk
Installing mjpg-streamer (r148-4) to root…
Collected errors:
* opkg_install_pkg: Package mjpg-streamer md5sum mismatch. Either the opkg or the package index are corrupt. Try ‘opkg update’.
* opkg_install_cmd: Cannot install package mjpg-streamer.
Ovviamente ho provato a fare opkg update ma non cambia niente
Ciao Luca, sembra che il pacchetto sia corrotto… se puoi prova a reinstallare il firmware con l’ultima versione e vedi se risolvi.
Ciao, innanzitutto grazie mille per la guida, avrei solo una domanda: come faccio a modificare il file “mjpg-streamer”? Grazie in anticipo e buona serata
ciao Filippo, cosa intendi con “modificare il file”?