Janus + Wowza + RSTP via Trax

875 views
Skip to first unread message

Sassy Natan

unread,
May 12, 2016, 12:21:57 PM5/12/16
to meetecho-janus
Hi All,

I stream a video from a Trax to my Wowza Machine.
Wowza get a H264 + AAC file and publish it to a CDN via RTMP.
It also provide a RTSP stream which can be played under VLC.

In VLC media information I get the following: 
(basic mp4a with H264 29 frames 4:2:0 YUV)


I compiled Janus on my Ubuntu server 14.04, and managed to play the demos streaming.

So far all good.

I define my RSTP in janus.plugin.streaming.cfg like this:

[rtsp-test]
type = rtsp
id = 99
description = RTSP Test
audio = yes
video = yes
videopt = 96
videortpmap = H264/90000
videofmtp = profile-level-id=4D401E\;packetization-mode=1\;sprop-parameter-sets=Z01AHpZSAUBf8uAqEAAAPpAADqYOCAAIZEAAQyO/GODtCxck,aOvNSA==


but I can't manage to play the video.

Running janus in a debug mode (janus -d 77)  I can see the following SDP:

v=0
o=- 681817010 681817010 IN IP4 127.0.0.1
s=xxx
c=IN IP4 0.0.0.0
t=0 0
a=sdplang:en
a=range:npt=now-
a=control:*
m=audio 0 RTP/AVP 96
a=rtpmap:96 mpeg4-generic/48000/2
a=fmtp:96 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1190
a=control:trackID=1
m=video 0 RTP/AVP 97
a=rtpmap:97 H264/90000
a=fmtp:97 packetization-mode=1;profile-level-id=4D401E;sprop-parameter-sets=Z01AHpZSAUBf8uAqEAAAPpAADqYOCAAIZEAAQyO/GODtCxck,aOvNSA==
a=cliprect:0,0,360,640
a=framesize:97 640-360
a=framerate:29.97
a=control:trackID=2

Full output is here:

In Chrome I get:


adapter.js:367 Uncaught (in promise) DOMException: Failed to set remote offer sdp: Session error code: ERROR_CONTENT. Session error description: Failed to set remote video description send parameters..(anonymous function) @ adapter.js:367
janus.js:288 Long poll...
temp1
"v=0
o=- 1463069516497456 1463069516497456 IN IP4 52.50.86.0
s=Streaming Test
t=0 0
a=group:BUNDLE video
a=msid-semantic: WMS janus
m=video 1 RTP/SAVPF 97
c=IN IP4 my.server.ip address (                     -                              i deleted here                         - )
a=mid:video
a=sendonly
a=rtcp-mux
a=ice-ufrag:diDZ
a=ice-pwd:8omz21JwDnwnA0QNQsdn4b
a=ice-options:trickle
a=fingerprint:sha-256 D2:B9:31:8F:DF:24:D8:0E:ED:D2:EF:25:9E:AF:6F:B8:34:AE:53:9C:E6:F3:8F:F2:64:15:FA:E8:7F:53:2D:38
a=setup:actpass
a=connection:new
a=rtpmap:97 H264/90000
a=fmtp:97 packetization-mode=1;profile-level-id=4D401E;sprop-parameter-sets=Z01AHpZSAUBf8uAqEAAAPpAADqYOCAAIZEAAQyO/GODtCxck,aOvNSA==
a=rtcp-fb:97 nack
a=rtcp-fb:97 goog-remb
a=ssrc:1836129111 cname:janusvideo
a=ssrc:1836129111 msid:janus janusv0
a=ssrc:1836129111 mslabel:janus
a=ssrc:1836129111 label:janusv0
a=candidate:1 1 udp 2013266431 52.50.86.0 58617 typ host
a=candidate:1 2 udp 2013266430 52.50.86.0 50652 typ host
"

In firefox it just wait forever. (http://picpaste.com/Untitled-tDAGRQOy.png)


What I'm doing wrong?

Anyone?

Thanks You!





Lorenzo Miniero

unread,
May 12, 2016, 1:56:13 PM5/12/16
to meetecho-janus
Chrome doesn't support H.264 unless you enable a specific flag. Besides, you need to make sure the baseline profile is used, as not all H.264 profiles are supported in WebRTC. Not sure about which packetization mode is supported instead. You need to make sure the stream you feed meets those contraints.

L.

Sassy Natan

unread,
May 13, 2016, 12:37:08 PM5/13/16
to meetecho-janus
Thank You.

So I guess I will try to do some sort of transcoding to the RTSP stream be a WebM compatible format using VP8 or 9.

I was able to run the demo streams script using the Gstreamer and to play the Opus/VP8 Live stream on Chrome and Firefox.

I also managed to grab the RTSP and convert it to a WebM fie using Gstreamer:

gst-launch-1.0 -v -e rtspsrc location=rtsp://wowza.xxxx.com:/XXX/xxxx ! rtph264depay ! h264parse ! mp4mux ! filesink location=video.mp4

or 

gst-launch-1.0 -v -e rtspsrc location=rtsp://wowza.xxxx.com:/XXX/xxxx !  rtph264depay !  h264parse ! decodebin ! vp8enc ! webmmux streamable=true ! filesink location=/video.mp4

I also manage (I think) to transcode the RSTP stream to a RTP  like this:

gst-launch-1.0 --gst-debug=2 -v -e rtspsrc location=rtsp://wowza.xxxx.com:/XXX/xxxx !  rtph264depay !  h264parse ! decodebin ! vp8enc end-usage=vbr target-bitrate=500000 threads=3 ! udpsink host=127.0.0.1 port=9001

I setup janus with this configure in the streaming plugin:

[gstreamer-sample]
type = rtp
id = 1
description = Opus/VP8 live stream coming from gstreamer
audio = no
video = yes
;audioport = 5002
;audiopt = 111
;audiortpmap = opus/48000/2
videoport = 9001
;videoport = 5004
videopt = 100
videortpmap = VP8/90000
#secret = adminpwd


Running it in a debug more ./janus -D 55 I can see this once I start the gstreamer
ri May 13 16:33:14 2016] [WARN] RabbitMQ support disabled for both Janus and Admin API, giving up
[Fri May 13 16:33:14 2016] Loading transport plugin 'libjanus_http.so'...
[Fri May 13 16:33:14 2016] HTTP webserver started (port 8088, /janus path listener)...
[Fri May 13 16:33:14 2016] [WARN] HTTPS webserver disabled
[Fri May 13 16:33:14 2016] [WARN] Admin/monitor HTTP webserver disabled
[Fri May 13 16:33:14 2016] [WARN] Admin/monitor HTTPS webserver disabled
[Fri May 13 16:33:14 2016] JANUS REST (HTTP/HTTPS) transport plugin initialized!
[Fri May 13 16:33:14 2016] HTTP/Janus sessions watchdog started
[Fri May 13 16:33:14 2016] Sessions watchdog started
[Fri May 13 16:33:15 2016] [rtsp-test] New video stream! (ssrc=2047522123)
[Fri May 13 16:33:21 2016] [gstreamer-sample] New video stream! (ssrc=1744896007)
[Fri May 13 16:33:21 2016] [gstreamer-sample] New video stream! (ssrc=3232664378)
[Fri May 13 16:33:21 2016] [gstreamer-sample] New video stream! (ssrc=2726634048)
[Fri May 13 16:33:21 2016] [gstreamer-sample] New video stream! (ssrc=2030604000)
[Fri May 13 16:33:21 2016] [gstreamer-sample] New video stream! (ssrc=990458670)
[Fri May 13 16:33:21 2016] [gstreamer-sample] New video stream! (ssrc=811337503)
[Fri May 13 16:33:21 2016] [gstreamer-sample] New video stream! (ssrc=2277310697)
[Fri May 13 16:33:21 2016] [gstreamer-sample] New video stream! (ssrc=517950639)
[Fri May 13 16:33:21 2016] [gstreamer-sample] New video stream! (ssrc=3557444410)
[Fri May 13 16:33:21 2016] [gstreamer-sample] New video stream! (ssrc=2014021805)


and so on....


When I start Chrome and play the stream I get the started msg, and it seems to be fine - but I get no video!

In the server log I see

16:36:01 2016] [gstreamer-sample] New video stream! (ssrc=2663564850)
[Fri May 13 16:36:01 2016] [gstreamer-sample] New video stream! (ssrc=100136237)
[Fri May 13 16:36:01 2016] [gstreamer-sample] New video stream! (ssrc=1415153190)
[Fri May 13 16:36:01 2016] [gstreamer-sample] New video stream! (ssrc=2815710972)
[Fri May 13 16:36:01 2016] [gstreamer-sample] New video stream! (ssrc=45874701)
[Fri May 13 16:36:01 2016] [gstreamer-sample] New video stream! (ssrc=2513537037)
[Fri May 13 16:36:01 2016] [1253425357] Creating ICE agent (ICE Full mode, controlling)
[Fri May 13 16:36:01 2016] [gstreamer-sample] New video stream! (ssrc=65349695)
[Fri May 13 16:36:01 2016] [gstreamer-sample] New video stream! (ssrc=1683798294)
[Fri May 13 16:36:01 2016] [gstreamer-sample] New video stream! (ssrc=2856677572)
[Fri May 13 16:36:01 2016] [gstreamer-sample] New video stream! (ssrc=1535359201)
[Fri May 13 16:36:01 2016] [gstreamer-sample] New video stream! (ssrc=2760352745)
[Fri May 13 16:36:01 2016] [WARN] [1253425357] Still waiting for the DTLS stack for component 1 in stream 1...
[Fri May 13 16:36:01 2016] [gstreamer-sample] New video stream! (ssrc=528528486)
[Fri May 13 16:36:01 2016] [gstreamer-sample] New video stream! (ssrc=45854455)
[Fri May 13 16:36:01 2016] [gstreamer-sample] New video stream! (ssrc=1708819832)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=2742310388)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=1557845895)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=473104679)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=21243105)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=32372255)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=724039241)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=2888092401)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=2055060938)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=2140160398)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=2819136464)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=604008111)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=238304066)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=163115037)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=3990751383)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=537920688)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=1876986800)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=2753298265)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=502564996)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=1970317)
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=1951980)
[Fri May 13 16:36:02 2016] [1253425357] The DTLS handshake has been completed
[Fri May 13 16:36:02 2016] WebRTC media is now available
[Fri May 13 16:36:02 2016] [gstreamer-sample] New video stream! (ssrc=137732816)
[Fri May 13 16:36:02 2016] [ERR] [ice.c:janus_ice_send_thread:3331] [1253425357] ... SRTP protect error... err_status_parse_err (len=1500-->1500, ts=4500, seq=1)...
[Fri May 13 16:36:03 2016] [gstreamer-sample] New video stream! (ssrc=2723860892)
[Fri May 13 16:36:03 2016] [ERR] [ice.c:janus_ice_send_thread:3331] [1253425357] ... SRTP protect error... err_status_parse_err (len=1500-->1500, ts=9000, seq=2)...
[Fri May 13 16:36:03 2016] [gstreamer-sample] New video stream! (ssrc=2886624460)
[Fri May 13 16:36:03 2016] [ERR] [ice.c:janus_ice_send_thread:3331] [1253425357] ... SRTP protect error... err_status_parse_err (len=1500-->1500, ts=13500, seq=3)...
[Fri May 13 16:36:03 2016] [gstreamer-sample] New video stream! (ssrc=3071890314)
[Fri May 13 16:36:03 2016] [ERR] [ice.c:janus_ice_send_thread:3331] [1253425357] ... SRTP protect error... err_status_parse_err (len=1500-->1500, ts=18000, seq=4)...
[Fri May 13 16:36:03 2016] [gstreamer-sample] New video stream! (ssrc=441443523)
[Fri May 13 16:36:03 2016] [ERR] [ice.c:janus_ice_send_thread:3331] [1253425357] ... SRTP protect error... err_status_parse_err (len=1500-->1500, ts=22500, seq=5)...
[Fri May 13 16:36:03 2016] [gstreamer-sample] New video stream! (ssrc=701599269)
[Fri May 13 16:36:03 2016] [ERR] [ice.c:janus_ice_send_thread:3331] [1253425357] ... SRTP protect error... err_status_parse_err (len=1500-->1500, ts=27000, seq=6)...
[Fri May 13 16:36:03 2016] [gstreamer-sample] New video stream! (ssrc=2344053997)
[Fri May 13 16:36:03 2016] [ERR] [ice.c:janus_ice_send_thread:3331] [1253425357] ... SRTP protect error... err_status_parse_err (len=1500-->1500, ts=31500, seq=7)...
[Fri May 13 16:36:03 2016] [gstreamer-sample] New video stream! (ssrc=2905155447)
[Fri May 13 16:36:03 2016] [ERR] [ice.c:janus_ice_send_thread:3331] [1253425357] ... SRTP protect error... err_status_parse_err (len=1500-->1500, ts=36000, seq=8)...


I saw this,but didn't manange to understand it or found it relevent


What am I'm doing wrong?

Anyone?
Thank You

Pierce Lopez

unread,
May 13, 2016, 3:37:04 PM5/13/16
to meetecho-janus
The constantly changing ssrc is a sign that the input format is wrong. It should only change when you start streaming a new video file.
In your case, you're missing an "rtpvp8pay" element in your gstreamer pipeline, to put the vp8 data as payload in rtp packets.
Reply all
Reply to author
Forward
0 new messages