This topic describes how to use a virtual studio instance for live streaming.
Prerequisites
The production studio feature is enabled. For more information, see Enable the production studio feature.
A domain name for which you want to perform production is added to ApsaraVideo Live and a CNAME record is configured for the domain name. For more information, see Add an accelerated domain name and Configure a CNAME record in Alibaba Cloud DNS.
Optional. If you select a video source from the ApsaraVideo Live console, make sure that the domain name of the video source is added to ApsaraVideo Live and that a CNAME record is configured for the domain name. For more information, see Add an accelerated domain name and Configure a CNAME record in Alibaba Cloud DNS.
Optional. If you select a video source from the Video and Audio page in the ApsaraVideo VOD console, make sure that the domain name of the video source is added to ApsaraVideo VOD and that a CNAME record is configured for the domain name. For more information, see Add a domain name for CDN and Add a CNAME record in Alibaba Cloud DNS.
Optional. If you want to record live streams and store the recording files, make sure that the recording feature is enabled. For more information, see Store recordings in OSS.
Background information
A virtual studio is a production studio that is integrated with the chroma key feature. You can use a virtual studio to perform cross-site live streaming by using multiple devices and cameras. You can deliver various live streaming scenes, such as dual screens, split-screens, and picture-in-picture, based on the chroma key feature. This way, the audience can have an immersive live streaming experience. This topic describes how to configure a virtual studio instance and how to use the instance for live streaming.
For information about how to call API operations to use a virtual studio instance, see API guide.
Workflow
A virtual studio is based on a standard production studio, which is integrated with the chroma key feature. You can use a virtual studio in the same way that you use a standard production studio. The following figure shows how to use a virtual studio instance for live streaming. The procedure consists of the following operations:
Live stream settings: You can configure settings for live streams, such as the streaming domain name, output resolution, transcoding settings, and recording settings, in the production studio.
Live streaming configurations: You must add media files and configure the output layout before you start live streaming.
Live streaming: You can use PVW to preview mixed streams and use PGM for live outputs.
Live stream settings
The procedure varies based on whether you want to configure a virtual studio instance immediately after you create it.
If you want to configure a virtual studio instance immediately after you create it, start from Step 2.
If you already have a virtual studio instance and you want to use the instance for live streaming, start from Step 1.
Log on to the ApsaraVideo Live console. In the left-side navigation pane, choose .
On the Production Studio Management page, find the virtual studio instance that you created and click Open in the Actions column.
Open the Studio Settings dialog box. The first time you enter the production studio page, the Studio Settings dialog box is displayed. You can also click Live Stream Settings in the upper-right corner of the production studio page to open the Studio Settings dialog box.
Parameter
Description
Domain
Select a domain name for which a CNAME record is configured from the Domain drop-down list.
Output
Select the original resolution of the live stream from the Output drop-down list. Valid values: Low Definition 360p (640 × 360), Standard Definition 480p (854 × 480), High Definition 720p (1280 × 720), Ultra High Definition 1080p (1920 × 1080), Portrait Low Definition 360p (360 × 640), Portrait Standard Definition 480p (480 × 854), Portrait High Definition 720p (720 × 1280), and Portrait Ultra High Definition 1080p (1080 × 1920).
Transcoding Specifications
Low Definition
Standard Definition
High Definition
Ultra High Definition
Select one or more transcoding specifications for the live stream. Valid values: Low Definition, Standard Definition, High Definition, and Ultra High Definition.
NoteThe resolution of the transcoded stream cannot exceed the resolution of the original stream. For example, if you select Low Definition for the Transcoding Specifications parameter, you can switch only between original quality and low definition during playback.
Recording
Optional. Turn on Recording to record live streams.
Valid values: Automatic Recording and Manual Recording. If you select Automatic Recording, recording is automatically started after live streaming starts. If you select Manual Recording, you can start or stop recording based on your business requirements after live streaming starts.
Specify the Object Storage Service (OSS) bucket in which you want to store the recording files.
NoteYou can store the recording files only in an OSS bucket that resides in the same region as the virtual studio instance. Cross-region recording is not supported.
Select one or more formats of the recording files.
Specify the recording length. If you set the Recording Cycle parameter to 10 minutes, the system generates a recording file for a live stream every 10 minutes.
Stream Delay
Optional. Turn on Stream Delay to configure a delay for the output. The delay can range from 15 to 300 seconds.
Standby Resource
Optional.
Live Stream: Select Select Live Stream or Enter Streaming URL to specify a standby video.
VOD Resource: Click Select and select a video from the Video and Audio page in the ApsaraVideo VOD console. The selected video is played before live streaming starts or when an exception occurs during live streaming.
ImportantIf you use videos from ApsaraVideo VOD as video sources or standby videos, the videos must be stored in the same region as the virtual studio instance. For example, if the virtual studio instance is created in the China (Shanghai) region, you can use only ApsaraVideo VOD videos that are stored in the China (Shanghai) region as video sources or standby videos.
Image: Click Select from Media Library or Local Upload to specify a standby image. Supported image formats include JPG and PNG. The size of the image cannot exceed 10 MB.
Multi-way Stream Relay
Optional. Click Add URL to add a relay URL.
ImportantAfter you add or delete a relay URL, the stream relay settings take effect only after you restart PGM.
If your live stream uses the features of a third-party platform, you are charged additional fees for stream relay. By default, three relay URLs are provided free of charge for a domain name. If you specify more than three relay URLs, you are charged for the excess relay URLs. The pricing is the same as that of live center stream relay in ApsaraVideo Live. For more information, see Billing of stream relay.
Live streaming configurations
Add input sources. You can add the following input sources to a virtual studio.
Chroma Key Input Source: You can add live streams that have a green background. The green background of the streams can be removed by using the chroma key feature. Click the Chroma Key Input Source tab in the virtual studio and add video sources.
Multimedia Input Source: You can add on-demand videos or live streams. These streams are played in multimedia windows. Click the Multimedia Input Source tab in the virtual studio and add media files.
Click Add Media File. In the Add Resource dialog box, select a live stream as the video source or select a video source from ApsaraVideo VOD. The following table describes the parameters.
Adding Method
Description
Live Stream
Select Live Stream: After you select a domain name, the ingest URLs of all live streams under the domain name are displayed. You can select an ingest URL to add it to the production studio.
Enter Streaming URL: Enter a streaming URL in the RTMP, FLV, or RTS format.
VOD
Click Select and select a video from the drop-down list. Set the Loop parameter to Once or Loop. Then, click OK.
NoteBefore you can select on-demand video files from VOD, you must select the on-demand video files that you want to add to the virtual studio instance on the Video and Audio page in the ApsaraVideo VOD console and choose More > Make Available on Cloud Studio in the Actions column. After the on-demand video files are uploaded and preprocessed, you can use the on-demand video files in the virtual studio instance. For more information about the preprocessing rules and billing methods, see Pricing of ApsaraVideo VOD.
Local Stream Ingest
Stream Ingest Mode:
Screen Sharing: Select an application window or desktop as the input source.
Camera: Use a local camera as the input source.
Resolution: Select a resolution based on your business requirements.
Click + Layout to configure the layout of the virtual studio.
In the Layout Settings dialog box, select Studio Layout for the Layout Type parameter and specify a value for the Layout Name parameter. You can add common layouts or studio layouts to the virtual studio. You can switch between layouts to play standby videos, advertisements, and live streams.
In the Layout Settings dialog box, add a background image on the Background Image tab. You can select an image from the template library or upload an image from your local PC.
NoteThe background image is scaled to fill in the screen of the live stream. We recommend that you use an image whose height and width match the height and width of the screen of the live stream. The size of the image cannot exceed 10 MB.
On the Chroma Key Materials tab of the Layout Settings dialog box, click + Add to add chroma key materials After you select an input source, configure chroma key settings for the input source. The following table describes the parameters. You can add multiple input sources for chroma key to a virtual studio.
Parameter
Description
Input Source
Select an input source from the drop-down list.
Portrait Type
Valid values: Full-length and Half-length.
Color Gamut for Chroma Key
Valid values: Green, Blue, and Live-action.
Position/Size
Horizontal Offset and Vertical Offset are supported. The size of the material can be zoomed in and out.
On the Multimedia Materials tab of the Layout Settings dialog box, click + Add to add multimedia materials. You can add up to three multimedia windows to a virtual studio to insert videos or images.
On the Order of Layers tab of the Layout Settings dialog box, modify the overlay sequence of materials.
Click OK.
Live streaming
Start live streaming. Click the layout that you want to use and click Start in the upper-right corner of the virtual studio. The video sources are displayed based on the layout in the PVW window.
Click Synchronize to PGM. The PGM window displays the live streams for the audience.
Switch the materials for live streaming. Click the layout to which you want to switch. After the new layout is displayed in the PVW window, click Synchronize to PGM to ingest the live stream to the audience.
ImportantThe virtual studio allows you to change the live stream that is played in the PVW window by switching to another layout that you configured. To change the layout of the virtual studio or the materials that are played in the virtual studio during live streaming, you must configure multiple layouts in advance. The materials include chroma key materials and materials that are displayed in multimedia windows.
To ensure a smooth switch, we recommend that you specify names that can help you identify the layouts that you create.
To stop live streaming, click Stop in the upper-right corner of the virtual studio.
References
You can add common layouts or studio layouts to a production studio. For more information, see Create a layout.