Virtual studio provides automatic and professional chroma keying for blue or green screen and real-scene background. It enables live streaming from multiple camera angles and devices and supports remote broadcasting. You can use the cloud-based chroma keying capability to achieve various live streaming scenes, such as dual screens, split-screens, and picture-in-picture, creating an immersive live streaming experience. This topic introduces how to use a virtual studio through the ApsaraVideo Live console or API operations.
Prerequisites
The production studio feature is enabled. For more information, see Create a production studio. For feature availability, see Supported regions.
A domain name 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 want to select a video source from ApsaraVideo Live, make sure that the domain name of the video source is added to ApsaraVideo Live and that a CNAME record is configured. For more information, see Add an accelerated domain name and Configure a CNAME record in Alibaba Cloud DNS.
Optional. If you want to select a video source from ApsaraVideo VOD, make sure that the domain name of the video source is added to ApsaraVideo VOD and that a CNAME record is configured. 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, make sure that the recording feature is enabled. For more information, see Live stream recording.
Workflow
A virtual studio integrates the chroma keying capability into a production studio in general mode. The following figure shows its workflow:
As shown in the figure, the workflow consists of the following steps:
Set up live streaming
Configure the live streaming settings, including the streaming domain name, output resolution, transcoding, and recording.
Configure live content
Add media assets to the virtual studio and configure the output layout.
Start live streaming
Use PVW to preview the mixed stream and PGM for live output.
Perform real-time production
Use features, such as live subtitles, graphic packaging, and audio mixer, to enrich live content and adjust output effects.
Use the ApsaraVideo Live console
Set up live streaming
Log on to the ApsaraVideo Live console. In the left-side navigation pane, select .
Select a virtual studio or click Open in the Actions column.
The Studio Settings dialog box is displayed the first time you enter a production studio. Configure the parameters in the dialog box and click OK.
You can also click Live Stream Settings in the upper-right corner to open the Studio Settings dialog box.
Parameter
Description
Domain
Select a domain name from the drop-down list. The CNAME record must be configured for the domain name.
Output
Select the original resolution of the live stream. 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)
Portrait Ultra High Definition 1080p (1080 × 1920)
Transcoding Specifications
Select one or more transcoding specifications for the live stream. Valid values:
Low Definition
Standard Definition
High Definition
Ultra High Definition
NoteThe resolution of the transcoded stream cannot exceed that of the original stream. If you select Low Definition, viewers can switch between original quality and low definition.
Recording
Optional. Turn on Recording to record live streams.
Valid values:
Automatic Recording: Recording is automatically started after live streaming starts.
Manual Recording: Recording is started and stopped manually.
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 production studio instance.
Select one or more formats of the recording files.
Specify the recording cycle. If you set it 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. Valid values: 15 to 300 seconds.
Standby Resource
Optional.
Live Stream: Choose Select Live Stream or Enter Streaming URL to specify a standby video.
VOD Resource: Click Select and select a video from ApsaraVideo VOD. 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 production studio instance.
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.
Stream Relay
Optional. Click Add URL to add a destination URL.
ImportantAfter you add or delete a URL for stream relay, restart PGM to apply the changes.
If your live stream is relayed to third-party platforms, you are charged additional fees. Each domain name can have three relay destinations free of charge. For excess URLs, the pricing is the same as that of live center stream relay. For more information, see Billing of stream relay.
Configure live content
Click Add Media File to add a chroma key input source or multimedia input source.
Chroma Key Input Source: Add live streams that have a green background. The green background can be removed by using the chroma keying feature.
Multimedia Input Source: You can video-on-demand (VOD) resources or live streams.
Type
Description
Live Stream
Select Live Stream: Select a domain name and an ingest URL under the domain name.
Enter Streaming URL: Enter a streaming URL in the Real-Time Messaging Protocol (RTMP), Flash Video (FLV), or Real-Time Streaming (RTS) format.
Video-on-demand
Click Select and select a video from the displayed video files. Set the Loop parameter to Once or Loop.
NoteTo use a media asset from ApsaraVideo VOD, you must select it in the ApsaraVideo VOD console and choose More > Add to Production Studio in the Actions column. The media asset will be uploaded and preprocessed for use in the production studio. For more information about the preprocessing rules and billing methods, visit the ApsaraVideo VOD pricing page.
Local stream ingest
Valid input sources:
Screen Sharing: Use 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 switch between standby videos, ads, 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 a local image.
NoteThe background image will be scaled to match the live stream dimensions. We recommend using an image with the same dimensions as the live stream. The image size cannot exceed 10 MB.
On the Chroma Key Materials tab, click + Add to add chroma key materials. After you select an input source, configure chroma key settings. The following table describes the parameters. You can add multiple input sources.
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, click + Add to add multimedia materials. You can add up to three multimedia windows to insert videos or images.
On the Order of Layers tab, modify the overlay sequence of materials.
Click OK.
Start live streaming
Select the layout that you want to use and click Start to start live streaming. The sources are displayed in the PVW window based on the layout.
Click Synchronize to PGM to make the live content available to the audience.
To switch live content, click another layout that you want to use. After the new layout is displayed in the PVW window, click Synchronize to PGM to deliver the live stream to the audience.
ImportantThe virtual studio allows you to change the live content that is played in the PVW window by switching to another layout. To change the layout or the materials during live streaming, you must configure multiple layouts in advance.
We recommend that you specify a unique name for each layout
To stop live streaming, click Stop in the upper-right corner.
Perform real-time production
You can use the following features to edit live content and output effects in real time.
Adjust the volume slider to turn up or down the volume.
Audio Follows Video: When it is selected, the PVW window displays the video without sound. After you click Synchronize to PGM, the audio of the source in PVW is synchronized to PGM. Other video sources are muted. The audio can be adjusted through audio mixer. When it is not selected, the audio of the source in PVW will not be synchronized after you click Synchronize to PGM.
Configure the subtitle style and translation.
The live subtitles feature converts the audio of live streams into text to generate subtitles in real time and supports real-time translation to and from Chinese, English, Spanish, and Russian. You can add bilingual or monolingual subtitles in the source or target language to a live stream.
Live subtitles make your live content accessible to viewers who cannot listen to the audio due to the environment. Real-time translation enables viewers from different linguistic backgrounds to understand the live content, which is useful for live streaming in cross-border e-commerce and international events.
Click the icon beside Real-time Subtitles.
In the Add Component dialog box, configure the Name, Font, Size, Position, Video Source, Source Language, and Translate parameters. A preview is displayed on the left side. Click OK to add the component.
Insert a watermark, logo, or text into the live stream.
Add an image.
In the component area, click Image.
In the Add Component dialog box, click Upload Image and select an image on your computer. After the image is uploaded, configure the Name, Scale, Size, and Position parameters. A preview is displayed on the left side. Click OK to add the component.
Add text.
In the component area, click Text.
In the Add Component dialog box, enter the text in the left-side editor and configure the Name, Font, Size, Display Mode, and Position parameters. A preview is displayed on the left side. Click OK to add the component.
Change the layout of video sources. You can create up to 20 layouts.
If an exception occurs during live streaming, click Switch to Standb to play a standby video and avoid interruptions.
Call API operations
This section describes the API operations that you can call to configure and use a virtual studio.
Call the CreateCaster and SetCasterConfig operations to create and configure a virtual studio.
Call the AddCasterVideoResource operation to add sources to the virtual studio.
Call the AddStudioLayout to configure the layout of the virtual studio.
Optional. Call the AddCasterComponent operation to add components.
Call the StartCaster operation to start the virtual studio.
Call the SetCasterSceneConfig operation to configure a scene.
Call the StopCaster operation to stop the virtual studio.