Intel® Collaboration Suite for WebRTC
Community support and discussions on the Intel® Collaboration Suite for WebRTC (Intel® CS for WebRTC).
1146 Discussions

How to publish the share-screen stream to addExternalOutPut

gellert_h_
Beginner
440 Views

when i use addExternalOutPut to publish camera it is success

but when i use addExternalOutPut to publish share-screen stream it has a error:

 

ERROR: start external streaming failed: response error

 

give me help! Thanks

0 Kudos
4 Replies
gellert_h_
Beginner
440 Views

i try to review woogeen.sdk,js

i find the addExternalOutput Function

this use the f Function

then,l through a.emit found the /portal/socketIOServer.js

r.on("addExternalOutput",
    function(e, r) {
        if (!t.inRoom) return safeCall(r, "error", "unauthorized");
        if (log.debug("Add serverUrl:", e.url, "options:", e), "string" != typeof e.url || "" === e.url) return safeCall(r, "error", "Invalid RTSP/RTMP server url");
        var i = url.parse(e.url);
        if ("rtsp:" !== i.protocol && "rtmp:" !== i.protocol || !i.slashes || !i.host) return safeCall(r, "error", "Invalid RTSP/RTMP server url");
        void 0 === e.streamId && (e.streamId = t.inRoom);
        var a = {};
        return (e.audio || void 0 === e.audio) && (a.audio = {
            fromStream: e.streamId,
            codecs: e.audio && e.audio.codecs || ["aac"]
        }),
        (e.video || void 0 === e.video) && (a.video = {
            fromStream: e.streamId,
            codecs: e.video && e.video.codecs || ["h264"]
        }),
        a.video && e.resolution && "number" == typeof e.resolution.width && "number" == typeof e.resolution.height && (a.video.resolution = widthHeight2Resolution(e.resolution.width, e.resolution.height)),
            a.url = i.format(),
            o.subscribe(n, "avstream", a,
                function(e) {
                log.info(e);
                    "failed" === e.type ? (log.info("addExternalOutput onConnection error:", e.reason), safeCall(r, "error", e.reason)) : "ready" === e.type && safeCall(r, "success", {
                        url: a.url
                    })
                }).then(function(e) {})["catch"](function(e) {
                var o = "string" == typeof e ? e: e.message;
                log.info("portal.subscribe failed:", o),
                    safeCall(r, "error", o)
            })
    })

 

when i output camera stream success , this log {type: "ready"}

and when i output share-screen fail,this log{type:"fail"},but this reason is undefined

 

2017-01-11 01:39:36.092  - INFO: SocketIOServer - { type: 'ready',

  audio_codecs: [ 'pcm_raw' ],

  video_codecs: [ 'h264' ] }

2017-01-11 01:41:33.744  - INFO: SocketIOServer - portal.unsubscribe failed: subscription does not exist

2017-01-11 01:41:33.752  - INFO: SocketIOServer - portal.unpublish failed: stream does not exist

2017-01-11 01:43:09.865  - INFO: SocketIOServer - portal.unpublish failed: stream does not exist

2017-01-11 01:43:34.491  - INFO: SocketIOServer - portal.unsubscribe failed: subscription does not exist

2017-01-11 01:51:20.942  - INFO: SocketIOServer - { type: 'failed', reason: undefined }

2017-01-11 01:51:20.944  - INFO: SocketIOServer - addExternalOutput onConnection error: undefined

 

 

 

 

0 Kudos
Lei_Z_Intel1
Employee
440 Views

Currently the audio-only or video-only stream output is not supported. ShareScreen is video-only stream. We will consider this feature in future. Can you please share your business usage here on send to webrtc_support@intel.com? This can help us to define its priority.

0 Kudos
Aydin_A_
Beginner
440 Views

Any update?

We are currently developing a aducation application and screen sharing is the most important thing. We must publish the screen sharing stream to the viewers via mixed stream (because viewers watch HLS stream). But we can't.

0 Kudos
Aydin_A_
Beginner
440 Views

Ok guys, I found an alternative way to do this.

We can mix a screen share stream in to the common (mixed) stream via ConferenceClient.mix function. I test it and worked for me. Just mix the screen share stream when it published.

For example:

client.publish(screenStream, (publishedScreenStream) => {
  client.mix(screenStream, [commonMixedStream], () => {
    console.log('screen share stream mixed');
  });
});

And then call addExternalOutput with commonMixedStream (or just ignore)

0 Kudos
Reply