Working example of IP Camera over RTSP?

3,981 views
Skip to first unread message

Chun Meng

unread,
Jul 31, 2015, 10:54:08 AM7/31/15
to meetecho-janus
Hi there,

I would like to use the rtsp streaming feature of janus-gateway to stream an IP camera over webrtc. 
I do noted the disclaimer about the format and such, but do you have an IP camera setup reference (brand, video configuration etc) that is tested to be working?

I mean this disclaimer:
;
; This is a sample configuration for an RTSP stream
; NOTE WELL: the plugin does NOT transcode, so the RTSP stream MUST be
; in a format the browser can digest (e.g., VP8 or H.264 for video)
;


I'm testing with 2 IP cameras and have tried many tweak, none of them had worked so far.

One of my setup is as below:
[rtsp-test]
type = rtsp
id = 99
description = RTSP Test
audio = no
video = yes

The video stream is configured as h264, 640x480, 30fps (also tried 15fps)

Some note/observation:
- Firefox 37 and above doesn't even accept the sdp offer properly. It returns answer like this:
v=0
o=mozilla...THIS_IS_SDPARTA-39.0 8660943037204991683 0 IN IP4 0.0.0.0
s=-
t=0 0
a=fingerprint:sha-256 34:26:72:A1:C6:19:C2:E2:52:AC:D2:1A:18:20:02:C8:67:FA:8D:48:69:90:E5:7E:D2:F1:08:B7:DE:88:3B:10
a=ice-options:trickle
a=msid-semantic:WMS *
m=video 0 RTP/SAVPF 111
c=IN IP4 0.0.0.0
a=inactive
a=rtpmap:111 NULL/0

And the session never succeed.

- Only firefox 36.0.x or below (tried down to 34) do succeed in establishing the session (status became "started"), afterward however, the video doesn't show up/render in the browser.

These are the sdp exchange between ip cam - janus - firefox

From the browser debug log and webrtc log, I can see that the stream is attached and the RTP packets are received and even reassembled. But it is not rendered for some reason.

- There's an option in the ip camera "Advanced Configuration - SPS & PPS". When this is enabled, the Firefox crash soon after the session is started.
From the wireshark log, it seems the sps and pps are sent as separate nal frame and the firefox is having problem to deal with them. It's quite sad if it's true...

Any guidance is appreciated.

Thanks
cm

Lorenzo Miniero

unread,
Jul 31, 2015, 10:58:24 AM7/31/15
to meetecho-janus, oce...@gmail.com
No idea, sorry: the RTSP functionality in the streaming plugin has been added as part of a pull request. I think it was mostly tested with RSTP servers made with VLC and others. From what you say, it's likely the H.264 the camera is generating is not something the browser can handle: AFAIK Firefox only supports the baseline profile.

L.

Tanguy Mezzano

unread,
Jan 10, 2017, 8:20:25 AM1/10/17
to meetecho-janus, oce...@gmail.com
Hi,

it doesn't work for me even with h.264 baseline profile in firefox 41.0.2.

local sdp: 
m=video 0 RTP/SAVPF 111
c=IN IP4 0.0.0.0
a=inactive
a=rtpmap:111 NULL/0

remote sdp: 
m=video 9 RTP/SAVPF 96
a=fmtp:96 profile-level-id=420010;level-asymmetry-allowed=0;sprop-parameter-sets=Z0JAIKaAUAIGQAA=,aM48gAA=

I've tried setting also those firefox fields:

media.navigator.video.preferred_codec 126
media.peerconnection.video.h264_enabled true

But not better.
My rtsp stream comes from an imx6q camera which decodes h264 in h/w.
I'm not sure to understand the payload 111 yet.

Kind regards,

Tanguy

Lorenzo Miniero

unread,
Jan 10, 2017, 9:13:54 AM1/10/17
to meetecho-janus, oce...@gmail.com
I think your problem is here:

a=inactive
a=rtpmap:111 NULL/0

L.

Hasan Tekin

unread,
Sep 24, 2017, 2:05:47 PM9/24/17
to meetecho-janus
Hi, did you get any results with ip cameras? Can you please share your latest findings?

Thank you.

Lorenzo Miniero

unread,
Sep 24, 2017, 5:36:55 PM9/24/17
to Hasan Tekin, meetecho-janus
Works just fine for me with a popular Foscam model.

L.

Il 24 set 2017 8:05 PM, "Hasan Tekin" <trium...@gmail.com> ha scritto:
Hi, did you get any results with ip cameras? Can you please share your latest findings?

Thank you.

--
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-janus+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hasan Tekin

unread,
Sep 25, 2017, 5:26:02 AM9/25/17
to meetecho-janus
I'll give it a try then. Thank you.


On Monday, September 25, 2017 at 12:36:55 AM UTC+3, Lorenzo Miniero wrote:
Works just fine for me with a popular Foscam model.

L.
Il 24 set 2017 8:05 PM, "Hasan Tekin" <trium...@gmail.com> ha scritto:
Hi, did you get any results with ip cameras? Can you please share your latest findings?

Thank you.

--
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.

Lorenzo Miniero

unread,
Sep 25, 2017, 5:29:38 AM9/25/17
to meetecho-janus
Notice that for the H.264 generated by some cameras you may have to overwrite the video fmtp they provide in the SDP:

L.

Anton Smith

unread,
Sep 25, 2017, 8:14:56 AM9/25/17
to meetecho-janus
Hi Lorenzo,

as I've been wrestling with this a bit in the past (as you may remember), and editing janus.js to edit the profile before submitting browser side, I think it could be good if the "videofmtp" could also work for "type = rtsp", i.e. overwrite it.

At the moment I understand that using this in an rtsp stanza does nothing. Maybe this doesn't make sense but it would be easier than editing janus.js from a user perspective.

Regards,
Anton

Lorenzo Miniero

unread,
Sep 25, 2017, 8:48:52 AM9/25/17
to meetecho-janus
That's what I meant: we already implemented that.

L.

Anton Smith

unread,
Sep 25, 2017, 8:52:52 AM9/25/17
to meetecho-janus
Ahh my bad, I was working from memory where videofmtp was stated to work with rtp but not rtsp. This is great, so I can stop hacking janus.js :-). Thanks!

Lorenzo Miniero

unread,
Sep 25, 2017, 8:54:18 AM9/25/17
to meetecho-janus
You'll need a relatively recent version of Janus, though.

L.
Reply all
Reply to author
Forward
0 new messages