janus watching over internet, next steps

421 views
Skip to first unread message

Simon Rückert

unread,
Jul 30, 2015, 2:04:15 AM7/30/15
to meetecho-janus
Hello,

First, thanks a lot for janus. I have implemented it on my Raspberry PI, and was guided by this two posts and the git samples of course:
http://www.rs-online.com/designspark/electronics/blog/building-a-raspberry-pi-2-webrtc-camera
https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=99283&p=693103#p693103

It is working now for me in FireFox and in local network. That makes me happy :)


But my main goal is to connect from outside of my local network. As far as i understood i need to install the janus server on a linux machine with a public ip adress (this is then my STUN Server) instead of running it on my RasberryPI instance which is also the media source instance. At the moment and after some research i have no idea how to start installing Janus on an cloud server and configure clients to use the external Janus server.
I have two Questions:

1. Do you have a usefull tutorial implementing Janus in a way it will work without local network?
2. Which format/settings should i use that i can watch the video/audio stream in Chrome,FireFox, InternetExplorer and Android/iOs Apps?


Any advice is apreciated…


Best regards,

Simon

Lorenzo Miniero

unread,
Jul 30, 2015, 4:00:23 AM7/30/15
to meetecho-janus, thalesvo...@gmail.com, thalesvo...@gmail.com
You install Janus the same way you install it anywhere.
Internet Explorer doesn't support WebRTC. The only codec all compliant browsers support is VP8.

L.

Simon Rückert

unread,
Jul 30, 2015, 6:56:33 AM7/30/15
to meetecho-janus, lmin...@gmail.com
Thanks for trying to give a response to each question in this group.
Yes of course but how do i use this new server instead of the local one? Which config files i have to change?
Was my assumption right, that i can stream to outside my local network, when installing it on a server with static ip?
Or do i need to take other steps? Are there helpfull tutorials that guiding threw the steps making it public available?

Thanks a lot.

Lorenzo Miniero

unread,
Jul 30, 2015, 6:58:41 AM7/30/15
to meetecho-janus, thalesvo...@gmail.com, thalesvo...@gmail.com
The default configuration files are usually fine wherever you deploy Janus. Everything else (contacting the remote server or sending a stream there) is a matter of how you setup clients: just set the server IP instead of localhost in the gstreamer pipeline.

L.

Simon Rückert

unread,
Jul 31, 2015, 9:06:29 AM7/31/15
to meetecho-janus, thalesvo...@gmail.com, lmin...@gmail.com

Hello,

 

I have intalled the janus gateway now on an Azure VM with Ubuntu 14 LTS.

I have opened following Ports for Janus (80, 443, 7088(admin)TCP, 8088(signalPort) TCP, 8004(udpsink) UDP)

 

I can send the streams, but when i start streaming with the streaming demo. I get following Error and the Streaming stops, video is never visible then.

 

Current error: [ERR] [ice.c:janus_ice_cb_component_state_changed:1114] [2618639093] ICE failed for component 1 in stream 1...

 

I have the exact same settings as they are working locally. Only difference is that  i have hosted the Janus Demos in a nodejs server instead a nginx server.

 

Do you have any idea what is the source of the problem?

 

 

Thanks for support,

 

Simon

Lorenzo Miniero

unread,
Jul 31, 2015, 9:23:29 AM7/31/15
to meetecho-janus, thalesvo...@gmail.com, lmin...@gmail.com
Those ports are only for signalling. WebRTC dynamically uses a whole additional number of ports. You can try to limit them in janus.cfg if libnice is recent enough (e.g., from 10000 to 20000). Without those, ICE will always fail and you won't be able to watch anything.

L.

Simon Rückert

unread,
Jul 31, 2015, 9:31:56 AM7/31/15
to meetecho-janus, thalesvo...@gmail.com, lmin...@gmail.com
So i should open port range  40000-50000 for UDP and TCP on the JanusSignalingServer?

Lorenzo Miniero

unread,
Jul 31, 2015, 9:38:13 AM7/31/15
to meetecho-janus, thalesvo...@gmail.com, lmin...@gmail.com
Whatever range of ports you open, configure Janus to only use those as I said in my previous mail, otherwise it will pick other ports that you did not open instead.

Simon Rückert

unread,
Jul 31, 2015, 11:45:37 AM7/31/15
to meetecho-janus, thalesvo...@gmail.com, lmin...@gmail.com
Ok thank you, so i will add the port range i opened in Azure to the  rtp_port_range = 40000-50000 property in the [media] section of the janus.cfg file.



Sorry for the stupid questions... This MediaStreaming Topic is really huge, i have ordered the WebRTC O'Reilly books of one of your colleagues.

Simon Rückert

unread,
Aug 2, 2015, 12:07:11 AM8/2/15
to meetecho-janus, thalesvo...@gmail.com, lmin...@gmail.com
I have opened all ports in azure and on ubuntu for tcp and udp.
The ILPIP of the JanusGateway and WebFrontend Server is:

I stream there like this:
raspivid --verbose --nopreview -hf -vf --width 640 --height 480 --framerate 15 --bitrate 1000000 --profile baseline --timeout 0 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=137.116.196.147 port=8004


When i now try to start the stream from streaming demo it says:
Session: 3997884238

 

Session 3997884238 found... returning up to 1 messages

[janus.c:janus_ws_notifier:2533] ... handling long poll...

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 :STUN transaction retransmitted (timeout 1196ms).

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 :STUN transaction retransmitted (timeout 1189ms).

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 : timer tick #51: 0 frozen, 2 in-progress, 0 waiting, 0 succeeded, 0 discovered, 0 nominated, 0 waiting-for-nom.

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 :STUN transaction retransmitted (timeout 2385ms).

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 :STUN transaction retransmitted (timeout 2399ms).

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 : timer tick #101: 0 frozen, 2 in-progress, 0 wai                                              ting, 0 succeeded, 0 discovered, 0 nominated, 0 waiting-for-nom.

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 : timer tick #151: 0 frozen, 2 in-progress, 0 wai                                              ting, 0 succeeded, 0 discovered, 0 nominated, 0 waiting-for-nom.

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 : timer tick #201: 0 frozen, 2 in-progress, 0 wai                                              ting, 0 succeeded, 0 discovered, 0 nominated, 0 waiting-for-nom.

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 :STUN transaction retransmitted (timeout 4789ms).

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 :STUN transaction retransmitted (timeout 4783ms).

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 : timer tick #251: 0 frozen, 2 in-progress, 0 wai                                              ting, 0 succeeded, 0 discovered, 0 nominated, 0 waiting-for-nom.

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 : timer tick #301: 0 frozen, 2 in-progress, 0 wai                                              ting, 0 succeeded, 0 discovered, 0 nominated, 0 waiting-for-nom.

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 : timer tick #351: 0 frozen, 2 in-progress, 0 wai                                              ting, 0 succeeded, 0 discovered, 0 nominated, 0 waiting-for-nom.

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 : timer tick #401: 0 frozen, 2 in-progress, 0 wai                                              ting, 0 succeeded, 0 discovered, 0 nominated, 0 waiting-for-nom.

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 : Retransmissions failed, giving up on connectivi                                              ty check 0x7fc680034000

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 : pair 0x7fc680034000 state FAILED

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 : Retransmissions failed, giving up on connectivi                                              ty check 0x7fc668004000

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 : pair 0x7fc668004000 state FAILED

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 : timer tick #450: 0 frozen, 0 in-progress, 0 wai                                              ting, 0 succeeded, 0 discovered, 0 nominated, 0 waiting-for-nom.

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 : priv_conn_check_tick_unlocked: stopping connche                                              ck timer

(process:5721): libnice-DEBUG: Agent 0x7fc680007bc0 : stream 1 component 1 STATE-CHANGE connecting ->                                               failed.

[362133931] Component state changed for component 1 in stream 1: 5 (failed)

[ERR] [ice.c:janus_ice_cb_component_state_changed:1114] [362133931] ICE failed for component 1 in str                                              eam 1...

[362133931] Telling the plugin about it (JANUS Streaming plugin)

No WebRTC media anymore

[362133931] Notifying WebRTC hangup

[362133931] Adding event to queue of messages...



I try to make that work for for more than 15 hours, so any advice is appreciated...



Am Freitag, 31. Juli 2015 15:38:13 UTC+2 schrieb Lorenzo Miniero:

Lorenzo Miniero

unread,
Aug 3, 2015, 4:26:29 AM8/3/15
to meetecho-janus, thalesvo...@gmail.com, lmin...@gmail.com
Check the admin API and look at the local and remote candidates for that handle.

L.
...
Message has been deleted

Simon Rückert

unread,
Aug 7, 2015, 9:49:41 PM8/7/15
to meetecho-janus, thalesvo...@gmail.com, lmin...@gmail.com
Thank you for the support. I have it working now :)
I get a lot of NACK logs, i think its because of i have only a bandwidth of 1720kBit/s downstream and 400kBit/s upstream. You also think that might be the Problem?
Do you have an idea how i could improve the performance?

The Infos i get in Janus all the time:

[2053489356]     Just got some NACKS (106) we should handle...
The Error Gstreamer is throwing after a while:

WARNING: from element /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: Can't record audio fast enough
Additional debug info: gstaudiobasesrc.c(857): gst_audio_base_src_create (): /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0:
Dropped 4240 samples. This is most likely because downstream can'
t keep up and is consuming samples too slowly.


Thats how the endpoint is configured in Janus:
[gstreamer-monitor-h264]
 type
= rtp
 id
= 2
 description
= H.264 live stream coming from gstreamer
 audio
= yes
 video
= yes
 audioport
= 8003
 audiopt
= 111
 audiortpmap
= opus/48000/2
 videoport
= 8005
 videopt
= 126
 videortpmap
= H264/90000
 videofmtp
= profile-level-id=42e01f\;packetization-mode=1
 secret
= adminpwd
Thats the shell script to gstream audio and video (might it save some hours for other Raspberry users:):
#!/bin/bash -e
gst
-launch-1.0 -v alsasrc device=plughw:Set ! mulawenc ! rtppcmupay ! udpsink host=137.116.196.147 port=8003 &
raspivid
-n -w 640 -h 480 -b 100000 -fps 2 -vf -hf -t 0 -pf baseline -o - | gst-launch-1.0 -v fdsrc fd=0 ! h264parse !  rtph264pay config-interval=2 pt=126 ! udpsink host=137.116.196.147 port=8005

Lorenzo Miniero

unread,
Aug 9, 2015, 1:57:53 PM8/9/15
to meetecho-janus, thalesvo...@gmail.com, lmin...@gmail.com
Bandwidth can be an issue, especially if you have low uplink and you're the server.

L.

Simon Rückert

unread,
Aug 9, 2015, 8:02:55 PM8/9/15
to meetecho-janus, thalesvo...@gmail.com, lmin...@gmail.com
Ok, but im just the one whos streaming.
Reply all
Reply to author
Forward
0 new messages