How to do video broadcast using multicast group?

Flash Player version 10.1 or later allows you to do application level multicast groups instead of point-to-point media streams. Unlike client-server conferences using RTMP, this uses peer-to-peer group communication using centralized rendezvous. Unlike point-to-point RTMFP, this builds an application level multicast group hence is more efficient for video conference or event involving one (or few publishers) and many viewers. Consider the use case of a live event broadcast or live panel discussion broadcast to many viewers.

You must use VideoIO45.swf compiled using Flex SDK 4.5 or later to use this feature.

Adobe also hosts a service, which is free for developers for non-commercial use, to facilitate rendezvous of group communication. In particular, developers can signup for Cirrus developer key, and then build applications that use their service. Once you sign-up, you get a developer key and an rtmfp URL for the service. We have signed up for our VideoIO application with the following URL.

rtmfp://p2p.rtmfp.net/cda33663d4a6b46e507bad51-c52c716b8f44/

The VideoIO application exposes the group communication feature in the API where you can just set its src property to the correct URL and set another group property to correct group specifier to enable this application level multicast group communication. For illustrations in this section we assume our Cirrus developer key to connect to the service. In practice you should obtain and use your own developer key.

The example in this tutorial is similar to How to do one-to-many video broadcast? except that this uses rtmfp URL scheme to enable application level multicast groups instead of a media server, and this uses another group property to indicate the name of the multicast group. The one-to-many video broadcast requires all the listeners to know the rendezvous URL to connect to, the stream name to listen and play, and additionally the group name to join. The rendezvous URL and group name can be pre-configured in your application, so that every participant joins the same group. The broadcaster user picks a stream name, say "alice", and set the src property of her VideoIO application to enable publish as "rtmfp://.../?group=group1&publish=alice". The viewers use the same stream name to play by setting the play parameter in the src URL as "rtmfp://.../?group=group1&play=alice". Everything else is taken care of by the VideoIO application instances and Flash Player plugin. The broadcaster or viewer can stop the session by setting the src to null or "".

As mentioned before, there are two popular use cases for these kind of video broadcast: an event is broadcast live to number of viewers, or a conversation among small number of panel members is viewed by a number of viewers. In the first use case, we need one broadcast VideoIO and other listener VideoIO instances. The second use case is more complex since it involves both real-time conference among panelists and one-to-many broadcast to viewers. The difference is that the group broadcast mechanism has higher latency hence not suitable for real-time interaction among the panelists. Hence, the panelists should be able to talk using multi-party conference and peer-to-peer streams for low latency conversation. Each panelist also publisher her stream using a new group. All viewers listen to the groups of all the panelists. Since different groups may have different latency during run time, it is possible for the viewers to see or hear the conversation out of order.

In this tutorial we will show the first use case with one broadcast VideoIO and other three listener VideoIO instances as shown below. To test the demonstration, first click on the set button of the first VideoIO instance below. This will set the src property as specified using the group and publish URL parameters, and start publishing your video to the specified group name of "demo/group1". Then click on the set buttons of the other three VideoIO instances. This will set the src property of those VideoIO instances as specified using the group and play URL parameters, and start playing the stream named "alice" in the group named "demo/group1". You can also notice the latency from broadcaster to viewer.

?group=
&publish=
&play= &
&play=
&play= &

The source code of this is similar to earlier examples. You can also right-click and select "View page source" or equivalent menu option to see the source code.

Summary

In summary, you can use the src property with URL parameters containing publish and group for broadcast stream, and play and group for viewer stream. Additionally, you must use the rtmfp URL scheme pointing to the rendezvous service. Please see How to use the VideoIO API? for details on new properties associated with group communication.