[Freeswitch-users] Broadcasting conference with mod_rtmp

Charlie DeTar cfd-fs at fohn.org
Wed Sep 14 06:54:45 MSD 2016


Hi,

I'm trying to broadcast a WebRTC video conference (via mod_conference
and mod_verto) over an rtmp stream, with the ultimate goal of
transcoding the rtmp stream for broadcast as an HTML5 video stream
(likely using something like https://github.com/arut/nginx-rtmp-module
for HSL and MPEG-DASH broadcasts).  I expect I have the same sort of
requirements of freeswitch that one would need for broadcasting rtmp to
youtube, which the docs mention glancingly without detail [0]. :)

The video conferencing is working great -- but I'm struggling to figure
out how to access the RTMP stream for it.  My rtmp.conf.xml is basically
the default (but with `auth-calls` set to `false`).  My dialplan is as
follows:

<include>
  <extension name="plenary">
    <condition field="destination_number" expression="^plenary-.*$"
    break="never">
      <action application="answer"/>
      <action application="info"/>
      <action application="conference"
              data="${destination_number}@plenary-conference-profile"/>
    </condition>
  </extension>
</include>

I'm able to connect to freeswitch using RTMP clients (I've tried
rtmpdump, mplayer, and vlc).  In fs_cli, I see debug info (example
copied below [1]) that seems to indicate successful connections. 
However, the RTMP client never receives any data from the server and
disconnects after around 30 seconds.

I'm trying to connect via URLs like:
rtmp://<domain>:<port>/plenary-conferencename
rtmp://<domain>:<port>/plenary-conferencename at plenary-conference-profile
rtmp://<domain>:<port>/default/plenary-conferencename
and so on, and all exhibit the same behavior.  It doesn't seem to matter
what path I put -- freeswitch accepts the connection, sends no data,
then disconnects after a while.  This leads me to suspect I might just
be getting the path name wrong.

My questions, if anyone has experience with this:

What is the correct path for the rtmp URL to connect to a video
conference -- is it just the $destination_number, or something else?
Are there any obvious steps I'm missing to set up rtmp feeds, or any
suggestions for how to do smarter debugging of this?
Does anyone have an example project that successfully broadcasts RTMP
from a video conference to e.g. youtube?
Is there a better or more convenient approach to broadcasting a video
stream from a conference that you prefer to rtmp?


The full freeswitch config I'm using is here:
https://gitlab.com/cdetar/plenary-server/tree/master/ansible/roles/plenary/templates/freeswitch
, if that's helpful.  (Those are templates for an ansible config, so
they contain variables that get interpolated in using {{var}} syntax).

best,
Charlie

[0] Glancing reference to youtube+rtmp:
https://freeswitch.org/confluence/display/FREESWITCH/FreeSWITCH+1.6+Video#FreeSWITCH1.6Video-What%27snew

[1] fs_cli debug info while attempting to connect via RTMP:

2016-09-13 23:37:40.551744 [NOTICE] mod_rtmp.c:903 New RTMP session
[1513874f-9084-470c-a2de-7e5f92bb2296]
2016-09-13 23:37:40.551744 [INFO] rtmp_tcp.c:234 Rtmp connection from
98.127.250.255:44131
2016-09-13 23:37:40.551744 [DEBUG] rtmp.c:882 Sent handshake response
2016-09-13 23:37:40.711748 [DEBUG] rtmp.c:907 Done with handshake
2016-09-13 23:37:40.711748 [DEBUG] rtmp.c:1081 [chunk_stream=3 type=0x14
ts=0 stream_id=0x0] len=204
2016-09-13 23:37:40.711748 [DEBUG] rtmp.c:192 [amfnumber=3] Got INVOKE
for connect
2016-09-13 23:37:40.711748 [DEBUG] rtmp.c:656 [amfnumber=2 type=0x1
stream_id=0x0] len=4 
2016-09-13 23:37:40.711748 [DEBUG] rtmp.c:656 [amfnumber=2 type=0x5
stream_id=0x0] len=4 
2016-09-13 23:37:40.711748 [DEBUG] rtmp.c:656 [amfnumber=2 type=0x6
stream_id=0x0] len=5 
2016-09-13 23:37:40.711748 [DEBUG] rtmp.c:656 [amfnumber=2 type=0x4
stream_id=0x0] len=6 
2016-09-13 23:37:40.711748 [DEBUG] rtmp.c:656 [amfnumber=3 type=0x14
stream_id=0x0] len=201 
2016-09-13 23:37:40.711748 [DEBUG] rtmp.c:656 [amfnumber=3 type=0x14
stream_id=0x0] len=61 
2016-09-13 23:37:40.711748 [NOTICE] rtmp_sig.c:122 Sent connect reply
2016-09-13 23:37:40.851748 [DEBUG] rtmp.c:1081 [chunk_stream=2 type=0x5
ts=0 stream_id=0x0] len=4
2016-09-13 23:37:40.851748 [DEBUG] rtmp.c:1184 Set window size: from
2097152 to 2097152 bytes
2016-09-13 23:37:40.851748 [DEBUG] rtmp.c:1081 [chunk_stream=2 type=0x4
ts=0 stream_id=0x0] len=10
2016-09-13 23:37:40.851748 [DEBUG] rtmp.c:91 Control (3): 00 00 00 00 00
00 01 2c 
2016-09-13 23:37:40.851748 [INFO] rtmp.c:118 stream=0 Client buffer set
to 300ms
2016-09-13 23:37:40.851748 [DEBUG] rtmp.c:1081 [chunk_stream=3 type=0x14
ts=0 stream_id=0x0] len=25
2016-09-13 23:37:40.851748 [DEBUG] rtmp.c:192 [amfnumber=3] Got INVOKE
for createStream
2016-09-13 23:37:40.851748 [DEBUG] rtmp.c:656 [amfnumber=3 type=0x14
stream_id=0x0] len=29 
2016-09-13 23:37:40.851748 [INFO] rtmp_sig.c:137 Replied to createStream
(0)
2016-09-13 23:37:40.991748 [DEBUG] rtmp.c:1081 [chunk_stream=8 type=0x14
ts=0 stream_id=0x1] len=82
2016-09-13 23:37:40.991748 [DEBUG] rtmp.c:192 [amfnumber=8] Got INVOKE
for play
2016-09-13 23:37:40.991748 [DEBUG] rtmp_sig.c:198 Got play for
plenary-test-pattern-alpha at plenary-conference-profile on stream 1
2016-09-13 23:37:40.991748 [DEBUG] rtmp.c:656 [amfnumber=2 type=0x1
stream_id=0x0] len=4 
2016-09-13 23:37:40.991748 [DEBUG] rtmp.c:656 [amfnumber=2 type=0x4
stream_id=0x0] len=6 
2016-09-13 23:37:40.991748 [DEBUG] rtmp.c:656 [amfnumber=2 type=0x4
stream_id=0x0] len=10 
2016-09-13 23:37:40.991748 [DEBUG] rtmp.c:656 [amfnumber=5 type=0x14
stream_id=0x1] len=135 
2016-09-13 23:37:40.991748 [DEBUG] rtmp.c:656 [amfnumber=5 type=0x14
stream_id=0x1] len=135 
2016-09-13 23:37:40.991748 [DEBUG] rtmp.c:656 [amfnumber=5 type=0x12
stream_id=0x1] len=44 
2016-09-13 23:37:40.991748 [DEBUG] rtmp.c:656 [amfnumber=5 type=0x12
stream_id=0x1] len=24 
2016-09-13 23:37:40.991748 [DEBUG] rtmp.c:1081 [chunk_stream=2 type=0x4
ts=0 stream_id=0x0] len=10
2016-09-13 23:37:40.991748 [DEBUG] rtmp.c:91 Control (3): 00 00 00 01 02
25 51 00 
2016-09-13 23:37:40.991748 [INFO] rtmp.c:118 stream=1 Client buffer set
to 36000000ms
2016-09-13 23:37:43.951733 [DEBUG] rtmp.c:1081 [chunk_stream=3 type=0x14
ts=0 stream_id=0x0] len=34
2016-09-13 23:37:43.951733 [DEBUG] rtmp.c:192 [amfnumber=3] Got INVOKE
for deleteStream
2016-09-13 23:37:43.951733 [NOTICE] rtmp.c:918 Disconnected from flash
client
2016-09-13 23:37:43.951733 [DEBUG] rtmp_tcp.c:243 Closing socket
2016-09-13 23:37:44.691705 [NOTICE] mod_rtmp.c:1025 RTMP session ended
[1513874f-9084-470c-a2de-7e5f92bb2296]



Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list