Renegotiation

AzraelPwnz

New Member
Hello,

I am publishing a stream with success and starting a recording; however, I need to add audio tracks after a stream as been published.

How can I send a new (remote) SDP to the WebCallServer with the WebSockets API without having to republish the stream altogether? I would like to not have to interrupt a recording just to add an audio track.

So in summary, I would like to:
1. Connect. < -working
2. Negotiate and send video tracks to the peer (WebCallServer). <- working
3. Publish Stream <- working
4. Start Recording <- working
5. Add audio tracks to the peer (WebCallServer) connection <-not working

Adding the tracks on my side (at a later time) will trigger renegotiation, which is what is supposed to happen, but I cannot find a way in the Flashphoner documentation to send the new SDP to the Flashphoner Raw WebSockets API. The only two methods that take in the SDP are are Play and Publish methods, but I cannot re-publish a stream without my recording stopping and I would like it to be continuous.
 
Last edited:

Max

Administrator
Staff member
Hello!

For your case, you can try using a mixer and publish additional audio tracks to the mixer.

The mixer is formed on the server side and the original video stream is fed into it. Publish the audio stream separately and add it to this mixer too. The output stream of the mixer will be recorded.

To enable recording of the mixer output stream, specify in the Flashphoner.properties file
Code:
record_mixer_streams = true
On the server side, we create a mixer, for this we use the REST request /mixer/startup

Code:
{
 "uri": "mixer://mixer1",
 "localStreamName": "mixed-stream",
 "hasVideo": "true",
 "hasAudio": "true",
 }
And insert the original video stream into it (for example, stream1) with the REST request /mixer/add

Code:
{
 "uri": "mixer://mixer1",
 "remoteStreamName": "stream1",
 "hasVideo": "true",
 "hasAudio": "true"
}
On the client side, from which you want to publish an audio stream, publish this stream in any convenient way (for example, via Two-Way Streaming, stream name stream2) and add the stream to the REST mixer with the /mixer/add request

Code:
{
 "uri": "mixer: //mixer1",
 "remoteStreamName": "stream2",
 "hasVideo": "false",
 "hasAudio": "true"
}
We will set the "hasVideo" parameter to "false", because we are only interested in the audio stream.

More about working with the mixer https://docs.flashphoner.com/display/WCS52EN/Stream+mixer
 
Top