[Fiware-creatifi-coaching] [CreatiFI Benelux Hub] Screencast stream not being recorded in Kurento GE

Andrea Maestrini amaestrini at create-net.org
Fri Mar 4 10:29:39 CET 2016


Dear FIWARE coach,
we forward you a support request received from a CreatiFI applicant we are
not able to solve.
Please let us know if you need direct contact with the submitter.
Thanks.

******************************

Hello,

We are trying to record a screencast.

The screencast is sent to Kurento that is able to send it back to the
client.
But the stream is not recorded, the file is created but stays at zero bytes.

Actually, we have been recording files on v5.1.0 without any problems.
Now we moved to v6.4.0 we changed the code accordingly but now the
screencast stream is not recorded any more.

Project is blocked because of this, we need help urgently!

This is the code we use to stream and record:

    var screencastConstraints = {
        audio: false,
        video: {
            mandatory: {
                maxWidth: 640,
                maxHeight: 480,
                maxFrameRate: 15,
                minFrameRate: 1
            }
        }
    };

    this.startScreencast = function () {
        var screencastInput = document.getElementById('screencastInput')
        var options = {
           localVideo: null,
           remoteVideo: screencastInput,
           mediaConstraints: screencastConstraints,
           configuration :  { iceServers :  [
                {"url":"turn:numb.viagenie.ca:3478",
                 "username":"<username>",
                 "credential":"<credential>"}
                ] }
        };
        var pipeline = self.pipeline;

        if (pipeline != null) {
            // self.webRtcPeerScreencast =
kurentoUtils.WebRtcPeer.startSendOnly(null, onOffer, onError,
screencastConstraints);
            self.webRtcPeerScreencast =
kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options, function(error)
            {
                if(error) return onError(error);

                this.generateOffer(onOffer);
            });

        } else {
            $log.debug('Pipeline == null');
        }

        function onError(error) {
            $log.log(error);
        }

        function onOffer(error, offer) {
            $log.log("Offer...");
            var elements =
                [
                  {type: 'RecorderEndpoint', params: {uri :
file_uri_path + file_uri_screencast + sessionID + file_uri_format}},
                  {type: 'WebRtcEndpoint', params: {}}
                ];

                kurentoClient(ws_uri, function (error, client) {
                    if (error) return onError(error);
                    client.create('MediaPipeline', function (error,
mypipeline) {
                        if (error) return onError(error);
                        $log.log("Got MediaPipeline");

                        mypipeline.create(elements, function(error, elements){
                            if (error) return onError(error);

                            var recorder = elements[0];
                            var webRtc   = elements[1];


setIceCandidateCallbacks(self.webRtcPeerScreencast, webRtc, onError);

                            webRtc.processOffer(offer, function(error, answer) {
                                if (error) return onError(error);

                                console.log("offer");

                                webRtc.gatherCandidates(onError);
                                self.webRtcPeerScreencast.processAnswer(answer);
                            });

                            client.connect(webRtc, webRtc, recorder,
function(error) {
                                if (error) return onError(error);
                                self.screencastRecorder = recorder;

                                console.log("Connected");

                                recorder.record(function(error) {
                                  if (error) return onError(error);

                                  console.log("record");
                                });
                            });
                        });
                    });
                });
            }

    };



******************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fiware.org/private/fiware-creatifi-coaching/attachments/20160304/bdd86ca9/attachment.html>


More information about the Fiware-creatifi-coaching mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy