Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this case, sound will be encoded to PCMA (alaw) with sample rate 8 kHz.

Using custom

...

lossless videoprocessor for incoming streams handling

To handle mixer incoming streams, if additional bufferizing or audio and video tracks syncronizing is required for example, the custom losless lossless videoprocessor may be used. This feature is enabled with the following parameter in flashphoner.properties file

...

By default, maximum mixer buffer size is 200 ms. After filling this buffer, the custom losless lossless videoprocessor uses its own buffer and waits for mixer buffer freeing. The period of mixer buffer checking is set in milleseconds milliseconds with this parameter

Code Block
themeRDark
mixer_lossless_video_processor_wait_time_ms=20

By default, the mixer buffer checking period is 20 ms.

Note that usng using the custom losless lossless videoprocessor may degrade realtime perfomance.

When custom losless lossless videoprocessor is used, it is necessary to stop mixer with REST query /mixer/terminate to free all consumed resources. Mixer can be stopped also by stopping all incaming incoming streams, in this case mixer will stop when following timeout in milliseconds expires

Code Block
themeRDark
mixer_activity_timeridle_timeout=60000

By default, mixer will stop after 60 seconds if there are no active incoming streams.

...

By default, three mixer output stream layouts are implemented:

1. Grid layoudlayout

This layout can be enabled with the following parameter in flashphoner.properties file

...

and works for input streams of equal resolution with thesame  the same  aspect ratio only


3. Desktop (screen sharing) layout

...

Code Block
languagejava
themeRDark
titleTestLayout.java
package com.flashphoner.mixerlayout;

import com.flashphoner.sdk.media.mixer.video.presentation.BoxIVideoMixerLayout;
import com.flashphoner.sdk.media.mixer.video.presentation.BoxPositionYUVFrame;
import comjava.flashphoner.media.mixer.video.presentation.VideoLayoutawt.*;
import comjava.flashphoner.sdk.media.IVideoMixerLayout;
import com.flashphoner.sdk.media.YUVFrame;
import java.util.ArrayListutil.ArrayList;

public class TestLayout extendsimplements VideoLayoutIVideoMixerLayout {

    private static final int PADDING = 5;

    @Override
    public Layout[] computecomputeLayout(YUVFrame[] yuvFrames, String[] framesstrings, int canvasWidth, int canvasHeight) {
        ArrayList<IVideoMixerLayout.Layout> return computeGrid(frames, canvasWidth, canvasHeightlayout = new ArrayList<>();
    }

    private IVideoMixerLayout.Layout[] computeGrid(YUVFrame[] frames, int canvasWidth, int canvasHeightfor (int c = 0; c < yuvFrames.length; c++) {
            BoxPoint mainBoxprevPoint = new Box(null, canvasWidth, canvasHeightPoint();
        for (int i = 0;Dimension iprevDimension < frames.length; i++) {= new Dimension(canvasWidth, canvasHeight);
            if (layout.size() > 0) {
                prevPoint.setLocation(layout.get(c-1).getPoint());
                prevDimension.setSize(layout.get(c-1).getDimension());
            }
            BoxPoint frameBoxcurrentPoint = new Box(mainBox, canvasWidth/frames.length, canvasHeight/frames.length);
Point((int) (prevPoint.getX()+prevDimension.getWidth()+PADDING), 
                   frameBox.setPosition(BoxPosition.INLINE_HORIZONTAL_CENTER);
            frameBox.setPaddingLeft(PADDING);
            frameBox.setPaddingRight(PADDING(int)(prevPoint.getY()+prevDimension.getHeight()));
            Box frame = new Box(frameBox, frames[i]);
layout.add(new IVideoMixerLayout.Layout(currentPoint, new Dimension(canvasWidth/yuvFrames.length, 
		             frame.setPosition(BoxPosition.INLINE_HORIZONTAL);
            frame.fillParent();
        }
        ArrayList<IVideoMixerLayout.Layout> layout = new ArrayList<>( canvasHeight/yuvFrames.length), yuvFrames[c]));
        mainBox.computeLayout(layout);}
        return layout.toArray(new IVideoMixerLayout.Layout[layout.size()]);
    }

}

Then the class should be complied into byte code. To do this, create folder tree accordind according to TestLayout class package name

...