I have a problem with motion. I created a web page where I put my motion video, like this:

<h1 style="font-family:calibri;">Camara de Raspberry Pi</h1>
<br /><img src="http://192.168.1.x:8087"/>

And it works well if I'm on my network, but if I try to access it from outside my network it shows the web page, but where the video should be it there is the typical broken image icon, but no video at all.

I'm not an English speaker, in case you don't understand something please ask me

2 Answers 2


The problem is that you are using a local ip for the image src the src should not have a 192.168.1.x but instead be the same ip that you are accessing the pi from. because 192.168.1.x ip's are inky made available to your local network, please change that ip to the one that you are accessing the webpage with such as so that your code will look like the following:

<br /><img src=""/>

Be sure to also forward port 8087 on your router as you have done with port 80

Note: is the IP address of example.com and is here solely for example purposes.

  • Oh! Okay, I'll try that... so... there should be a port forwarding for 8087 also, and not just the 80?
    – gloaiza
    Commented May 17, 2016 at 15:17
  • yes you will need port forwarding on port 8087 aswell Commented May 17, 2016 at 15:18
  • Thank you, but the thing is... I want it to be in the web page so I can make a login page to make it more secure, but if I do the port forwarding in the 8087, anyone could see it... ¿Am I right?
    – gloaiza
    Commented May 17, 2016 at 15:27
  • Yes anyone could, but this is what you were asking for, if you need security help your going to need write up a new question, please mark this one as correct if it solves the problem at hand. or at least talk about what your using to run the video, maybe your server on port 8087 could be able to check for an authentication token before starting the feed? Commented May 17, 2016 at 15:42

If you want to browse the stream from the raspberry pi itself, consider updating the motion config that was updated since version 4.

motion --version


stream_localhost off
stream_port 8087

I did the test locally, it worked well with no port redirection.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.