raspberry_livestream icon indicating copy to clipboard operation
raspberry_livestream copied to clipboard

What's the delay?

Open michaelgundlach opened this issue 7 years ago • 5 comments

Hey, thanks for writing this up! Your README and your "sharing is caring" comment are so friendly I was encouraged to bug you for input :)

I'd like to stream video from an RPi to a web page and also to a web server that will detect motion and faces. I'm looking for < 500ms video latency to the webpage (all inside a LAN)

I'm ready to duplicate your approach, but first:

  1. What latency did you see?
  2. Any reason you are aware of that I couldn't also grab frames from the stream on a server?

Thanks!

michaelgundlach avatar Jun 30 '17 17:06 michaelgundlach

Good to hear it helps ;)

  1. The setup we had differs a bit from yours, in that we were not streaming over LAN, but the WWW. There we saw delays of maximum 10 seconds. Curious to see how it works over LAN!
  2. I think that's perfectly possible!

Good luck :)

Tomtomgo avatar Jul 04 '17 07:07 Tomtomgo

Thanks for getting back to me. Feel free to ping this thread in 4 or 5 weeks to find out how it went :)

michaelgundlach avatar Jul 05 '17 10:07 michaelgundlach

Hey @Tomtomgo, I'm getting into it. Some differences vs your instructions that I've noticed, using a brand new RPi 3B+ with Raspbian Jesse:

To get nginx to ./configure:

  • I had to sudo apt-get install pcre3 and pcre3-dev (although I had forgotten to install supervisor before trying to configure nginx, so maybe supervisor would have installed pcre3 and pcre3-dev?)
  • I had to sudo apt-get install libssl-dev, or else ./configure dies suggesting I use --with-openssl=/path/to/sources

Somewhere in there I did sudo apt-get update && apt-get upgrade, and I don't know if things would have succeeded without me doing that. If that's an obvious first step for a clean RPi install, maybe you could add that to your list of commands (that I'm following blindly.)

It's not clear if <RASPBERRY_IP> in stream.sh could be "127.0.0.1", since nginx is consuming a local stream. That would be helpful in my use case, where I'm configuring the Pi to then install on a different network.

To cp stream.supervisor.conf /etc/supervisor/conf.d/stream.supervisor.conf , I had to prepend sudo.

Although the camera was physically connected (a camera module), I had to enable the camera module through sudo raspi-config, but still didn't have a /dev/video0 after that. Perhaps your instructions only work with a USB camera instead of a camera module?

There is no actual mention of using the stream.sh script :) I assume I should run it after restarting the supervisor service. When I did run it, I got a bunch of garbage output because you can't put a \ on a line and then also comment on the same line :( So your stream.sh needs to be uncommented or else be one gigantic line.

At that point I can run stream.sh, but get the error about no /dev/video0, probably because I'm on the camera module.

OK, hope this helps you update your instructions :) Any idea how to modify things for a camera module? I am able to read still images off the camera using the picamera module from here .

michaelgundlach avatar Jul 12 '17 01:07 michaelgundlach

Interesting @michaelgundlach, I would guess that the standard PI camera would work simpler than a USB camera. We only tried with a USB one, so wouldn't know how to use the PI one...

Regarding the additional steps for running ./configure, feel free to create a pull request and I'll merge!

Tomtomgo avatar Jul 20 '17 10:07 Tomtomgo

just do a: sudo apt install libssl-dev libpcre2-dev libpcre3-dev

and you have the openssl library files and the PCRE library files for http_rewrite if you are trying this on e lite raspbian

unk1nd avatar Aug 13 '19 12:08 unk1nd