Jump to content
  • 0

The possibility to play my own stream


dmitry027
 Share

Question

Hello, everyone.

I wonder if it is possible to play the stream which I am currently publishing from the server via WebRTC (let's say for diagnostic sake) instead of just playing the stream from webcam directly?

I'm trying to call webRTCAdaptor.play() passing my own streamId in publish_started callback, but getting "notSetRemoteDescription" error which states:

"webrtc_adaptor.js:908 set remote description is failed with error: InvalidAccessError: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote offer sdp: The order of m-lines in subsequent offer doesn't match order from previous offer/answer."

Am I doing something wrong or there is no such possibility at all?

  • Like 1
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0
17 hours ago, dmitry027 said:

Hello, everyone.

I wonder if it is possible to play the stream which I am currently publishing from the server via WebRTC (let's say for diagnostic sake) instead of just playing the stream from webcam directly?

I'm trying to call webRTCAdaptor.play() passing my own streamId in publish_started callback, but getting "notSetRemoteDescription" error which states:

"webrtc_adaptor.js:908 set remote description is failed with error: InvalidAccessError: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote offer sdp: The order of m-lines in subsequent offer doesn't match order from previous offer/answer."

Am I doing something wrong or there is no such possibility at all?

Hi @dmitry027

Are you trying something like this ?

Are you using same webRTCAdaptor object to publish and play ?

  • Like 2
Link to comment
Share on other sites

  • 0
6 hours ago, rahul7827 said:

Hi @dmitry027

Are you trying something like this ?

Are you using same webRTCAdaptor object to publish and play ?

Hello, @rahul7827, thank you for the answer.

Yes, I am using the same instance of WebRTCAdaptor for both publish and play.

I see that on the live demo page you have mentioned there are two different instances of WebRTCAdaptor used: one local (for publishing) and one inside iframe (for playing).

What I wanted to achieve is to publish and play using the same WebRTCAdaptor instance. Do you think it is possible?

Link to comment
Share on other sites

  • 0
4 hours ago, Selim said:

Hi @dmitry027,

Thank you for reporting this issue. Is there any reproduce scenario for that? Also, do you see any kind of error on the Ant Media Server logs?

Best Regards,

Selim

Hello, @Selim. Thank you for your answer.

It can be reproduced by adding the play() call inside publish_started callback of conference.html demo file:

} else if (info == "publish_started") {
  webRTCAdaptor.play(obj.streamId, token, roomNameBox.value);
  ...
}

When I start publishing + playing in the way described above, I see the following messages in antmedia-error.log:

(rtp_sender.cc:593): Tried to get DTMF sender from video sender.
(peer_connection.cc:6528): 0 is not ready to use the remote candidate because the local or remote description is not set.
(peer_connection.cc:6528): 1 is not ready to use the remote candidate because the local or remote description is not set.
(peer_connection.cc:6528): 2 is not ready to use the remote candidate because the local or remote description is not set.
(jsep_transport_controller.cc:360): Not adding candidate because the JsepTransport doesn't exist. Ignore it.
(jsep_transport_controller.cc:360): Not adding candidate because the JsepTransport doesn't exist. Ignore it.
(physical_socket_server.cc:557): Socket::OPT_DSCP not supported.
(basic_port_allocator.cc:952): Discarding candidate because port is already done gathering.
(rtp_sender.cc:593): Tried to get DTMF sender from video sender.
(rtp_sender.cc:593): Tried to get DTMF sender from video sender.
(used_ids.h:55): Duplicate id found. Reassigning from 1 to 14
(used_ids.h:55): Duplicate id found. Reassigning from 3 to 13
(used_ids.h:55): Duplicate id found. Reassigning from 5 to 12
(used_ids.h:55): Duplicate id found. Reassigning from 6 to 11
(physical_socket_server.cc:557): Socket::OPT_DSCP not supported.
(physical_socket_server.cc:557): Socket::OPT_DSCP not supported.
(frame_buffer2.cc:538): Frame with (picture_id:spatial_id) (29317:0) already inserted, dropping frame.
(rtp_sender.cc:593): Tried to get DTMF sender from video sender.
(frame_buffer2.cc:538): Frame with (picture_id:spatial_id) (29319:0) already inserted, dropping frame.
(frame_buffer2.cc:538): Frame with (picture_id:spatial_id) (29319:0) already inserted, dropping frame.
(frame_buffer2.cc:538): Frame with (picture_id:spatial_id) (29319:0) already inserted, dropping frame.

And in ant-media-server.log I see the following warnings:

2022-12-01 23:18:19,750 [https-jsse-nio2-0.0.0.0-5443-exec-3] WARN  i.a.e.adaptive.WebRTCEncoderAdaptor - Ice candidate will be added later for stream Id kmauKVylQmCsnMVW. PeerConnection null
2022-12-01 23:18:19,750 [https-jsse-nio2-0.0.0.0-5443-exec-3] WARN  i.a.e.adaptive.WebRTCEncoderAdaptor - Ice candidate will be added later for stream Id kmauKVylQmCsnMVW. PeerConnection null
2022-12-01 23:18:19,751 [https-jsse-nio2-0.0.0.0-5443-exec-3] WARN  i.a.e.adaptive.WebRTCEncoderAdaptor - Ice candidate will be added later for stream Id kmauKVylQmCsnMVW. PeerConnection null
2022-12-01 23:18:19,774 [network_thread - 119112] WARN  i.a.e.adaptive.WebRTCEncoderAdaptor - DataChannel is closed because it is not enabled
2022-12-01 23:18:19,873 [DecodingQueue - 119122] WARN  io.antmedia.muxer.WebMMuxer - Muxer is already running for stream: kmauKVylQmCsnMVW so it's not preparing io again and returning
2022-12-01 23:18:19,874 [vert.x-worker-thread-16] WARN  io.antmedia.muxer.WebMMuxer - First key frame received for stream: kmauKVylQmCsnMVW
2022-12-01 23:18:24,892 [vert.x-eventloop-thread-37] WARN  i.a.enterprise.webrtc.WebRTCClient - It's still not streaming so stop the webrtc client for stream: kmauKVylQmCsnMVW and client:157703772 
2022-12-01 23:18:24,896 [vert.x-eventloop-thread-42] WARN  i.a.enterprise.webrtc.WebRTCClient - Semaphore released by timer for 157703772

 

Link to comment
Share on other sites

  • 0
11 hours ago, dmitry027 said:

Hello, @rahul7827, thank you for the answer.

Yes, I am using the same instance of WebRTCAdaptor for both publish and play.

I see that on the live demo page you have mentioned there are two different instances of WebRTCAdaptor used: one local (for publishing) and one inside iframe (for playing).

What I wanted to achieve is to publish and play using the same WebRTCAdaptor instance. Do you think it is possible?

TBH, I am not sure this is possible or not,

May be we are using the same streamId for publish and play in a single webRTCAdaptor instance. So conflict would be there.

However by using seperate webRTCAdaptor instance it is possible, i had tried this as well. Can you please share the file so that i can also try to figure out next week.

Link to comment
Share on other sites

  • 0
1 hour ago, rahul7827 said:

TBH, I am not sure this is possible or not,

May be we are using the same streamId for publish and play in a single webRTCAdaptor instance. So conflict would be there.

However by using seperate webRTCAdaptor instance it is possible, i had tried this as well. Can you please share the file so that i can also try to figure out next week.

@rahul7827, sure, I have attached the file.

The only change I made is adding webRTCAdaptor.play(obj.streamId, token, roomNameBox.value); call to publish_started callback handler.

conference-mod.html

Link to comment
Share on other sites

 Share

×
×
  • Create New...