...
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="utf-8"?> <body xsi:noNamespaceSchemaLocation="schema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <div width="320" height="180" padding-left="0" padding-right="0" padding-bottom="0" align="TOP_CENTER"> <video>test1.*</video> </div> <div width="320" height="180" padding-left="0" padding-right="0" padding-bottom="0" align="BOTTOM_CENTER"> <video>test2.*</video> </div> <div width="160" height="90" padding-left="0" padding-right="0" padding-bottom="0" align="RIGHT"> <video><<video>.*</video> </div> </body> |
In this case test3 will be displayed in last video element
...
Lets' create a custom mixer layout for 640x360 mixer stream up to threeparticipantsthree participants. Note that all the picture sizes should be set explicitly, and should not exceed mixer canvas size.
One participant description:
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="utf-8"?> <body xsi:noNamespaceSchemaLocation="schema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <div width="320" height="180" padding-left="0" padding-right="0" padding-bottom="0" xalign="0" y="0LEFT"> <video crop="false">test1.*</video> </div> <div width="320" height="180" padding-left="0" padding-right="0" padding-bottom="0" xalign="320" y="0RIGHT"> <video crop="false">test2.*</video> </div> <div <div width="320" height="180" padding-left="0" padding-right="0" padding-bottom="0" align="BOTTOM_CENTER"> <video crop="faslefalse">test3.*</video> </div> </body> |
...
The mixer with test1, test2, test3 streams output example
Custom layout displaying tool
Since build 5.2.1035 custom mixer layout displaying tool is added. The tool should be launched from command line
Code Block | ||||
---|---|---|---|---|
| ||||
cd /usr/local/FlashphonerWebCallServer/tools
bash ./mixer_layout_tool.sh /path/to/mixer_layout -o=/path/to/output |
The tool writes mixer layout pictures to the folder defined, one PNG picture per one layout descriptor file
The following parameters are supported:
- /path/to/mixer_layout - path to layout folder, mandatory
- -o=/path/to/output - path to pictures output folder
- -n=1 - participants count to display a picture; if this is not set, pictures for all participants count will be written
- -N=test1,test2,test3 - stream names list to use for pictures rendering; if streams count in list is lower than participants count, automatically generated names will be used: stream0, stream1 etc
- -p=test - perfix to generate stream names; in this case, stream names wuill be generated subsequently, starting from 0, for example test0, test1, test2 etc
- -a - draw speech indicator frame around all the pictures
The tool uses current mixer settings from flashphoner.properties file
Displaying examples
Look at pictures displaying examples for the custom layout described above
1. The picture for one participant with speech indicator displaying, stream names are set explicitly
Code Block | ||||
---|---|---|---|---|
| ||||
bash ./mixer_layout_tool.sh /opt/mixer_layout -o=/tmp -N=test1,test2,test3 -n=1 -a |
Output file /tmp/1_test.png
2. The picture for three participants, stream names are formed automatically with the prefix set
Code Block | ||||
---|---|---|---|---|
| ||||
bash ./mixer_layout_tool.sh /opt/mixer_layouts -o=/tmp -p=test -n=3 |
Output file /tmp/3_test.png
Stream names templates in this layout descriptors are set explicitly as test1.*
, test2.*
, test3.*
. When stream names are generated automatically, streams count starts from 0, therefore the following names were generated for this participants count: test0
, test1
, test2
. In this case, for missed stream test3
name is displayed as No stream for: test3.*
Error handling
If one of the pictures size in custom layout descriptor exceeds mixer canvas size, the tool will display the following error message, and PNG file will not be generated:
Code Block | ||
---|---|---|
| ||
13:54:49,232 INFO toryLayoutController - Mixer got 2 frames. Using 2_test.mix descriptor
Computed layout would produce exception: java.lang.RuntimeException: Computed layout element: Layout{point=java.awt.Point[x=-106,y=0], dimension=java.awt.Dimension[width=852,height=478], frame:true} out of bounds
Please check configuration for this set of participants: [test1, test2] |
If a mixer is created with such custom layout, the mixer will be closed with the same error message.