H.264 streaming test using Janus and Gstreamer 0.10

6,688 views
Skip to first unread message

Jose Pablo Carballo

unread,
Sep 2, 2014, 12:03:51 AM9/2/14
to meetech...@googlegroups.com
Hi all,

I've been able to run in my computer the Streaming test based on Opus/VP8 [1], using plugins/streams/test_gstreamer.sh as the source of the stream.

I'm looking to do the same test but using H.264. For this, I've installed Firefox 34 (Nightly), and toggled the "media.peerconnection.video.h264_enabled" setting in about:config. Then, I'm figuring out how to modify Janus in order to be able to convert the Opus/VP8 streaming demo to an H.264 only demo. The references I've found is the suggestion from Benjamin Trent in [2] to modify Janus, and the H.264 SDP demo from the WebRTC book [3].

From looking at the H.264 SDP Demo [3], I understand that I have to add these lines to the SDP offer (but not sure if I have to add more):

  a=rtpmap:126 H264/90000
  a=fmtp:126 profile-level-id=42e00c;packetization-mode=1

To quickly test this, I'm wiring plugins/janus_streaming.c to include these lines:

            if(mp->codecs.video_rtpmap) {
                    g_sprintf(buffer,
                        "a=rtpmap:%d %s\r\n",
                        mp->codecs.video_pt, mp->codecs.video_rtpmap);
                    g_strlcat(sdptemp, buffer, 1024);
                    g_sprintf(buffer,
                        "a=rtpmap:126 H264/90000\r\n");
                    g_strlcat(sdptemp, buffer, 1024);
                    g_sprintf(buffer,
                        "a=fmtp:126 profile-level-id=42e00c;packetization-mode=1\r\n");
                    g_strlcat(sdptemp, buffer, 1024);
                }
                g_strlcat(sdptemp, "a=sendonly\r\n", 1024);
            }

In the conf/janus.plugin.streaming.cfg I set "audio = no".

After compiling I restart ./janus, and this gstreamer pipeline aside:

  gst-launch videotestsrc ! video/x-raw-rgb,width=320,height=240,framerate=15/1 !  videoscale ! videorate ! ffmpegcolorspace ! timeoverlay !  x264enc !  rtph264pay ! udpsink host=127.0.0.1 port=5004

Afterwards I'll go to the gateway (http://127.0.0.1/janus/streamingtest.html), but the demo doesn't work just like that :)

I'll appreciate any help.

Thanks,
JP

Lorenzo Miniero

unread,
Sep 2, 2014, 4:19:08 AM9/2/14
to meetech...@googlegroups.com
I haven't tested H.264 but with your modifications it should work: as long as the profile you're writing is correct, that is, and the payload type you're negotiating for H.264 is the right one.

Have you also modified the stream in the configuration file to have it negotiate H.264 in the first place? Your code tries to do that manually which can break things: just add the new fmtp line and leave it to the existing code to do the rest. 

L.

Jose Pablo Carballo

unread,
Sep 2, 2014, 10:55:09 AM9/2/14
to meetech...@googlegroups.com
Hi Lorenzo,

Thanks for your answer.

I've tried setting in conf/janus.plugin.streaming.cfg:

  videopt = 126
  videortpmap = H264/90000

And only wiring the new line:


  "a=fmtp:126 profile-level-id=42e00c;packetization-mode=1\r\n"

That gave me this error:

WebRTC error... {"name":"INVALID_SESSION_DESCRIPTION","message":"Could not negotiate media lines; cause = PAYLOAD_MISMATCH | SDP Parsing Error: Warning: Group attribute type unsupported (BUNDLE). | SDP Parsing Error: Warning: Unrecognized attribute (msid-semantic) | SDP Parsing Error: Warning: Numeric token for mid attribute not found | SDP Parsing Error: Warning: Invalid token ordering detected, token c= found after token a= | SDP Parsing Error: Warning: Unrecognized attribute (ice-options) | SDP Parsing Error: Warning: Unrecognized attribute (ssrc) | SDP Parsing Error: Warning: Unrecognized attribute (ssrc) | SDP Parsing Error: Warning: Unrecognized attribute (ssrc) | SDP Parsing Error: Warning: Unrecognized attribute (ssrc) "}

I'm looking now into checking the right profie and payload type.

Regards,
JP



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

Lorenzo Miniero

unread,
Sep 2, 2014, 10:59:31 AM9/2/14
to meetech...@googlegroups.com
Please also provide the complete SDP generated by Janus, otherwise we can't evaluate what the payload mismatch refers to.

L.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janus+unsubscribe@googlegroups.com.

Jose Pablo Carballo

unread,
Sep 2, 2014, 11:01:32 AM9/2/14
to Lorenzo Miniero, meetech...@googlegroups.com
This is the SDP I got from Firefox's console:

Object { sdp: "v=0
o=- 88151803852 88151803852 IN IP4 127.0.0.1
s=Streaming Test
t=0 0
a=group:BUNDLE video
a=msid-semantic: WMS janus
m=video 37941 RTP/SAVPF 100
a=mid:video
c=IN IP4 10.251.101.24
a=sendonly
a=rtcp-mux
a=ice-ufrag:N1uQ
a=ice-pwd:dxnFsvh/Zf9NgK3vdCXru4
a=ice-options:trickle
a=fingerprint:sha-256 C5:5F:DA:7D:84:47:B1:BF:6B:55:16:62:48:31:3E:D3:F1:7B:25:89:92:4A:4B:4D:4D:D9:D5:AF:EA:D8:15:44
a=setup:actpass
a=connection:new
a=rtpmap:100 H264/90000
a=fmtp:126 profile-level-id=42e00c;packetization-mode=1
a=ssrc:2156699886 cname:janusvideo
a=ssrc:2156699886 msid:janus janusv0
a=ssrc:2156699886 mslabel:janus
a=ssrc:2156699886 label:janusv0
a=candidate:1 1 udp 2013266431 10.251.101.24 37941 typ host
a=candidate:2 1 udp 2013266431 192.168.1.144 40547 typ host
a=candidate:3 1 udp 2013266431 172.16.197.198 47466 typ host
a=candidate:4 1 udp 1677721855 10.251.101.72 40547 typ srflx raddr 192.168.1.144 rport 40547
a=candidate:1 2 udp 2013266430 10.251.101.24 38231 typ host
a=candidate:2 2 udp 2013266430 192.168.1.144 46894 typ host
a=candidate:3 2 udp 2013266430 172.16.197.198 43002 typ host
a=candidate:4 2 udp 1677721854 10.251.101.72 46894 typ srflx raddr 192.168.1.144 rport 46894
", type: "offer" }

JP


To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.

Lorenzo Miniero

unread,
Sep 2, 2014, 11:19:56 AM9/2/14
to meetech...@googlegroups.com, lmin...@gmail.com
Your configuration is not correct, as Janus is still setting 100 as payload type, which conflicts with the fmtp 126 that is provided. Remember to reboot Janus when you change the config files as they're only read once.

L.

Jose Pablo Carballo

unread,
Sep 4, 2014, 11:13:07 AM9/4/14
to Lorenzo Miniero, meetech...@googlegroups.com
Hi,

I'm still trying to see the H.264 stream in Firefox 34.

My changes to janus include adding a "videofmtp" option in the streaming configuration file, to add the fmtp line.

Index: janus-gateway-0.0.4/src/plugins/janus_streaming.c
===================================================================
--- janus-gateway-0.0.4.orig/src/plugins/janus_streaming.c
+++ janus-gateway-0.0.4/src/plugins/janus_streaming.c
@@ -167,6 +167,7 @@
     char *audio_rtpmap;
     gint video_pt;
     char *video_rtpmap;    /* FIXME We need better ways to describe a codec in SDP */   
+    char *video_fmtp;
 } janus_streaming_codecs;
 
 typedef struct janus_streaming_mountpoint {
@@ -287,6 +288,7 @@
                 janus_config_item *vport = janus_config_get_item(cat, "videoport");
                 janus_config_item *vcodec = janus_config_get_item(cat, "videopt");
                 janus_config_item *vrtpmap = janus_config_get_item(cat, "videortpmap");
+                janus_config_item *vfmtp = janus_config_get_item(cat, "videofmtp");
                 janus_streaming_mountpoint *live_rtp = calloc(1, sizeof(janus_streaming_mountpoint));
                 if(live_rtp == NULL) {
                     JANUS_LOG(LOG_FATAL, "Memory error!\n");
@@ -316,7 +318,8 @@
                 if(dovideo &&
                         (vport == NULL || vport->value == NULL ||
                         vcodec == NULL || vcodec->value == NULL ||
-                        vrtpmap == NULL || vrtpmap->value == NULL)) {
+                        vrtpmap == NULL || vrtpmap->value == NULL ||
+                        vfmtp == NULL || vfmtp->value == NULL)) {
                     JANUS_LOG(LOG_ERR, "Can't add 'rtp' stream, missing mandatory information for video...\n");
                     cat = cat->next;
                     continue;
@@ -352,6 +355,7 @@
                 live_rtp->codecs.audio_rtpmap = doaudio ? g_strdup(artpmap->value) : NULL;
                 live_rtp->codecs.video_pt = dovideo ? atoi(vcodec->value) : -1;
                 live_rtp->codecs.video_rtpmap = dovideo ? g_strdup(vrtpmap->value) : NULL;
+                live_rtp->codecs.video_fmtp = dovideo ? g_strdup(vfmtp->value) : NULL;
                 live_rtp->listeners = NULL;
                 g_hash_table_insert(mountpoints, GINT_TO_POINTER(live_rtp->id), live_rtp);
                 g_thread_new(live_rtp->name, &janus_streaming_relay_thread, live_rtp);
@@ -414,6 +418,7 @@
                 live_file->codecs.audio_rtpmap = strstr(file->value, ".alaw") ? "PCMA/8000" : "PCMU/8000";
                 live_file->codecs.video_pt = -1;    /* FIXME We don't support video for this type yet */
                 live_file->codecs.video_rtpmap = NULL;
+                live_file->codecs.video_fmtp = NULL;
                 live_file->listeners = NULL;
                 g_hash_table_insert(mountpoints, GINT_TO_POINTER(live_file->id), live_file);
                 g_thread_new(live_file->name, &janus_streaming_filesource_thread, live_file);
@@ -476,6 +481,7 @@
                 ondemand_file->codecs.audio_rtpmap = strstr(file->value, ".alaw") ? "PCMA/8000" : "PCMU/8000";
                 ondemand_file->codecs.video_pt = -1;    /* FIXME We don't support video for this type yet */
                 ondemand_file->codecs.video_rtpmap = NULL;
+                ondemand_file->codecs.video_fmtp = NULL;
                 ondemand_file->listeners = NULL;
                 g_hash_table_insert(mountpoints, GINT_TO_POINTER(ondemand_file->id), ondemand_file);
             }
@@ -832,6 +838,12 @@

                         mp->codecs.video_pt, mp->codecs.video_rtpmap);
                     g_strlcat(sdptemp, buffer, 1024);
                 }
+                if(mp->codecs.video_fmtp) {
+                    g_sprintf(buffer,
+                        "a=fmtp:%d %s\r\n",
+                        mp->codecs.video_pt, mp->codecs.video_fmtp);
+                    g_strlcat(sdptemp, buffer, 1024);
+                }

                 g_strlcat(sdptemp, "a=sendonly\r\n", 1024);
             }
             sdp = g_strdup(sdptemp);
@@ -1001,7 +1013,7 @@
         read = fread(buf + RTP_HEADER_SIZE, sizeof(char), 160, audio);
         if(feof(audio)) {
             /* FIXME We're doing this forever... should this be configurable? */
-            JANUS_LOG(LOG_VERB, "Rewind! (%s)\n", source->filename);
+            //JANUS_LOG(LOG_VERB, "Rewind! (%s)\n", source->filename);
             fseek(audio, 0, SEEK_SET);
             continue;
         }
@@ -1107,7 +1119,7 @@
         read = fread(buf + RTP_HEADER_SIZE, sizeof(char), 160, audio);
         if(feof(audio)) {
             /* FIXME We're doing this forever... should this be configurable? */
-            JANUS_LOG(LOG_VERB, "Rewind! (%s)\n", source->filename);
+            //JANUS_LOG(LOG_VERB, "Rewind! (%s)\n", source->filename);
             fseek(audio, 0, SEEK_SET);
             continue;
         }
Index: janus-gateway-0.0.4/src/conf/janus.plugin.streaming.cfg
===================================================================
--- janus-gateway-0.0.4.orig/src/conf/janus.plugin.streaming.cfg
+++ janus-gateway-0.0.4/src/conf/janus.plugin.streaming.cfg
@@ -29,7 +29,7 @@
 type = rtp
 id = 1
 description = Opus/VP8 live stream coming from gstreamer
-audio = yes
+audio = no
 video = yes
 audioport = 5002
 audiopt = 111
@@ -37,10 +37,22 @@
 videoport = 5004
 videopt = 100
 videortpmap = VP8/9000
+videofmtp =
+
+[gstreamer-h264-sample]
+type = rtp
+id = 2
+description = H264 live stream coming from gstreamer
+audio = no
+video = yes
+videoport = 5008
+videortpmap = H264/90000
+videopt = 126
+videofmtp = profile-level-id=42e00d;packetization-mode=0
 
 [file-live-sample]
 type = live
-id = 2
+id = 3
 description = a-law file source
 filename = ./plugins/streams/radio.alaw        ; See install.sh
 audio = yes
@@ -48,7 +60,7 @@
 
 [file-ondemand-sample]
 type = ondemand
-id = 3
+id = 4
 description = mu-law file source
 filename = ./plugins/streams/music.mulaw    ; See install.sh
 audio = yes

Regarding the fmtp line to add, I've tried to follow the draft "H.264 as Mandatory to Implement Video Codec for WebRTC" [1], while also taking RFC86184 as reference "RTP Payload Format for H.264 Video" [2].

The Gstreamer pipeline I'm using I believe matches the payload type (126), profile-level-id (42e00d), and packetization mode (0 - Single NAL unit):

gst-launch videotestsrc ! video/x-raw-rgb,width=320,height=240,framerate=15/1 !  videoscale ! videorate ! ffmpegcolorspace ! timeoverlay !  x264enc ! rtph264pay pt=126 profile-level-id=42e00d ! udpsink host=127.0.0.1 port=5008

With the changes above, this is the SDP offer that gets created:

Object { sdp: "v=0
o=- 261755348349 261755348349 IN IP4 127.0.0.1

s=Streaming Test
t=0 0
a=group:BUNDLE video
a=msid-semantic: WMS janus
m=video 52830 RTP/SAVPF 126

a=mid:video
c=IN IP4 10.251.101.24
a=sendonly
a=rtcp-mux
a=ice-ufrag:znix
a=ice-pwd:opJOqsWdNatG6dIkWnZCDl

a=ice-options:trickle
a=fingerprint:sha-256 C5:5F:DA:7D:84:47:B1:BF:6B:55:16:62:48:31:3E:D3:F1:7B:25:89:92:4A:4B:4D:4D:D9:D5:AF:EA:D8:15:44
a=setup:actpass
a=connection:new
a=rtpmap:126 H264/90000
a=fmtp:126 profile-level-id=42e00d
a=ssrc:1339752311 cname:janusvideo
a=ssrc:1339752311 msid:janus janusv0
a=ssrc:1339752311 mslabel:janus
a=ssrc:1339752311 label:janusv0
a=candidate:1 1 udp 2013266431 10.251.101.24 52830 typ host
a=candidate:2 1 udp 2013266431 192.168.1.100 37974 typ host
a=candidate:3 1 udp 2013266431 172.16.197.198 41683 typ host
a=candidate:1 2 udp 2013266430 10.251.101.24 55526 typ host
a=candidate:2 2 udp 2013266430 192.168.1.100 53579 typ host
a=candidate:3 2 udp 2013266430 172.16.197.198 39674 typ host
", type: "offer" }



But when I run the demo in Janus, it gets to the point "Started" but it doesn't display the video.

Any comments? Have someone tried something like this before?
Thanks,


To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.

Lorenzo Miniero

unread,
Sep 4, 2014, 11:23:39 AM9/4/14
to meetech...@googlegroups.com, lmin...@gmail.com
Hi,

no I haven't done any test in that direction. Your changes should work fine, though, especially considering that from a negotiation point of view it seems to be ok. Have you verified with wireshark/tcpdump that Janus is actually relaying the RTP frames to the browser? You can also use the about:webrtc internal page on Firefox to get WebRTC-related info, which might give you a hint on what's going on.

Since I don't know what Firefox+openh264 support or expect, I guess you'll have to look at the logs Firefox generates to see if there's any error that's being notified there on incoming packets. The command line I usually make use of (on Linux) to generate these logs is something like this:

NSPR_LOG_MODULES=signaling:5,mtransport:9,mediapipeline:9 R_LOG_LEVEL=9 R_LOG_DESTINATION=stderr ./firefox > /pah/to/new-webrtc-log 2>&1

but there may be other more specific H.264 flags you can set. Asking them on the mozilla.dev.media Google Group explaining what you're trying to do might help as well, as they'll surely be able to give you more details.

Lorenzo

Jose Pablo Carballo

unread,
Sep 4, 2014, 1:41:32 PM9/4/14
to Lorenzo Miniero, meetech...@googlegroups.com
Hi Lorenzo.

Thanks for your pointers, I'll be using them. I'll ask soon in the Mozilla forum as well.

One interesting thing is that using Firefox 34 Nightly, I just went back to test the Opus/VP8 Streaming test without any modifications on Janus. When I start it I can only hear the audio and no video, and I get this error message from Janus:

[ERR] [ice.c:janus_ice_cb_nice_recv:546:] Still waiting for the DTLS stack for component 1 in stream 1...
[ERR] [ice.c:janus_ice_relay_rtp:1165:] [3122186478]     video stream component has no valid SRTP session (yet?)

If I run the test (without changing anything nor restarting janus) with Google Chrome, then the streaming demo succeeds (audio and video ok). 

I've tried restarting Firefox and re-booting my machine (Ubuntu 12.04) but still nothing..

Anyway, thanks again for your help.

Regards,


To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.

Lorenzo Miniero

unread,
Sep 5, 2014, 4:37:52 AM9/5/14
to meetech...@googlegroups.com, lmin...@gmail.com
That's weird. I tried the Firefox 34 Nightly I had installed with the online demos and it seemed to work fine for me. Then I applied the latest update from the About dialog, and I'm getting no video either. The same thing seems to be happening with other demos as well (e.g., EchoTest). I'll have to check what's wrong, thanks for the heads-up.

Lorenzo

Lorenzo Miniero

unread,
Sep 5, 2014, 5:45:44 AM9/5/14
to meetech...@googlegroups.com, lmin...@gmail.com
Found out the issue. Firefox has started using Trickle, but is leaving the sdpMid attribute of candidates empty: since we used that to know what stream the candidate is for (Chrome assigned "audio", "video" and "data" values to it) Janus was confused and added them all to the audio stream, which is why audio worked and video didn't. I changed the behaviour to use the sdpMLineIndex attribute instead and I verified it works now. I'll push the changes ASAP.

Lorenzo

Jose Pablo Carballo

unread,
Sep 5, 2014, 5:34:31 PM9/5/14
to meetech...@googlegroups.com
Hi,

I confirmed that the issue was fixed in my Firefox Nightly. Thanks.

I tried also testing H.264 with this new changes, but no luck. I get this message tho:

  [ERR] [ice.c:janus_ice_cb_nice_recv:639:] Still waiting for the DTLS stack for component 1 in stream 1...

Could you please help me understand what is this message about?

Thanks,


To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.

Lorenzo Miniero

unread,
Sep 7, 2014, 9:57:38 AM9/7/14
to meetech...@googlegroups.com
Not an issue probably, just a warning I guess, as sometimes it takes a while before DTLS is completed. If it keeps on not working, have a look at the new admin/monitor interface (there's an admin.html page in the demos) to see if the underlying protocols all went fine.

Lorenzo

Lorenzo Miniero

unread,
Sep 9, 2014, 12:45:20 PM9/9/14
to meetech...@googlegroups.com
I've just pushed a change that allows you to specify fmtp codec parameters in the configuration file as well, a bit like your patches did.

I've also done a quick test with Firefox and an H.264 mountpoint in Janus with data coming from Gstreamer (setting profile="baseline" in the encoder settings) and I can confirm that nothing is displayed. The issue is definitely not DTLS nor any of the underlying protocols either, as all the negotiation and media setup phases go fine. I couldn't find any issue in the logs either, so no info on whether or not it's the encoded stream itself that the H.264 decoder in Firefox is not digesting for some reason. At this point, I guess that only Firefox developers can direct us to what's not going as expected.

Lorenzo 

jose.c...@ridgerun.com

unread,
Sep 9, 2014, 5:52:36 PM9/9/14
to meetech...@googlegroups.com

On Tuesday, September 9, 2014 10:45:20 AM UTC-6, Lorenzo Miniero wrote:
I've just pushed a change that allows you to specify fmtp codec parameters in the configuration file as well, a bit like your patches did.

Thanks.
 

I've also done a quick test with Firefox and an H.264 mountpoint in Janus with data coming from Gstreamer (setting profile="baseline" in the encoder settings) and I can confirm that nothing is displayed. The issue is definitely not DTLS nor any of the underlying protocols either, as all the negotiation and media setup phases go fine. I couldn't find any issue in the logs either, so no info on whether or not it's the encoded stream itself that the H.264 decoder in Firefox is not digesting for some reason. At this point, I guess that only Firefox developers can direct us to what's not going as expected.


That is my conclusion as well. I think there's a chance that I'm not generating the right H.264 stream so that Firefox is able to decode it (profile, level, packetization mode...), I'm going to try a bit more in that direction. I would like to know what are the Firefox H.264 capabilities, I'll possibly have to turn on debug for the gmp-gmpopenh264 plugin, and/or go to its source code and find out, I haven't been able to find any good documentation for what is specifically supported. My current plan is:

1. Use the SDP offer demo here to see how they negotiate H.264 streaming (http://webrtcbook.com/sdp-h264.html).
2. Tune the gstreamer pipeline to generate an H.264 that Firefox can decode.

I've also asked in the mozilla forum already (https://groups.google.com/forum/#!topic/mozilla.dev.media/IUelQMr1gaA), but didn't received an answer yet.
 
Lorenzo 
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

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

For more options, visit https://groups.google.com/d/optout.

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

For more options, visit https://groups.google.com/d/optout.

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

For more options, visit https://groups.google.com/d/optout.

--
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,
Oct 14, 2014, 9:38:15 AM10/14/14
to meetech...@googlegroups.com
FYI, just got this to work with Firefox. Not sure whether it was fixed in a recent version of Firefox, or I was using the wrong settings/scripts before, but it works as expected now.

I used this configuration in Janus:

[h264-sample]
type = rtp
id = 1234
description = H.264 live stream coming from gstreamer
audio = no
video = yes
videoport = 8004
videopt = 126
videortpmap = H264/90000
videofmtp = profile-level-id=42e01f\;packetization-mode=1

And this gstreamer script to send the video:

gst-launch \
videotestsrc ! video/x-raw-rgb,width=640,height=480,framerate=30/1 ! \
videoscale ! videorate ! ffmpegcolorspace ! timeoverlay ! \
x264enc bitrate=256000 profile=1 tune=zerolatency ! \
rtph264pay ! udpsink host=127.0.0.1 port=8004

This resulted in the video correctly displaying in Firefox.

Lorenzo

Lorenzo 
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="iz61xJO7kLEJ" onmousedown="this.href='javascri
...

jose.c...@ridgerun.com

unread,
Oct 15, 2014, 6:45:54 PM10/15/14
to meetech...@googlegroups.com
Hi Lorenzo,

I confirmed it worked in my setup as well. Thanks!!

Regards,
...

Mykola Popko

unread,
Dec 3, 2014, 2:00:52 PM12/3/14
to meetech...@googlegroups.com
Hello!
Thanks for your solution, It also work's for me! 
Now i'm trying to do the same with my small linux device. Unfortunatelly, due to some limitations i can use only dmaienc_h264 encoder on my device, but not x264:

gst-launch v4l2src always-copy=false chain-ipipe=true ! video/x-raw-yuv,format='(fourcc)'NV12, width=640, height=480, framerate='(fraction)'15/1 ! dmaiaccel ! dmaienc_h264 ddrbuf=true encodingpreset=2 ratecontrol=4 maxbitrate=4000000 targetbitrate=2000000 ! dmaiperf print-arm-load=true ! rtph264pay !  queue ! udpsink port=3000 host=192.168.1.16 sync=false

After running gstreamer pipeline, i've been able to start the demo (the negotiation seems to succeed), but Firefox doesn't display the video. Seems like something wrong with my SDP offer. After some googling, i found that i should use such SDP params:
m=video 3000 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=42A01E; packetization-mode=1;sprop-parameter-sets=Z2QAKK2EBUViuKxUdCAqKxXFYqOhAVFYrisVHQgKisVxWKjoQFRWK4rFR0ICorFcVio6ECSFITk8nyfk/k/J8nm5s00IEkKQnJ5Pk/J/J+T5PNzZprQFAeyA,aO48sA==
Hence, i've changed my janus.plugin.streaming.cfg:
...
[h264-my]
type
= rtp
id
= 11
description
= H.264 live stream coming from remote gstreamer
audio
= no
video
= yes
videoport
= 3000
videopt
= 96
videortpmap
= H264/90000
videofmtp
= profile-level-id=42A01E\;packetization-mode=1\;sprop-parameter-sets=Z2QAKK2EBUViuKxUdCAqKxXFYqOhAVFYrisVHQgKisVxWKjoQFRWK4rFR0ICorFcVio6ECSFITk8nyfk/k/J8nm5s00IEkKQnJ5Pk/J/J+T5PNzZprQFAeyA,aO48sA==
...

But i'm not understand, where i should specify m=video 3000 RTP/AVP 96 ? I've been trying to do that in plugins/janus_streaming.c instead of
m=video 3000 RTP/AVP

 Afterwards i recompile my Janus:
./configure --prefix=/opt/janus
make
make install

But my changes don't affect. Where i should change it? And is the problem really with my SDP's or it is a more complex problem with dmaienc_h264? 

Thanks, regards.

Вівторок, 14 жовтня 2014 р. 16:38:15 UTC+3 користувач Lorenzo Miniero написав:
...

Mykola Popko

unread,
Dec 5, 2014, 3:57:08 PM12/5/14
to meetech...@googlegroups.com
Recently i've changed some files to achieve needed SDP parameters, but it doesn't help me. Still no video:(
Is it means that dmaienc_h264 would not work with Firefox h264 plugin or something wrong with Janus-gateway?

Середа, 3 грудня 2014 р. 21:00:52 UTC+2 користувач Mykola Popko написав:
...

Lorenzo Miniero

unread,
Dec 5, 2014, 4:00:21 PM12/5/14
to meetech...@googlegroups.com
You probably need to set the right info in the SDP, e.g., as to the profile in use:


Besides, recent versions of Firefox don't negotiate H.264 even if enabled, at least in my case.

L.

Mykola Popko

unread,
Dec 6, 2014, 7:31:14 AM12/6/14
to meetech...@googlegroups.com
I dont think that problem with my Firefox H.264 plugin, because it works when i use x264 streaming. Now i want to use dmaienc_h264 from my remote device. I'm sure the problem with my SDP. And for dmaienc_h264 i should specify sprop-parameter-sets in janus config, what i have did. But ...  
SDP offer generated by janus in my case:
"v=0
o=- 12969545507 12969545507 IN IP4 127.0.0.1
s=Streaming Test t=0 0
a=group:BUNDLE video
a=msid-semantic: WMS janus
m=video 1 RTP/SAVPF 96
a=mid:video
c=IN IP4 192.168.1.16
a=sendrecv
a=rtcp-mux
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=42A01E;packetization-mode=1;
sprop-parameter-sets=Z2QAKK2EBUViuKxUdCAqKxX
a=sendonly
a=ice-ufrag:p3OY
a=ice-pwd:p6VCWZZQL0heBr26yVu9BC
a=ice-options:trickle
a=fingerprint:sha-256 C5:5F:DA:7D:84:47:B1:BF:6B:55:16:62:48:31:3E:D3:F1:7B:25:89:92:4A:4B:4D:4D:D9:D5:AF:EA:D8:15:44
a=setup:actpass
a=connection:new
a=ssrc:3478568839 cname:janusvideo
a=ssrc:3478568839 msid:janus janusv0
a=ssrc:3478568839 mslabel:janus
a=ssrc:3478568839 label:janusv0
a=candidate:1 1 udp 2013266431 192.168.1.16 34691 typ host
a=candidate:1 2 udp 2013266430 192.168.1.16 55056 typ host "

Why it cuts my sprop-parameter-sets? It should be 
Z2QAKK2EBUViuKxUdCAqKxXFYqOhAVFYrisVHQgKisVxWKjoQFRWK4rFR0ICorFcVio6ECSFITk8nyfk/k/J8nm5s00IEkKQnJ5Pk/J/J+T5PNzZprQFAeyA\,aO48sA\=\=

as i've specified in my config. Maybe problem with that?

Пʼятниця, 5 грудня 2014 р. 23:00:21 UTC+2 користувач Lorenzo Miniero написав:

Lorenzo Miniero

unread,
Dec 6, 2014, 8:18:25 AM12/6/14
to meetech...@googlegroups.com
Not sure who's cutting that, there's no cap in the streaming plugin. It may be sofia-sip which parses the SDP generated by plugins and regenerates it again. Increasing the debug should show you the SDP pre-merge (generated by the plugin) and post-merge (with the stuff added by the core) to see if it's lost somewhere there. Otherwise, try placing some additional debug lines in the part of code that handle the fmtp stuff in the plugin to see if there are other problems there.

L.
...

Mykola Popko

unread,
Dec 6, 2014, 10:54:58 AM12/6/14
to meetech...@googlegroups.com
I think there are something wrong with plugin... It cutting fmtp somewhere (unfortunately, i'm not fomiliar with c++ and can't find where)... Debug messages after increasing level to 7:
...
Creating plugin result...
Destroying plugin result...
Request completed, freeing data
Request to watch mountpoint/stream 10
Going to offer this SDP:
v
=0
o
=- 25413978346 25413978346 IN IP4 127.0.0.1
s
=Streaming Test
t
=0 0
m
=video 3000 RTP/AVP 126
c
=IN IP4 1.1.1.1
a
=rtpmap:126 H264/90000
a
=fmtp:126 profile-level-id=42e01f;packetization-mode=1;sprop-parameter-sets=Z2QAKK2EBUViuKxUdCAqKxa=sendonly


Pushing event: {
   
"streaming": "event",
   
"result": {
     
"status": "preparing"
   
}
}
...

As you can see fmtp is already cutted...

Субота, 6 грудня 2014 р. 15:18:25 UTC+2 користувач Lorenzo Miniero написав:
...

Lorenzo Miniero

unread,
Dec 6, 2014, 11:27:29 AM12/6/14
to meetech...@googlegroups.com
Yep, found it, increase the size of the buffer
and the size in the printf accordingly
recompile/reinstall and try again.

Or you can wait for me to update the code (won't happen before a couple of days, I'm out of the lab).

L.
...

Mykola Popko

unread,
Dec 6, 2014, 11:34:46 AM12/6/14
to meetech...@googlegroups.com
Yes, i already did that. Now nothing cutted, but still no video:(

Субота, 6 грудня 2014 р. 18:27:29 UTC+2 користувач Lorenzo Miniero написав:

Mykola Popko

unread,
Dec 6, 2014, 12:33:06 PM12/6/14
to meetech...@googlegroups.com
Could you tell me pls if there are all good with my SDP negotiation?
Offer SDP:
v=0
o
=- 29646209393 29646209393 IN IP4 127.0.0.1

s
=Streaming Test
t
=0 0
a
=group:BUNDLE video
a
=msid-semantic:
WMS janus
m
=video 3000 RTP/AVP 96
c
=IN IP4 192.168.1.16
a
=mid:video
a
=sendonly
a
=rtcp-mux
a
=rtpmap:96 H264/90000
a
=fmtp:96 profile-level-id=42A01E;packetization-mode=1;sprop-parameter-sets=Z2QAKK2EBUViuKxUdCAqKxXFYqOhAVFYrisVHQgKisVxWKjoQFRWK4rFR0ICorFcVio6ECSFITk8nyfk/k/J8nm5s00IEkKQnJ5Pk/J/J+T5PNzZprQFAeyA,aO48sA==
a
=ice-ufrag:bEWQ
a
=ice-pwd:ZZL35EeDXcUXhg2ZmjAHS8
a
=ice-options:trickle
a
=fingerprint:sha-256 C5:5F:DA:7D:84:47:B1:BF:6B:55:16:62:48:31:3E:D3:F1:7B:25:89:92:4A:4B:4D:4D:D9:D5:AF:EA:D8:15:44
a
=setup:actpass
a
=connection:new
a
=ssrc:3293263322 cname:janusvideo
a
=ssrc:3293263322 msid:janus janusv0
a
=ssrc:3293263322 mslabel:janus
a
=ssrc:3293263322 label:janusv0
a
=candidate:1 1 udp 2013266431 192.168.1.16 41871 typ host
a
=candidate:1 2 udp 2013266430 192.168.1.16 55700 typ host

Answer SDP:
v=0
o
=Mozilla-SIPUA-34.0 23415 0 IN IP4 0.0.0.0
s
=SIP Call
t
=0 0
a
=ice-ufrag:9af107ea
a
=ice-pwd:0645a159fc9fe424cc1477817133fbe8
a
=fingerprint:sha-256 07:7A:64:F9:98:3E:17:F5:40:6A:74:6E:0D:BE:8B:6B:CB:24:DF:BB:FB:0F:81:91:F6:AE:78:16:F3:07:00:A7
m
=video 9 RTP/AVP 96
c
=IN IP4 0.0.0.0
a
=rtpmap:96 H264/90000
a
=fmtp:96 profile-level-id=42e01f;packetization-mode=1
a
=recvonly
a
=setup:active
a
=rtcp-mux



Субота, 6 грудня 2014 р. 18:34:46 UTC+2 користувач Mykola Popko написав:

Lorenzo Miniero

unread,
Dec 6, 2014, 12:58:22 PM12/6/14
to meetech...@googlegroups.com
Not an expert on H.264, sorry (which I'm not particularly fond of either).
I guess it may be something related to the profile in use, AFAIK only baseline is supported in Firefox's OpenH264 (don't know what your source is doing instead) but I may be wrong.

L.
...

Mykola Popko

unread,
Dec 6, 2014, 2:33:51 PM12/6/14
to meetech...@googlegroups.com
You are right! Only baseline profile supported and only 31's level. That is why it not worked before. Now i got it to work (it also works with standard config of janus without "sprop-parameters-sets" etc.). But delay is huge. About 1 second and it always increases:( And it not depends by quality of video. I just not understand why it happens.
I use following pipeline:
gst-launch v4l2src always-copy=false chain-ipipe=true ! video/x-raw-yuv,format='(fourcc)'NV12, width=640, height=480, framerate='(fraction)'15/1 ! dmaiaccel ! dmaienc_h264 outputBufferSize=0 ddrbuf=true copyOutput=false encodingpreset=2 profile=66 level=31 entropy=0 t8x8intra=0 aud=false headers=false bytestream=false seqscaling=0 ratecontrol=1 maxbitrate=256000 targetbitrate=256000 intraframeinterval=1 idrinterval=1 airrate=0 ! rtph264pay config-interval=1 ! queue ! udpsink port=3000 host=192.168.1.16 sync=false



Субота, 6 грудня 2014 р. 19:58:22 UTC+2 користувач Lorenzo Miniero написав:
Reply all
Reply to author
Forward
0 new messages