This topic describes how to use the API operations that are related to the production studio service.

Considerations

  • The production studio service provides only API services, which is different from production studios. To use the production studio service, you must develop a frontend web page and interaction features. You can read this topic before you build the production studio service.
  • The ApsaraVideo Live console provides production studios and a frontend web page for you to orchestrate videos. If you use production studios, you can skip this topic. For more information, see Quick start.

Intended readers

  • Developers who are capable of Java or PHP development
  • Developers who understand the basic features of the production studio service
  • Developers who understand the basic features of ApsaraVideo Live

Prerequisites

Procedure for using the production studio service

  1. Configure a production studio.
    Description

    After you create a production studio, you can configure the production studio as needed. For example, you can configure the settings that are related to the production studio name, domain names, transcoding, recording, stream delay, and standby materials.

    API operations
    Name Description
    SetCasterConfig Configures a production studio.
    domainName Associates a domain name that is provided by a customer with the production studio.
    casterTemplate Sets the resolution of videos that are generated by the production studio.
    liveTemplate Sets the parameters that are related to live stream transcoding for the production studio.
    recordConfig Sets the parameters that are related to live stream recording for the production studio.
    Sample code
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    SetCasterConfigRequest setCasterConfigRequest = new SetCasterConfigRequest();
    setCasterConfigRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    setCasterConfigRequest.setCasterName("LIVEPRODUCER_POST-cn-0pp123h****");
    setCasterConfigRequest.setDomainName("LIVEPRODUCER_POST-cn-0pp123h****");
    setCasterConfigRequest.setDelay(10F);
    setCasterConfigRequest.setUrgentMaterialId("LIVEPRODUCER_POST-cn-0pp123h****");
    JSONObject transcodeConfig = new JSONObject();
    JSONArray liveTemplate = new JSONArray();
    liveTemplate.add("lld");
    transcodeConfig.put("LiveTemplate", liveTemplate);
    transcodeConfig.put("CasterTemplate", "lp_ld"); // The resolution of videos that are generated by the production studio. Valid values: lp_ld: low definition; lp_sd: standard definition; lp_hd: high definition; lp_ud: ultra high definition.
    JSONObject recordConfig = new JSONObject();
    JSONArray videoFormat = new JSONArray();
    videoFormat.add(new JSONObject().fluentPut("Format", "flv").fluentPut("OssObjectPrefix", "record/{AppName}/{StreamName}/{StartTime}_{EndTime}").fluentPut("CycleDuration", 15*60));
    videoFormat.add(new JSONObject().fluentPut("Format", "m3u8").fluentPut("OssObjectPrefix", "record/{AppName}/{StreamName}/{StartTime}_{EndTime}").fluentPut("SliceOssObjectPrefix", "record/{AppName}/{StreamName}/{UnixTimestamp}").fluentPut("CycleDuration", 15*60));
    recordConfig.put("VideoFormat", videoFormat);
    recordConfig.put("OssBucket", "ossBucket");
    recordConfig.put("OssEndpoint", "ossEndpoint");
    setCasterConfigRequest.setRecordConfig(recordConfig.toJSONString());
    setCasterConfigRequest.setTranscodeConfig(transcodeConfig.toJSONString());
    setCasterConfigRequest.setCallbackUrl("http://192.168.1.1");
    SetCasterConfigResponse response = iAcsClient.getAcsResponse(setCasterConfigRequest);                        
  2. Edit video sources.
    Description

    Configure video sources that are used to produce the final programs. You can use live streams and on-demand videos as video sources.

    API operations
    Name Description
    AddCasterVideo Adds a video source.
    ModifyCasterVideoResource Modifies a video source.
    DescribeCasterVideoResources Queries video sources.
    DeleteCasterVideoResource Deletes a video source.
    liveStreamUrl Specifies the live stream URL that must be specified if the video source is a live stream.
    materialId Specifies the ID of the video source if the video source is an on-demand video. The number of playback times in loop mode must also be specified.
    locationId Specifies the name and location ID of the video source that are referenced by a layout.
    Sample code
     // AddCasterVideo: Adds a video source.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    AddCasterVideoResourceRequest addCasterVideoResourceRequest = new AddCasterVideoResourceRequest();
    addCasterVideoResourceRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    addCasterVideoResourceRequest.setResourceName("LIVEPRODUCER_POST-cn-0pp123h****");
    addCasterVideoResourceRequest.setLocationId("RV01" ); // The values that range from RV01 to RV06 indicate the IDs of the locations in the PVW window. The specified ID must be unique. A layout references a video based on its location ID.
    addCasterVideoResourceRequest.setLiveStreamUrl( null); // This parameter can be left empty if the video source is an on-demand video.
    addCasterVideoResourceRequest.setMaterialId("LIVEPRODUCER_POST-cn-0pp123h****");
    addCasterVideoResourceRequest.setRepeatNum(-1); // The video is played in loop mode.
    AddCasterVideoResourceResponse response = iAcsClient.getAcsResponse(addCasterVideoResourceRequest);
    
    // ModifyCasterVideoResource: Modifies a video source.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    ModifyCasterVideoResourceRequest modifyCasterVideoResourceRequest = new ModifyCasterVideoResourceRequest();
    modifyCasterVideoResourceRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    modifyCasterVideoResourceRequest.setResourceId("LIVEPRODUCER_POST-cn-0pp123h****");
    modifyCasterVideoResourceRequest.setLiveStreamUrl("rtmp://192.168.1.1");
    modifyCasterVideoResourceRequest.setResourceName("LIVEPRODUCER_POST-cn-0pp123h****");
    ModifyCasterVideoResourceResponse response = iAcsClient.getAcsResponse(modifyCasterVideoResourceRequest);
    
    // DescribeCasterVideoResources: Queries video sources.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    DescribeCasterVideoResourcesRequest describeCasterVideoResourcesRequest = new DescribeCasterVideoResourcesRequest();
    describeCasterVideoResourcesRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    DescribeCasterVideoResourcesResponse response = iAcsClient.getAcsResponse(describeCasterVideoResourcesRequest);
    
    // DeleteCasterVideoResource: Deletes a video source.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    DeleteCasterVideoResourceRequest deleteCasterVideoResourceRequest = new DeleteCasterVideoResourceRequest();
    deleteCasterVideoResourceRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    deleteCasterVideoResourceRequest.setResourceId("LIVEPRODUCER_POST-cn-0pp123h****");
    DeleteCasterVideoResourceResponse response = iAcsClient.getAcsResponse(deleteCasterVideoResourceRequest);                        
  3. Edit components.
    Description

    Configure components that are used to produce the final programs. Supported components include text and images.

    API operations
    Name Description
    AddCasterComponent Adds a component.
    ModifyCasterComponent Modifies a component.
    DescribeCasterComponents Queries components.
    DeleteCasterComponent Deletes a component.
    Note You must configure the following information about components:
    • If the component is text, set the properties such as text content, font proportion, and colors.
    • If the component is an image, specify the ID of the image component.
    Sample code
    // AddCasterComponent: Adds a component.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    JSONObject componentLayer = new JSONObject();
    componentLayer.put("HeightNormalized", 0.2);
    componentLayer.put("WidthNormalized", 0.2);
    JSONArray positionNormalized = new JSONArray();
    positionNormalized.add("0.3");
    positionNormalized.add("0.3");
    componentLayer.put("PositionNormalized", positionNormalized);
    componentLayer.put("PositionRefer", "topLeft");
    JSONObject textLayerContent = new JSONObject(); // Create the textLayerContent component.
    textLayerContent.put("Text", text);
    textLayerContent.put("Color", 0xff0000);
    textLayerContent.put("FontName", "KaiTi");
    textLayerContent.put("SizeNormalized", 0.3F);
    textLayerContent.put("BorderWidthNormalized", 0.3F);
    textLayerContent.put("BorderColor", 0xff0000);
    AddCasterComponentRequest addCasterComponntRequest = new AddCasterComponentRequest(); // Set the properties of the component.
    addCasterComponntRequest.setCasterId(casterId);
    addCasterComponntRequest.setLocationId(locationId);
    addCasterComponntRequest.setComponentName(componentName);
    addCasterComponntRequest.setComponentType("text");
    addCasterComponntRequest.setEffect(effect);
    addCasterComponntRequest.setComponentLayer(componentLayer.toJSONString());
    addCasterComponntRequest.setTextLayerContent(textLayerContent.toJSONString());
    AddCasterComponentResponse response = iAcsClient.getAcsResponse(addCasterComponntRequest);
    
    // ModifyCasterComponent: Modifies a component.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    JSONObject componentLayer = new JSONObject();
    componentLayer.put("HeightNormalized", 0.6);
    componentLayer.put("WidthNormalized", 0.6);
    JSONArray positionNormalized = new JSONArray();
    positionNormalized.add("0.3");
    positionNormalized.add("0.3");
    componentLayer.put("PositionNormalized", positionNormalized);
    componentLayer.put("PositionRefer", "topLeft");
    JSONObject textLayerContent = new JSONObject();// Create the textLayerContent component.
    textLayerContent.put("Text", text);
    textLayerContent.put("Color", 0xff0000);
    textLayerContent.put("FontName", "KaiTi");
    textLayerContent.put("SizeNormalized", 0.3F);
    textLayerContent.put("BorderWidthNormalized", 0.3F);
    textLayerContent.put("BorderColor", 0xff0000);
    ModifyCasterComponentRequest modifyCasterComponentRequest = new ModifyCasterComponentRequest(); // Modifies the properties of the component.
    modifyCasterComponentRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    modifyCasterComponentRequest.setComponentId("LIVEPRODUCER_POST-cn-0pp123h****");
    modifyCasterComponentRequest.setComponentName("LIVEPRODUCER_POST-cn-0pp123h****");
    modifyCasterComponentRequest.setComponentType("text"); // The text type.
    modifyCasterComponentRequest.setEffect("none"); // No effects.
    modifyCasterComponentRequest.setComponentLayer(componentLayer.toJSONString());
    modifyCasterComponentRequest.setTextLayerContent(textLayerContent.toJSONString());
    ModifyCasterComponentResponse response = iAcsClient.getAcsResponse(modifyCasterComponentRequest);
    
    // DescribeCasterComponents: Queries components.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    DescribeCasterComponentsRequest describeCasterComponentsRequest= new DescribeCasterComponentsRequest();
    describeCasterComponentsRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    DescribeCasterComponentsResponse response = iAcsClient.getAcsResponse(describeCasterComponentsRequest);
    
    // DeleteCasterComponent: Deletes a component.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    DeleteCasterComponentRequest deleteCasterComponentRequest = new DeleteCasterComponentRequest();
    deleteCasterComponentRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    deleteCasterComponentRequest.setComponentId("LIVEPRODUCER_POST-cn-0pp123h****");
    DeleteCasterComponentResponse response = iAcsClient.getAcsResponse(deleteCasterComponentRequest);                        
  4. Edit layouts.
    Description

    Configure the layouts of final programs. You can customize screens and their locations. Up to four screens can be created in a layout.

    API operations
    Name Description
    AddCasterLayout Adds a layout.
    ModifyCasterLayout Modifies a layout.
    DescribeCasterLayouts Queries layouts.
    DeleteCasterLayout Deletes a layout.
    videoLayer Specifies the properties of the layout.
    audioLayer Specifies the audio information.
    blendList Specifies the locations of video sources.
    mixList Specifies the locations of audio tracks that correspond to video sources.
    Sample code
      // AddCasterLayout: Adds a layout.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    JSONObject componentLayer = new JSONObject();
    componentLayer.put("HeightNormalized", 0.6);
    componentLayer.put("WidthNormalized", 0.6);
    JSONArray positionNormalized = new JSONArray();
    positionNormalized.add("0.3");
    positionNormalized.add("0.3");
    componentLayer.put("PositionNormalized", positionNormalized);
    componentLayer.put("PositionRefer", "topLeft");
    JSONObject imageLayerContent = new JSONObject(); // Create the imageLayerContent component.
    imageLayerContent.put("MaterialId", "materailId");
    AddCasterComponentRequest addCasterComponntRequest = new AddCasterComponentRequest(); // Set the properties of the component.
    addCasterComponntRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    addCasterComponntRequest.setLocationId("RC01"); // The location ID that is associated with the component.
    addCasterComponntRequest.setComponentName("LIVEPRODUCER_POST-cn-0pp123h****");
    addCasterComponntRequest.setComponentType("image"); // The image type.
    addCasterComponntRequest.setEffect("none"); // No effects.
    addCasterComponntRequest.setComponentLayer(componentLayer.toJSONString());
    addCasterComponntRequest.setImageLayerContent(imageLayerContent.toJSONString());
    AddCasterComponentResponse response = iAcsClient.getAcsResponse(addCasterComponntRequest);
    
    // ModifyCasterLayout: Modifies a layout.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    ModifyCasterLayoutRequest modifyCasterLayoutRequest = new ModifyCasterLayoutRequest();
    modifyCasterLayoutRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    modifyCasterLayoutRequest.setLayoutId("LIVEPRODUCER_POST-cn-0pp123h****");
    List videoLayersList = new ArrayList(); // The video layer.
    ModifyCasterLayoutRequest.VideoLayer videoLayer1 = new ModifyCasterLayoutRequest.VideoLayer();
    videoLayer1.setHeightNormalized(0.5F);
    videoLayer1.setWidthNormalized(0.5F);
    videoLayer1.setPositionRefer("topLeft");
    videoLayer1.setPositionNormalizeds(Arrays.asList(new Float[]{0F, 0F}));
    videoLayersList.add(videoLayer1);
    ModifyCasterLayoutRequest.VideoLayer videoLayer2 = new ModifyCasterLayoutRequest.VideoLayer();
    videoLayer2.setHeightNormalized(0.5F);
    videoLayer2.setWidthNormalized(0.5F);
    videoLayer2.setPositionRefer("topLeft");
    videoLayer2.setPositionNormalizeds(Arrays.asList(new Float[]{0.5F, 0F}));
    videoLayersList.add(videoLayer2);
    ModifyCasterLayoutRequest.VideoLayer videoLayer3 = new ModifyCasterLayoutRequest.VideoLayer();
    videoLayer3.setHeightNormalized(0.5F);
    videoLayer3.setWidthNormalized(0.5F);
    videoLayer3.setPositionRefer("topLeft");
    videoLayer3.setPositionNormalizeds(Arrays.asList(new Float[]{0.2F, 0.5F}));
    videoLayersList.add(videoLayer3);
    modifyCasterLayoutRequest.setVideoLayers(videoLayersList);
    List audioLayerList = new ArrayList();
    ModifyCasterLayoutRequest.AudioLayer audioLayer1 = new ModifyCasterLayoutRequest.AudioLayer(); // The audio layer.
    audioLayer1.setVolumeRate(1F);
    audioLayer1.setValidChannel("all");
    audioLayerList.add(audioLayer1);
    ModifyCasterLayoutRequest.AudioLayer audioLayer2 = new ModifyCasterLayoutRequest.AudioLayer();
    audioLayer2.setVolumeRate(1F);
    audioLayer2.setValidChannel("all");
    audioLayerList.add(audioLayer2);
    ModifyCasterLayoutRequest.AudioLayer audioLayer3 = new ModifyCasterLayoutRequest.AudioLayer();
    audioLayer3.setVolumeRate(1F);
    audioLayer3.setValidChannel("all");
    audioLayerList.add(audioLayer3);
    modifyCasterLayoutRequest.setAudioLayers(audioLayerList);
    modifyCasterLayoutRequest.setBlendLists(Arrays.asList(new String[]{"RV01", "RV02", "RV03"}));
    modifyCasterLayoutRequest.setMixLists(Arrays.asList(new String[]{"RV01", "RV02", "RV03"}));
    ModifyCasterLayoutResponse response = iAcsClient.getAcsResponse(modifyCasterLayoutRequest);
    
    // DescribeCasterLayout: Queries layouts.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    DescribeCasterLayoutsRequest request = new DescribeCasterLayoutsRequest();
    request.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    DescribeCasterLayoutsResponse response = iAcsClient.getAcsResponse(request);
    
    // DeleteCasterLayout: Deletes a layout.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    DeleteCasterLayoutRequest deleteCasterLayoutRequest = new DeleteCasterLayoutRequest();
    deleteCasterLayoutRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    deleteCasterLayoutRequest.setLayoutId("LIVEPRODUCER_POST-cn-0pp123h****");
    DeleteCasterLayoutResponse response = iAcsClient.getAcsResponse(deleteCasterLayoutRequest);                        
  5. Start a production studio.
    Sample code

    After you create and configure a production studio, you can start the production studio. Then, the configured audio and video processing tasks are started.

    Prerequisites

    The settings of the production studio are configured, including a domain name and the resolution of output videos.

    API operations
    Name Description
    StartCaster Starts a production studio.
    CasterID Specifies the ID of the production studio to be started.
    Note After you start the production studio, the information about the preview (PVW) and program (PGM) scenes is returned, including the scene IDs and information about live streams. You can specify a scene by scene ID.
    Sample code
     // StartCaster: Starts a production studio.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    StartCasterSceneRequest startCasterSceneRequest = new StartCasterSceneRequest();
    startCasterSceneRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    startCasterSceneRequest.setSceneId("LIVEPRODUCER_POST-cn-0pp123h****");
    StartCasterSceneResponse response = iAcsClient.getAcsResponse(startCasterSceneRequest);                  
  6. Update a scene.
    Description

    After the production studio is started, you can apply the configured layout or components to a specific scene.

    Prerequisites
    • A layout or a component is configured.
    • A specific scene is created and enabled.
    API operations
    Name Description
    UpdateCasterSceneConfig Updates the configurations of a scene.
    DeleteCasterSceneConfig Deletes the configurations of a scene.
    CasterID Specifies the ID of the production studio.
    SceneID Specifies the ID of the scene.
    LayoutID Specifies the ID of the layout. If this parameter is not specified, a default layout is used.
    Sample code
    // UpdateCasterSceneConfig: Updates the configurations of a scene.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    UpdateCasterSceneConfigRequest updateCasterSceneConfigRequest = new UpdateCasterSceneConfigRequest();
    updateCasterSceneConfigRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    updateCasterSceneConfigRequest.setLayoutId("LIVEPRODUCER_POST-cn-0pp123h****");
    updateCasterSceneConfigRequest.setSceneId("LIVEPRODUCER_POST-cn-0pp123h****");
    updateCasterSceneConfigRequest.setComponentIds(componentList);
    UpdateCasterSceneConfigResponse response = iAcsClient.getAcsResponse(updateCasterSceneConfigRequest);
    
    // DeleteCasterSceneConfig: Deletes the configurations of a scene.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    DeleteCasterSceneConfigRequest deleteCasterSceneConfigRequest = new DeleteCasterSceneConfigRequest();
    deleteCasterSceneConfigRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    deleteCasterSceneConfigRequest.setLayoutId("LIVEPRODUCER_POST-cn-0pp123h****");
    deleteCasterSceneConfigRequest.setType("Component") // Clear the component configurations of a scene.
    DeleteCasterSceneConfigResponse response = iAcsClient.getAcsResponse(deleteCasterSceneConfigRequest);                       
  7. Switch from a PVW scene to a PGM scene.
    Description

    After the production studio is started, you can apply the layout settings of a PVW scene to a PGM scene.

    Prerequisites
    • A PVW scene is created and enabled.
    • A PGM scene is created and enabled.
    API operations
    Name Description
    CopyCasterSceneConfig Updates the configurations of a scene.
    CasterID Specifies the ID of the production studio.
    FromSceneID Specifies the ID of the PVW scene.
    ToSceneID Specifies the ID of the PGM scene.
    Sample code
    // CopyCasterSceneConfig: Switches scenes.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    CopyCasterSceneConfigRequest copyCasterSceneConfigRequest = new CopyCasterSceneConfigRequest();
    copyCasterSceneConfigRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    copyCasterSceneConfigRequest.setFromSceneId("LIVEPRODUCER_POST-cn-0pp123h****");
    copyCasterSceneConfigRequest.setToSceneId("LIVEPRODUCER_POST-cn-0pp123h****");
    CopyCasterSceneConfigResponse response = iAcsClient.getAcsResponse(copyCasterSceneConfigRequest);                 
  8. Enable and disable the PVW mode.
    Description

    After the production studio is started, you can enable and disable the PVW mode to control the PVW scene. After the PVW scene is disabled, changes on layouts and video sources can be directly applied to the PGM scene.

    Prerequisites

    A PVW scene is created.

    API operations
    Name Description
    StartCasterScene Enables the PVW mode.
    StopCasterScene Disables the PVW mode.
    CasterID Specifies the ID of the production studio.
    SceneID Specifies the ID of the PVW scene.
    Sample code
     // StartCasterScene: Enables the PVW mode.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    StartCasterSceneRequest startCasterSceneRequest = new StartCasterSceneRequest();
    startCasterSceneRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    startCasterSceneRequest.setSceneId("LIVEPRODUCER_POST-cn-0pp123h****");
    StartCasterSceneResponse response = iAcsClient.getAcsResponse(startCasterSceneRequest);
    
    // StopCasterScene: Disables the PVW mode.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    StopCasterSceneRequest stopCasterSceneRequest = new StopCasterSceneRequest();
    stopCasterSceneRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    stopCasterSceneRequest.setSceneId("LIVEPRODUCER_POST-cn-0pp123h****");
    StopCasterSceneResponse response = iAcsClient.getAcsResponse(stopCasterSceneRequest);                        
  9. Switch to a standby video and switch back to the live stream.
    Description

    After the production studio is started, you can switch the PGM scene to a standby scene. Then, you can also switch back to the PGM scene.

    Prerequisites
    • The production studio is started.
    • The ID of the standby material is specified.
    API operations
    Name Description
    EffectCasterUrgent Switches to the standby scene.
    SetCasterSceneConfig Switches back to the live stream.
    CasterID Specifies the ID of the production studio.
    SceneID Specifies the ID of the PGM scene.
    Sample code
     // EffectCasterUrgent: Switches to the standby scene.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    EffectCasterUrgentRequest effectCasterUrgentRequest = new EffectCasterUrgentRequest();
    effectCasterUrgentRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    effectCasterUrgentRequest.setSceneId("LIVEPRODUCER_POST-cn-0pp123h****");
    EffectCasterUrgentResponse response = iAcsClient.getAcsResponse(effectCasterUrgentRequest);
    
    // SetCasterSceneConfig: Switches back to the live stream.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    SetCasterSceneConfigRequest setCasterSceneConfigRequest = new SetCasterSceneConfigRequest();
    setCasterSceneConfigRequest.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    setCasterSceneConfigRequest.setSceneId("LIVEPRODUCER_POST-cn-0pp123h****");
    setCasterSceneConfigRequest.setLayoutId(null); // If you want to exit from the standby scene, enter null. If you want to switch to a specific layout, enter the ID of the specific layout.
    SetCasterSceneConfigResponse response = iAcsClient.getAcsResponse(setCasterSceneConfigRequest);                
  10. Stop the production studio.
    Description

    After the production studio is started, you can stop the production studio and its audio and video processing tasks.

    Prerequisites

    The production studio is started.

    API operations
    Name Description
    StopCaster Stops a production studio.
    CasterID Specifies the ID of the production studio.
    Sample code
    // StopCaster: Stops a production studio.
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    StopCasterRequest request = new StopCasterRequest();
    request.setCasterId("LIVEPRODUCER_POST-cn-0pp123h****");
    StopCasterResponse response = iAcsClient.getAcsResponse(request);