Browsers working on localhost but not in LAN using h264 encoding

437 views
Skip to first unread message

Guilherme Rolo

unread,
Feb 19, 2020, 11:39:11 AM2/19/20
to meetecho-janus
Hello,

I have a video stream being sent by a Nvidia Jetson Nano. This stream is encoded in H264 and the profile-level-id is 42e01f.

On the client side, on localhost, Chrome and FireFox work perfectly. In the same LAN, only FireFox shows the video stream.

In the admin API, the session that is attached to the stream in localhost Chrome, has  data on the out_stats as following:

https://pastebin.com/H9ar88Xz

In firefox localhost:



However, in the admin API when a client in the same LAN connects in Google Chrome, the out_stats is as follows:


This is the output in Janus when connected in LAN:

[WARN] [6870914578873958] Couldn't resolve mDNS address (9fe409d1-c530-49ca-9c84-ce178576e9cf.local), dropping candidate
 [ERR] [ice.c:janus_ice_trickle_parse:764] [6870914578873958] Failed to parse candidate... (8) 
[WARN] [6870914578873958] ICE failed for component 1 in stream 1, but let's give it some time... (trickle received, answer received, alert not set) 
[ERR] [ice.c:janus_ice_check_failed:1691] [6870914578873958] ICE failed for component 1 in stream 1...
[janus.plugin.streaming-0x7f2348003400] No WebRTC media anymore [6870914578873958] WebRTC resources freed; 0x7f2348006810 0x7f23480035b0

After this messages, the admin API shows as follows:


On the other hand in Firefox, it works as expected:




To launch the stream, this is the code used:

gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, framerate=30/1' ! nvv4l2h264enc  profile=0 bitrate=8000000 insert-sps-pps=true ! rtph264pay mtu=1400 ! multiudpsink clients=127.0.0.1:5000,192.168.1.77:" + str(msg) + " sync=false async=false

What we've tried so far:

- Swapping between omx and v4l2 with no success.
- Trying different profile levels with no success.
- Using sdp_ip with public address (to avoid mDNS Warning)

There are some issues that make me quite confused regarding the compatibilities with the browsers: 
On android, we can watch the video stream in Chrome but NOT on FireFox in LAN, but we can't on Linux. Windows, for some reason don't work on either. Neither does MacOS.

Mobile firefox has this output on Janus:

[ERR] [sdp.c:janus_sdp_process:351] [5312699124448869] SDP missing mandatory information
[ERR] [sdp.c:janus_sdp_process:352] [5312699124448869] (nil), (nil), 0x7f3940001ab0, 0x7f3940001ce0
[ERR] [janus.c:janus_process_incoming_request:1321] Error processing SDP

I don't understand why would chrome work on localhost and not on other devices in Linux.

The libnice version is 0.1.15
The janus-gateway version is from 13 January 2020 and it's this commit 1e6ac78842ba76613ea0991dda7b1e28078507be.

Thanks in advance,
Guilherme Rolo

Alessandro Amirante

unread,
Feb 19, 2020, 12:12:54 PM2/19/20
to Guilherme Rolo, meetecho-janus
This is the culprit:

[ERR] [ice.c:janus_ice_check_failed:1691] [6870914578873958] ICE failed for component 1 in stream 1...

The browser if failing to establish a PeerConnection with Janus. There are several reasons why this can happen. The most likely one is related to the IP handling policy browsers enforce in different ways. In fact, in the broken Admin API from Chrome you don't have any "host" remote candidate.

A.

--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/affea524-178b-410e-a52f-69ca12ea3b62%40googlegroups.com.

Guilherme Rolo

unread,
Feb 19, 2020, 1:14:11 PM2/19/20
to meetecho-janus
Thanks for the fast reply.
How can I work around the IP policy handling?
What can be done in order to double check how the remote host is behaving?

Dario Pedro

unread,
Feb 21, 2020, 10:29:26 AM2/21/20
to meetecho-janus
I've the same issue. I've tried blocking my local IP on firefox and the behaviour becomes the same as Chrome (no video). This indeed proves your theory. 

Do you have any solution / work-around for this problem ? What would be your suggestion to visualize H264 coming from Janus on Google Chrome ?

\Thanks in advance for your help.
To unsubscribe from this group and stop receiving emails from it, send an email to meetech...@googlegroups.com.

Burak Senyuva

unread,
Feb 25, 2020, 8:48:41 AM2/25/20
to meetecho-janus
Did you tried to play with nat_1_1_mapping setting in janus.jcfg?

Also please check streaming config for H264 and ensure there is "videofmtp = "profile-level-id=42e01f;packetization-mode=1" line as sample config:

# All browsers also support H.264, often through Cisco's OpenH264 plugin.
# The only profile that is definitely supported is the baseline one, which
# means that if you try a higher one it might or might not work. No matter
# which profile you encode, though, you can put a custom one in the SDP if
# you override the fmtp SDP attribute via 'videofmtp'. The following is an
# example of how to create a simple H.264 mountpoint: you can feed it via
# an x264enc+rtph264pay pipeline in gstreamer, an ffmpeg script or other.
#
h264-sample: {
        type = "rtp"
        id = 10
        description = "H.264 live stream coming from gstreamer"
        audio = true
        video = true
        audioport = 5006
        audiopt = 111
        audiortpmap = "opus/48000/2"
        videoport = 5008
        videopt = 102
        videortpmap = "H264/90000"
        videofmtp = "profile-level-id=42e01f;packetization-mode=1"

Ricardo Sacoto Martins

unread,
Feb 26, 2020, 5:30:10 AM2/26/20
to meetecho-janus
I have the same issue, and have already tried to set the nat_1_1_mapping under janus with the public ip but the problem still resides. This time the stream on localhost using  chrome stopped playing.

Ricardo Sacoto Martins

unread,
Mar 2, 2020, 1:03:00 PM3/2/20
to meetecho-janus
We manage to fix with google's stun server and a Turn server. We used a free trial of a turn server and now we need to figure out how to config a coturn server.

Alexandre GOUAILLARD

unread,
Mar 3, 2020, 7:32:34 AM3/3/20
to Ricardo Sacoto Martins, meetecho-janus
are you sure it's worth the pain and the time, given the very low price point of services like Xirsys'  (33 USD / month with 50GB)?

On Mon, Mar 2, 2020 at 7:03 PM Ricardo Sacoto Martins <ricardoa...@gmail.com> wrote:
We manage to fix with google's stun server and a Turn server. We used a free trial of a turn server and now we need to figure out how to config a coturn server.

--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/74fa4873-5d02-462e-bfa8-4c4d4bc50010%40googlegroups.com.


--
Alex. Gouaillard, PhD, PhD, MBA
------------------------------------------------------------------------------------
President - CoSMo Software Consulting, Singapore
------------------------------------------------------------------------------------

Reply all
Reply to author
Forward
0 new messages