Jump to content
  • 0

Merge Streams of different resolutions


Alex A
 Share

Question

Is it possible to use the Merge Stream function with streams of different sizes/resolutions ? so that for example we could define a large stream with smaller streams positioned around it ? how can we define the positions of the streams and their relative sizes etc.

I guess this is not possible using Merge Stream and we would have to write a client which retrieves all streams and draws them to a canvas and broadcast that, correct ?

Thanks

Alex.
Link to comment
Share on other sites

  • Answers 10
  • Created
  • Last Reply

Top Posters For This Question

10 answers to this question

Recommended Posts

  • 0

Hi Alex,

Have a good day.

Is it possible to use the Merge Stream function with streams of different sizes/resolutions ?

Currently, stream resolutions are making it compatible with merge_streams.html page.

how can we define the positions of the streams and their relative sizes etc.
Streams are automatically positioning with conference room list.

I guess this is not possible using Merge Stream and we would have to write a client which retrieves all streams and draws them to a canvas and broadcast that, correct ?

Yes, current merge_streams.html page is drawing with canvas and broadcasting. You're right.

I hope, I could help you.

Best Regards,
Selim

Link to comment
Share on other sites

  • 0

Is it possible to use the Merge Stream function with streams of different sizes/resolutions ? so that for example we could define a large stream with smaller streams positioned around it ? how can we define the positions of the streams and their relative sizes etc.

I guess this is not possible using Merge Stream and we would have to write a client which retrieves all streams and draws them to a canvas and broadcast that, correct ?

Hi Alex,

Stream_merger.js is already something like that, you can play with the source code: https://github.com/ant-media/StreamApp/blob/master/src/main/webapp/js/stream_merger.js

As you see when you are adding stream, disable automatic resize in the parameters of constructor which is this.autoMode , then you can add your streams with addStream options as they are commented in the code like;

/*

 

* Options

 

* streamId = Id of the stream

 

* width = width of the stream that is being merged

 

* height = height of the stream that is being merged

 

* X = Starting location pixel on canvas horizontal

 

* Y = Starting location pixel on canvas vertical

 

* Xindex = placement index of videos, index 0 means width * 0, index 1 means width * 1 as starting points

 

* Yindex = placement index of videos, index 0 means height * 0, index 1 means height* 1 as starting points

 

* mute = mute stream or not

 

*

 

*/

Cheers

 

Link to comment
Share on other sites

  • 0

Hi Tahir,

Thank you! that is exactly what we needed!

You seem to know all about this, so I think i'll ask you this separaate question directly;

is it possible to have a single video stream which contains multiple (7x different) audio tracks, and on the client-side be able to select which audio tracks in the video stream should be played ?

This is because we want to make a very specific mergestream which contains 7 different audio tracks, and on the client side we want to play all the audio EXCEPT for individual audio tracks which the client can 'mute'. So imagine a mergestream feed (single stream) which the viewers can MUTE the audio of individual participants within that stream.

So to do this, we imagine we would like 7x audio tracks inside the video stream, and be able to play/mute each audio track individually.

----
We could of course setup 7 independent streams, one for each audio track, but we are trying to simplify this and contain it within one stream.

Is this possible ?

Alex.

 

Link to comment
Share on other sites

  • 0

Hi Alex,

It is correct I know about merger because I am the one who developed it :) , I will answer the question on https://groups.google.com/g/ant-media-server/c/XsrvBjGPl6Q/m/XVBrKRtQBgAJ since it is the same one, let's continue discussion there.

Cheers

 

Link to comment
Share on other sites

  • 0

I'll ask this on this thread since I think it's relevant, if not I can start a new one :)

If I change the stream_merger.js file, what's the best way to deploy it in a running AntMedia server?
Right now I'm ssh to the server and replacing the file in /usr/local/AntMedia by hand

Thanks

 

Link to comment
Share on other sites

  • 0

Hi Ricardo,

Right now I'm ssh to the server and replacing the file in /usr/local/AntMedia by hand

Yes, you need to update stream_merger.js file. But you can use different location from under the application file. So, it can be an easier way for you. 

If you need help, I can prepare some code snippets for you.

Best Regards,
Selim

Link to comment
Share on other sites

  • 0

Hi,

Here are the details:

Ant Media Server using js files under the application folder: import {StreamMerger} from "./js/stream_merger.js" -> https://github.com/ant-media/StreamApp/blob/master/src/main/webapp/merge_streams.html#L153 

Use another location like: import {StreamMerger} from "https://antmedia.io/temp/stream_merger.js"

I hope, it's clear for you.

Best Regards,
Selim
Link to comment
Share on other sites

 Share

×
×
  • Create New...