Author Topic: Webcam Stream URL  (Read 1387 times)

Webcam Stream URL
« on: 10 April, 2021, 04:37:01 pm »
I've got a Logitech C270 webcam which connects USB to my laptop.  I can see the output of it in various programs (apps) on the laptop.

I am using a web based app to monitor my 3D printer and it can log the webcam on it.  It is asking for a stream URL for the camera.  It says it needs to be reachable from the browser displaying the 3D printer UI.

How, what , where, when etc?

Help please.

R

Kim

  • Timelord
    • Fediverse
Re: Webcam Stream URL
« Reply #1 on: 10 April, 2021, 05:30:31 pm »
You need some sort of software to turn the camera into a, well, webcam.  There's probably some horrible Logitech application for the purpose.  Or possibly not, given that they assume everyone's behind NAT and will presumably be streaming using Youtube or similar.

I bet VLC can do it...

Re: Webcam Stream URL
« Reply #2 on: 10 April, 2021, 05:33:52 pm »
The utility for this (Octoprint) on Linux is called mjpgstreamer. There appears to be a Windows version.

Re: Webcam Stream URL
« Reply #3 on: 10 April, 2021, 06:02:01 pm »
Looks like mpg streamer is on the windows store!

Ta muchly.

Re: Webcam Stream URL
« Reply #4 on: 10 April, 2021, 06:15:31 pm »
OK, got it and I can see the webcam on it, but the only thing I can see on the app that looks like streaming is HTTP server port 8000.  There's nothing else that gives me a clue what to do next.

Looks like this:


Kim

  • Timelord
    • Fediverse
Re: Webcam Stream URL
« Reply #5 on: 10 April, 2021, 06:32:42 pm »

Re: Webcam Stream URL
« Reply #6 on: 10 April, 2021, 07:34:49 pm »
Mine is http://localhost:8000/?action=stream for the streaming and http://localhost:8000/?action=snapshot for the time lapse.

Re: Webcam Stream URL
« Reply #7 on: 11 April, 2021, 10:16:33 am »
I'm afraid that doesn't work.  I assume if I type localhost:8000 etc into the browser I should see the camera?

I was wondering if I need to do anything like this:

https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server

https://stackabuse.com/serving-files-with-pythons-simplehttpserver-module/

Thanks for your help so far.

Re: Webcam Stream URL
« Reply #8 on: 11 April, 2021, 10:30:05 am »
I'm afraid that doesn't work.  I assume if I type localhost:8000 etc into the browser I should see the camera?

You should see *something* when you go to that address while the MJPG streamer thing is running, even if it's just an error page or what have you.

Feanor

  • It's mostly downhill from here.
Re: Webcam Stream URL
« Reply #9 on: 11 April, 2021, 10:36:08 am »
I'm afraid that doesn't work.  I assume if I type localhost:8000 etc into the browser I should see the camera?

Using a browser on the same machine which the streamer is running on, then yes you should see *something*.

If you are not, then I'd guess it's a windows firewall issue.
Did the installer say anything about creating a rule in the firewall?
If it didn't, then I expect you will need to do this manually.

You will need to create an inbound rule to permit the connection.
You can create a rule for either the port ( TCP, 8000 ), or the program ( you need to know exactly what .exe to point it at ).
I'd probably specify the rule by port number.

https://www.tomshardware.com/uk/news/how-to-open-firewall-ports-in-windows-10,36451.html

Re: Webcam Stream URL
« Reply #10 on: 11 April, 2021, 11:56:45 am »
Thanks but I'm struggling here.  Looks like I have AVG protecting me and Windows says the firewall is being looked after by AVG.

Still trying to work my way through the setups.

Feanor

  • It's mostly downhill from here.
Re: Webcam Stream URL
« Reply #11 on: 11 April, 2021, 12:56:07 pm »
Thanks but I'm struggling here.  Looks like I have AVG protecting me and Windows says the firewall is being looked after by AVG.

Still trying to work my way through the setups.

In that case, the installer will almost certainly not have set up any kind of exception in the AVG firewall.

You will need to create an exception in the AVG firewall for TCP port 8000.

From a quick Google, this might be where to start:
https://support.avg.com/SupportArticleView?l=en&urlName=AVG-Antivirus-Enhanced-Firewall-Packet-Rules&q=How+to+block+or+allow+IP+addresses+in+Firewall&supportType=home

Scroll down to the section on Customise Packet Rules, and follow the instructions to Add a new packet rule.

The screenshot doesn't show everything ( there's a horizontal scroll bar ), but based on the description of the rules further up the page, I'd try:

Enter a name, eg 'Streamer'
Action: Allow
Protocol: TCP(6)
Direction: In
Address: Leave blank ( all addresses )
Local Port: 8000
Remote port: Leave blank ( accept from any source port )
ICMP type: Leave blank ( not applicable, this is not an ICMP rule )
Profile: All ( this rule will be applied to all firewall profiles )



Re: Webcam Stream URL
« Reply #12 on: 11 April, 2021, 04:18:04 pm »
Sorry for the delay I was painting a banister!

Followed the procedure easily enough but no joy with localhost:8000 in the browser.  Eventually it returns timed out taking too long.

Re: Webcam Stream URL
« Reply #13 on: 11 April, 2021, 04:29:47 pm »
Turn off AVG then try it again. If it works it’s your anti virus package.

Re: Webcam Stream URL
« Reply #14 on: 14 April, 2021, 02:42:37 pm »
Apologies for the lack of response but MPG Streamer has stopped working, just opens and immediately closes again, so I haven't looked into this any further.  A fresh install is probably called for.