A production studio layout defines how one or more resources are referenced and arranged. You can create an appropriate layout based on your business scenario.

You can set the following parameters to reference and arrange resources:
  • BlendList: the location IDs of the video layers that are referenced in the layout. The video layers in the layout are overlaid from bottom to top in the order that is specified by this parameter.
  • MixList: the location IDs of the audio streams that are referenced in the layout. The audio streams in the layout are mixed in the order that is specified by this parameter.
  • VideoLayer: the configurations of the video layers that are referenced in the layout, including the reference origin of the coordinates, normalized width and height of the video layers, and positions of the video layers. Make sure that the video layers specified in this parameter are consistent with and in the same order as those specified in the BlendList parameter.
  • AudioLayer: the configurations of the audio streams that are referenced in the layout, including the volume and input channel. Make sure that the audio streams specified in this parameter are in the same order as those specified in the MixList parameter.

Parameters for creating a sample single-image layout

For more information about the valid values of the parameters, see AddCasterLayout.

Parameter Example Description
Action AddCasterLayout The operation that you want to perform.
CasterId LIVEPRODUCER_POST-cn-v0h1557**** The ID of the production studio.
BlendList.1 RV01 The location ID of the video source.
MixList.1 RV01 The location ID of the video source.
VideoLayer.1.HeightNormalized 1.0 The normalized height of the video layer. The width of the video layer is proportionally scaled based on this parameter.
VideoLayer.1.PositionNormalized.1 1.0 The normalized x-axis value of the video layer.
VideoLayer.1.PositionNormalized.2 1.0 The normalized y-axis value of the video layer.
VideoLayer.1.PositionRefer topLeft The reference origin of the coordinates of the video layer in the layout. In this example, the origin is the upper-left corner of the playback window.
AudioLayer.1.ValidChannel leftChannel The audio input channel. In this example, the left channel is used.
AudioLayer.1.VolumeRate 1.0 The multiple of the original volume at which the audio stream is played. A value of 1.0 indicates the original volume.
Note A.n indicates the Nth number in the A list. A.n.B indicates the B parameter of the Nth struct element in the A list.

Sample code

public AddCasterLayoutResponse addCasterLayoutSample() {
        /* Set BlendList. */
        ArrayList<String> blendList = new ArrayList<String>();
        blendList.add("RV01");
        /* Set VideoLayers. */
        ArrayList<VideoLayer> videoLayers = new ArrayList<VideoLayer>();
        VideoLayer videoLayer = new VideoLayer();
        ArrayList<Float> positionNormalized = new ArrayList<Float>();
        positionNormalized.add(0f);
        positionNormalized.add(0f);
        videoLayer.setHeightNormalized(1f);  // Set the normalized height of the video layer.
        videoLayer.setPositionNormalizeds(positionNormalized); // Set the normalized coordinates of the video layer.
        videoLayer.setPositionRefer("topLeft"); // Set the reference origin of the coordinates of the video layer.
        videoLayers.add(videoLayer);
        /* Set MixList. */
        ArrayList<String> mixList = new ArrayList<String>();
        mixList.add("RV01");
        /* Set AudioLayers. */
        ArrayList<AudioLayer> audioLayers = new ArrayList<AudioLayer>();
        AudioLayer audioLayer = new AudioLayer();
        audioLayer.setVolumeRate(1f); // Set the multiple of the original volume at which the audio stream is played.
        audioLayer.setValidChannel("leftChannel"); // Set the audio input channel.
        audioLayers.add(audioLayer);
        
        AddCasterLayoutRequest addCasterLayoutRequest = new AddCasterLayoutRequest();
        addCasterLayoutRequest.setCasterId("LIVEPRODUCER_POST-cn-v0h1557****"); // Set the ID of the production studio.
        addCasterLayoutRequest.setBlendLists(blendList); // Set BlendList.
        addCasterLayoutRequest.setMixLists(mixList);  // Set MixList.
        addCasterLayoutRequest.setVideoLayers(videoLayers); // Set VideoLayers.
        addCasterLayoutRequest.setAudioLayers(audioLayers); // Set AudioLayers.
        AddCasterLayoutResponse addCasterLayoutResponse = null;
        try {
            addCasterLayoutResponse = LiveClient.getClient().getAcsResponse(addCasterLayoutRequest);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return addCasterLayoutResponse;
    }