Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StreamServer Remotely #230

Closed
bnare opened this issue Jul 3, 2014 · 10 comments
Closed

StreamServer Remotely #230

bnare opened this issue Jul 3, 2014 · 10 comments

Comments

@bnare
Copy link

bnare commented Jul 3, 2014

streaming_flow
Hi everyone,

I have create the next HelloWord : https://github.com/sarxos/webcam-capture/blob/master/webcam-capture-examples/webcam-capture-live-streaming/src/main/java/us/sosia/video/stream/agent/StreamServer.java
The server is launched on localhost and I can connect on with the StreamClient : https://github.com/sarxos/webcam-capture/blob/master/webcam-capture-examples/webcam-capture-live-streaming/src/main/java/us/sosia/video/stream/agent/StreamClient.java
but the problem is that the server broadcast the stream on my locally computer only ( I looked with Wireshark, and no query has been sent on my locally network ).

How can access the server remotely ?

Thanks

@bnare
Copy link
Author

bnare commented Jul 4, 2014

By the way,
I finally find a library that allows me to display easily a webcam stream !
Very good job Sarxos ;-)

@bnare
Copy link
Author

bnare commented Jul 4, 2014

This issue can be closed, I have find the problem.
We must create the server with the local adress ip, for example 192.168.1.10 and you can reach the server locally (I suppose that nat on the modem is forced if you would like access from internet)

@sarxos
Copy link
Owner

sarxos commented Jul 9, 2014

Hi @bnare,

Sorry for late response but I was not able to make it faster.

Congratulations on the good job should go to @hepin1989 since he is the author of this live streaming example :)

Indeed, the server must be bound to different interface (eth0 instead of lo) to perform streaming over the internet since localhost is not visible from the outside. I will clarify this in README notes.

@sarxos sarxos closed this as completed in 80f9e3c Jul 9, 2014
@bnare
Copy link
Author

bnare commented Jul 9, 2014

I still have a problem, despite having open a port on the modem, someone cannot access to my stream, but perhaps it's because the port should be open either side of the connection ?

For example :

  • My public IP is 88.72.62.15 and my local IP is 192.168.1.10,
  • I create a stream on 192.168.1.10 on the port 20000 (I have no problem to access with a machine on the same network),
  • I open a port on my modem to redirect 88.72.62.15:20000 on 192.168.1.10:20000,
    But a people who try to connect on 88.72.62.15.20000 see nothing.

I suppose there is something that I do not understand :-!

Note : to test the connection you can use a simple network browser you can see the stream displayed with strange char encoded :-) (example : http://192.168.1.10:20000 if the machine is on the same network)

@reivak
Copy link

reivak commented Jul 9, 2014

bnare, for my current project I am doing video streaming and had a similar problem as you but I am using MJPG-streamer. Go to one of the websites below and test to make sure port 20000 is actually open, sometimes you also have to enable the port in your firewall.

Also, in my modem, when doing port forwarding I have the option to either use TCP, UDP, or Both. I currently have my option set to both and is working fine but you can play around with those settings and see if it makes a difference. Hope it helps.

@bnare
Copy link
Author

bnare commented Jul 10, 2014

I'm not alone with this problem :-)
My Firewall is down and I have activate for TCP and UDP.
I sould do other tests this weekend with a second IP ;-)

@He-Pin
Copy link

He-Pin commented Jul 10, 2014

Hi,I think for the broadcast,you could do a better way than redirect.
you could forward the streaming data to the public IP:PORT,the the other client cloud connected in.
for the tips:
if we are using netty:
1,binding on a well known address and port,and add all incoming client to the ChannelGroup,then when you may need to broadcast the upstream data to the other channels in the ChannelGroup,or you could bound on another port,then the camera will send the stream data to it.
2,when you client connected to the server ,you will see the video .

@sarxos I really want to update the example ,but I am learning Play & scala & akka for a while ,so I left a while form this project,and I even come up a idea that how about using hawtjni with native code for the data grabbing .and upgrade the netty dependence from netty3 to netty4.and how about stream the data to Play for an browser based stream?

anyway ,I will fork and make a update for this example,cause I dig this hole,and my skill +++now,thanks sarxos,for this nice and great project ,you teach me so much.

@He-Pin
Copy link

He-Pin commented Jul 10, 2014

and for the network binding ,I think you should binding on 0.0.0.0 instead of 127.0.0.1

@bnare
Copy link
Author

bnare commented Jul 11, 2014

@hepin1989 very good job also ;-)
I think it's a great idea to create a real stream server by broadcast UDP stream

@He-Pin
Copy link

He-Pin commented Jul 11, 2014

UDP,body size limited

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants