×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Webcam for monitoring the rig outside

  • Posts: 348
  • Thank you received: 69
Hi All,

I tend to sit inside imaging, and I often stream my imaging sessions onto YouTube.

Recently I have taken to running Kstars on the Astroberry which runs on my Pi4 8GB with a SSD drive. My reasons for doing this is that I want to get all the settings and workflow set up for the time when I try running my rig at a dark site.

While I am inside, I have been thinking about setting up a webcam to just point at the rig so that I can see what it is doing, and was thinking of streaming the output from the webcam through the raspberry Pi to a host on my network.

I have been able to do this with the following script:
#!/bin/bash
ffmpeg -loglevel panic -i /dev/video0 -video_size 1920x1080 -codec:v h264_omx -b:v 2048k -f flv rtmp://my-rtmp-server:1935/live/mykey > /dev/null 2>&1 < /dev/null

What are people's thoughts on doing this at the same time as running Kstars / INDI on the same Pi4? I could fiddle and reduce the resolution etc...

Anyone do this on a regular basis and have some low-resource hungry settings for ffmpeg? It's quite a minefield of configuration options, so thought I would ask.

FYI - The RTMP server is Nginx, and I can connect to the stream from OBS-Studio on my desktop, which is where I stream from.
3 years 2 months ago #66564

Please Log in or Create an account to join the conversation.

  • Posts: 407
  • Thank you received: 74
It may help :

1. I Use one in Obsys like attached picture - it uses either Wifi or Wired (I use wired) but the wifi can act as an AP see below abount comment on network usage

2. I would not,IMHO, use it on the Indi Attached PI Wifi network or attached directly to your PI as it will/could have a direct effect on your processing power and Network performance. USB Web cams have the same effect plus power usage.

3. Mine does have a Infra red LED's so you need to switch it off during actual imaging. So maybe the good old Analogue Samsung 435 I used to use was better as it didn't have the LED's

4. Its useful to watch the clouds approaching LOL when you wonder why your image is suddenly poor!

You can get the "baby Cams" which again use Wifi or Wired and if using Wifi just need power supply (mostly 12v) or perhaps one the DIY ESP32 web server cams www.instructables.com/Getting-Started-Wi...Streaming-Video-Usi/ , PI Zero (or other) with PI CAM noir - last 2 not going to get HD quality - if reqd.

I find mine useful in many ways . P.S i use Ispy (but there are Linux equiv) to directly connect to the camera!
RPI3 Ubuntu 16.04 / AMD desktop Kstars under Ubuntu 16.04 Mounts :azeq6 ,SWAZGoTo

RPI3 Fedora testing out on AMD desktop Fedpra 28 - running kstars 2.9.4 , Indilib 1.7.4 ?????
Last edit: 3 years 2 months ago by Clive Stachon.
3 years 2 months ago #66567
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 348
  • Thank you received: 69
Yes, if this were for an observatory then I would certainly look at something like what you are using. In my case it is a webcam on a camera mount.

I'd be quite happy with 640x480, or 320x240 resolution really, it is just to have some form of view of the mount remotely when at my desktop.

If using the same Pi then for power I'd be plugging it into the spare port on my Pegasus PBA, so it shouldn't (hopefully), drain, or cause, Raspberry Pi power issues - although perhaps USB Bandwidth might turn out to be an issue?

In initial tests, ffmpeg at 640x480 & 320x240 was running a bitrate of < 1Mbps and load on the Pi was < 1.0, although the USB bandwidth is probably higher, and that bitrate is probably the H264_OMX encoded rate then USB bandwidth might be an issue.

I still have the option of running this on a different Raspberry Pi if necessary, or run a longer USB extension cable to a laptop indoors. Just wondered if anyone had tried, and had a story to tell...
3 years 2 months ago #66568

Please Log in or Create an account to join the conversation.

  • Posts: 348
  • Thank you received: 69
Further to this, I then went to try out gstreamer, and found the following worked OK:
gst-launch-1.0 v4l2src device=/dev/video0 ! \
       videoconvert ! \
       videoscale ! \
       "video/x-raw,width=848,height=480,framerate=30/1" ! \
       omxh264enc target-bitrate=1000000 control-rate=variable ! \
       video/x-h264,profile=high ! \
       h264parse ! \
       queue ! \
       flvmux name=mux ! \
       rtmpsink location='rtmp://<my-rtmp-server>:1935/live/mykey'

There was still a lag, so now I have tried this MJPEG streamer: github.com/jacksonliam/mjpg-streamer

I start it with the following:
mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 1920x1080" -o "output_http.so -w /usr/local/share/mjpg-streamer/www"

My Webcam has this MJPEG format natively, so now there is less than a second lag for streaming and I can stream into OBS with "http://pi-camera:8080?action=stream"

The load on the pi doesn't go above 0.17... (no H264 encoding being done...), and I get smooth HD quality too.
3 years 2 months ago #66606

Please Log in or Create an account to join the conversation.

Moderators: Radek Kaczorek
Time to create page: 0.421 seconds