Highlighted

Publish stream on RTMFP+H264 work with only one receiver?

New Here ,
Sep 17, 2015

Copy link to clipboard

Copied

Hi, when I try to publish a video stream on rtmfp://p2p.rtmfp.net/ using codec H264 type DIRECT_CONNECTIONS, the first receiver that connect to the publisher correctly display the video stream, but when I try to connect a second receiver, it (the seconds) receives only a black frame.


Other tests I did were:

     1) Publish a video stream on rtmfp://p2p.rtmfp.net/ using codec H264 type DIRECT_CONNECTIONS;

     2) Start the receiver that connects to the publisher (the receiver correctly displays the video stream);

     3) Close the connection to the publisher by the receiver.

     4) Restart the receiver and reconnecting it to the publisher (I receive now only frame blacks).

I tried to publish using the Sorenson codec and works quietly without any problems, so I assume the problem is on H264

.

Someone else has encountered the same problem?

TOPICS
Performance issues

Views

391

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Publish stream on RTMFP+H264 work with only one receiver?

New Here ,
Sep 17, 2015

Copy link to clipboard

Copied

Hi, when I try to publish a video stream on rtmfp://p2p.rtmfp.net/ using codec H264 type DIRECT_CONNECTIONS, the first receiver that connect to the publisher correctly display the video stream, but when I try to connect a second receiver, it (the seconds) receives only a black frame.


Other tests I did were:

     1) Publish a video stream on rtmfp://p2p.rtmfp.net/ using codec H264 type DIRECT_CONNECTIONS;

     2) Start the receiver that connects to the publisher (the receiver correctly displays the video stream);

     3) Close the connection to the publisher by the receiver.

     4) Restart the receiver and reconnecting it to the publisher (I receive now only frame blacks).

I tried to publish using the Sorenson codec and works quietly without any problems, so I assume the problem is on H264

.

Someone else has encountered the same problem?

TOPICS
Performance issues

Views

392

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 17, 2015 0
New Here ,
Sep 18, 2015

Copy link to clipboard

Copied

This is the code of the publisher used:


public function publish():void

{

    _netConnection = new NetConnection();

    _netConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

    _netConnection.connect("rtmfp://p2p.rtmfp.net/" + DEVELOPER_KEY + '/');

}

public function netStatusHandler(event:NetStatusEvent):void

{

    switch (event.info.code)

    {

        case "NetConnection.Connect.Success":

        {

            var groupSpecifier:GroupSpecifier = new GroupSpecifier(_groupName);

           

            groupSpecifier.serverChannelEnabled                 = true;

            groupSpecifier.ipMulticastMemberUpdatesEnabled         = true;   

            groupSpecifier.postingEnabled                         = true;               

            groupSpecifier.routingEnabled                        = false;

            groupSpecifier.peerToPeerDisabled                    = false;       

            groupSpecifier.multicastEnabled                     = false;

            groupSpecifier.objectReplicationEnabled             = false;

           

            _netGroup = new NetGroup(_netConnection, groupSpecifier.groupspecWithAuthorizations());

            _netGroup.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

            break;

        }

           

        case "NetGroup.Connect.Success":

        {

            publish(_camera, _microphone, _videoSettings);

           

            break;

        }

    }

}

public function publish(camera:Camera, microphone:Microphone, videoSettings:VideoStreamSettings = null):void

{

    _netStreamMetaData = new Object();

    // Inizializza i metadati

    if (videoSettings)

    {

        _netStreamMetaData.codec                 = videoSettings.codec;

        _netStreamMetaData.frameRate             = camera.fps;

        _netStreamMetaData.quality                = camera.quality;

        _netStreamMetaData.bandwith             = camera.bandwidth;

        _netStreamMetaData.width                 = camera.width;

        _netStreamMetaData.height                 = camera.height;

        _netStreamMetaData.keyFrameInterval     = camera.keyFrameInterval;

    }

    else

    {

        _netStreamMetaData.codec                 = null;

        _netStreamMetaData.frameRate             = 0;

        _netStreamMetaData.quality                = 0;

        _netStreamMetaData.bandwith             = 0;

        _netStreamMetaData.width                 = 0;

        _netStreamMetaData.height                 = 0;

        _netStreamMetaData.keyFrameInterval     = 0;

    }

       

    // Inizializza il NetStream

    _netStream = new NetStream(_netConnection, NetStream.DIRECT_CONNECTIONS);

    _netStream.client = {};

    _netStream.client.onPeerConnect = function(subscriber:NetStream):Boolean

    {

        return true;

    };

    _netStream.addEventListener(NetStatusEvent.NET_STATUS, netStreamPublisher_netStatusHandler);

    // Impostazioni NetStream

    _netStream.audioReliable     = false;   

    _netStream.dataReliable     = false;

    _netStream.videoReliable     = false;

    _netStream.bufferTime         = 0;

    //_netStream.useJitterBuffer     = true;

    _netStream.attachCamera(camera);

    _netStream.attachAudio(microphone);

    // FIX:

    // http://help.adobe.com/it_IT/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#videoStr...

    if (videoSettings)

        _netStream.videoStreamSettings = videoSettings;

    _netStream.publish("livestream");

}

public function netStreamPublisher_netStatusHandler(event:NetStatusEvent):void

{

    switch (event.info.code)

    {

        case "NetStream.Play.Start":

        {

            // FIX:

            // http://forums.adobe.com/thread/16862

            // https://github.com/OpenRTMFP/Cumulus/issues/43#issuecomment-2758147

            // http://forums.adobe.com/thread/632355?decorator=print&displayFullThread=true

            // http://forums.adobe.com/message/3658836

            _netStream.send("|RtmpSampleAccess", true, true);

           

            _netStream.send("onMetaData", _netStreamMetaData);

           

            break;

        }

    }

}

and this is the code of the receiver:


public function publish():void

{

    _netConnection = new NetConnection();

    _netConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

    _netConnection.connect("rtmfp://p2p.rtmfp.net/" + DEVELOPER_KEY + '/');

}

public function netStatusHandler(event:NetStatusEvent):void

{

    switch (event.info.code)

    {

        case "NetConnection.Connect.Success":

        {

            var groupSpecifier:GroupSpecifier = new GroupSpecifier(_groupName);

           

            groupSpecifier.serverChannelEnabled                 = true;

            groupSpecifier.ipMulticastMemberUpdatesEnabled         = true;   

            groupSpecifier.postingEnabled                         = true;               

            groupSpecifier.routingEnabled                        = false;

            groupSpecifier.peerToPeerDisabled                    = false;       

            groupSpecifier.multicastEnabled                     = false;

            groupSpecifier.objectReplicationEnabled             = false;

           

            _netGroup = new NetGroup(_netConnection, groupSpecifier.groupspecWithAuthorizations());

            _netGroup.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

            break;

        }

           

        case "NetGroup.Neighbor.Connect":

        {

            play(_peerID);

           

            break;

        }

    }

}

public function play(peerID:String):void

{   

    _netStream = new NetStream(_netConnection, peerID);

    _netStream.client = {};

               

    //_netStream.useHardwareDecoder = true;

           

    _netStream.play("livestream");

}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 18, 2015 0
didoin LATEST
New Here ,
Sep 23, 2015

Copy link to clipboard

Copied

No one has ever had the same problem?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 23, 2015 0