0

I have a Raspberry 2 with its camera module. I have it installed and it works pretty fine in my local network.

When I execute :

raspivid -o - -t 0 -n -w 600 -h 400 -fps 20 | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/}' :demux=h264

I can go in vlc to get the stream using :

rtsp://192.168.1.1:8554/

Great.

But i want the stream from my IP address (89.92..). I cannot make it works.

I have to configure ma box to redirect the port 8554 to my rpi ? I have to create an account on noip.com for example ? (this is done, but when I access to http://domain.ddns.net I have an error : "404 Not found (/) VideoLAN". So it means it is comunicating whith the raspberry but I cannot get the stream.

Do you have any ideas ?

Here is my port configuration :

port config

5
  • If you wish to reach a port which is not 80 with HTTP, you must specify it: http://foo.com:8554/bar.
    – goldilocks
    Commented Jun 20, 2015 at 10:14
  • I want make it works in vlc, this does not work : rtsp://***.***.***.***:8554/
    – Boris
    Commented Jun 20, 2015 at 15:05
  • As with your previous question, this is not really pi specific. I mention that because if you want help solving networking issues, you probably want as broad an audience as possible, and not the narrowest, smallest one you can possibly find. But first you'll have to apply basic problem solving techniques and reduce this down to as simple a version of the problem as you can -- you've confused the issue by saying it is about the camera and video feed.
    – goldilocks
    Commented Jun 20, 2015 at 15:25
  • 1
    It is not about the camera and video feed, it is simply about reaching a computer on your LAN from outside. If you can reach the pi for some other purpose this way, but not the video feed, it is either because of a firewall on the pi, on your router, or on the machine you are using to try the access. WRT a firewall on the pi, that would have to have been configured by you, because most normal distros don't have one configured by default. In this case, it simply has absolutely nothing to do with the pi.
    – goldilocks
    Commented Jun 20, 2015 at 15:26
  • 1
    If you cannot reach the pi for any purpose, then whether or not the ultimate goal involves a video feed or some particular port is totally irrelevent. You can't connect to anything, much less something in particular. In this case, it still has almost nothing to do with the pi. Yet here you are asking a tiny community about a topic significant to at least three orders of magnitude more people. Put more bluntly, you are wasting your time trying this way. No one here is going to diagnose this beyond what's already been done. Again: basic problem solving skills.
    – goldilocks
    Commented Jun 20, 2015 at 15:26

1 Answer 1

2

It depends on if your ISP provides a public IP or not.

If it's the case, you simply have to forward the relevant port (in this case, 8554) from your router. Even though, you're assigned IP dynamically each time you connect, you can make use of dynamic dns services like no-ip / dyndns.

If your ISP doesn't provide a public IP and most of the ISPs do not. You will have to create tunnel that would remote forward your port from RPi to a server publicly available and you can catch your stream from that server's IP : relevant port.

It looks graphically like this.

RPi behind NAT <==> Public server <==> your device

Hope it helps.

Here is a guide how to do it.

http://www.tunnelsup.com/raspberry-pi-phoning-home-using-a-reverse-remote-ssh-tunnel

Hope it helps.

========================================================================= Edit: (Answer to questions asked in comments)

So how to test if your ISP provides a static IP ? Google "my ip" from your computer, if it is same as listed under 3G / 4G / WAN IP under your router ? If Yes, you've a public IP. Otherwise no. Here's an example.

IP acquired by my 3G modem

My ip result

How to forward port in this case ?

In most routers, there's an option for port forwarding. See snapshot.

Forwarding page

You asked if no-ip / dyndns can be used to address later case. Answer is : No. Because your IP is behind NAT. dyndns / no-ip sees your public ip and points to your public ip not an actual IP behind the NAT.

Hope it helps.

6
  • I think my ISP provides a static IP address. But event if it's not the case, with noip this should work, no ? But let's say i have a static IP address (at least for the test). How can I access to my camera ? From the browser I have a 404 page vith the text "VideoLan". So it means i can communicate with my rpi. But i cannot get the stream. I missed a configuration ?
    – Boris
    Commented Jun 19, 2015 at 16:19
  • @Boris Edited my answer to answer your questions. Commented Jun 19, 2015 at 16:42
  • Also, you're trying to listen rtsp stream with your browser. You should try to listen it with vlc. (public-ip:port) provided you forwarded your port properly. Commented Jun 19, 2015 at 16:49
  • Thans for your answers. I have a static IP. But when in vlc I try with "rtsp://89.92.***.***:8554/" with the 4G, it does not work (but it does with rtsp://192.168.1.1:8554/ in the local network)
    – Boris
    Commented Jun 19, 2015 at 19:57
  • Did you forward the port ? You can check it by forwarding ssh port and see if you're able to connect to pi via ssh from public ip address. Commented Jun 20, 2015 at 4:04

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.