webcam howto

59 views
Skip to first unread message

Russell Harris

unread,
Nov 29, 2025, 5:48:17 PM (7 days ago) Nov 29
to weewx...@googlegroups.com
For several years, I have been running weewx to upload weather data
(every five minutes) to a web site which presently is hosted on
hostgator.com.

I have a spare webcam (Logitec HD1080p) which I could point out the
window to show sky images. A fresh image several times an hour would
be nice.

Could someone point me to a how-to to get the system configured? My
previous attempts have not been successful.

The system is:

= Davis Vantage PRO2 with USB data logger

= weewx (latest, installed via Debian files)

= Debian-12 running on a Dell Vostro 200 (dedicated to weewx)

= www.alysonwonderland.org

RLH

John Smith

unread,
Nov 29, 2025, 6:23:32 PM (7 days ago) Nov 29
to weewx...@googlegroups.com
It looks like ffmpeg works for USB cams. A quick web search brought this up.

ffmpeg -f video4linux2 -i /dev/v4l/by-id/usb-0c45_USB_camera-video-index0 -vframes 1  -video_size 640x480 test.jpeg

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/weewx-user/CAKyOgCWdDaeqvd8pLkc%3DoWOZ_qozyJL9a%2BYQCTvHo%3DML7QzEEQ%40mail.gmail.com.

Russell Harris

unread,
Nov 29, 2025, 7:02:49 PM (7 days ago) Nov 29
to weewx...@googlegroups.com
Thanks, I shall experiment with ffmpeg. But I also need a guide:

= how to prevent conflicts between ffmpeg and weewx

= how to upload the sky images (can weewx handle this?)

= how to cause alysonwonderland.org to display the sky images (right
now, visiting alysonwonderland.org automatically causes display of the
weather data)

I am computer-literate, but also a bit old and slow.

RLH
> To view this discussion visit https://groups.google.com/d/msgid/weewx-user/CAGTinV7HR%3DH0Vv7PxCvD3gFoBdPFTT%3DUD-Vaaj8%2BqRC3-yQ1%3Dg%40mail.gmail.com.

jaanumarejaan Jaanumarejaan

unread,
Nov 29, 2025, 7:23:11 PM (6 days ago) Nov 29
to weewx...@googlegroups.com

vince

unread,
Nov 29, 2025, 8:07:15 PM (6 days ago) Nov 29
to weewx-user
On Saturday, November 29, 2025 at 4:02:49 PM UTC-8 Russell Harris wrote:
Thanks, I shall experiment with ffmpeg. But I also need a guide:


https://www.google.com/search?q=ffmpeg+take+still+from+usb+camera and look at the AI-generated results at the top.   It might be as simple as essentially the first answer there of the following.

ffmpeg -f video4linux2 -i /dev/video0 -vframes 1 output.jpg

John's reply earlier in this thread suggesting "/dev/v4l/by-id/usb-0c45_USB_camera-video-index0" is almost certainly incorrect for your unique setup, but there should be a similar device name on your system for the camera.  You can probably find the camera under /dev/<something>/by-id if you don't get a generic /dev/video0 device created by the os.  It might be under /dev/serial/by-id possibly.


= how to prevent conflicts between ffmpeg and weewx 

The two cannot conflict, so you don't have to do anything to prevent that.


= how to upload the sky images (can weewx handle this?) 

Simplest way is to write your image(s) to somewhere under a weewx-generated directory you already upload.  I do this with a cron job that runs periodically  with a slightly different ffmpeg command since I'm using a network camera.

timeout 60 ffmpeg <your_ffmpeg_options_here> /var/www/html/weewx/webcam.jpg 2>/dev/null

Just to explain, the method above sets a 60-seconds timeout for the ffmpeg command to complete (to guard against the command hanging for some reason) and throws away error messages as well.   On my system, I write to /var/www/html/weewx as an example only.  Your setup might be different.

ffmpeg has a 'lot' of options.  Take the defaults when you can rather than getting too slick.

 
= how to cause alysonwonderland.org to display the sky images (right
now, visiting alysonwonderland.org automatically causes display of the
weather data)

You add an <img> link to the desired .tmpl template file in whatever weewx skin you are using.  Which file you need to add a line to depends on which skin you're using and where you want the image to appear on that page.  You might need to set it to be located in a particular place on the page, or have a particular size, etc.

 
I am computer-literate, but also a bit old and slow. 

Google and the Google Groups search capability here can help a lot there :-)


Reply all
Reply to author
Forward
0 new messages