If your live streaming source does not have the capability to push streams or if you want to stream on-demand videos, you can use the relay feature to quickly pull content from an existing live streaming source or video and then deliver it to the destination. You don’t need to push streams yourself.

Prerequisites
- You have activated CSS and logged in to the CSS console.
- You have added a push domain name in the console.
Limits
- You can create up to 20 relay tasks.
- The relay feature is charged based on the duration of relay tasks. For details, see Relay.
- CSS is only responsible for pulling and relaying content. Please make sure that your content is authorized and complies with relevant laws and regulations. In case of copyright infringement or violation of laws or regulations, CSS will suspend its services for you and reserves the right to seek legal remedies.
- The local relay mode became a paid feature starting from 00:00 on November 23, 2022. To learn more, see Extended Features.
Creating a Task
- Go to CSS Toolkit > Relay, and click Create Task.

- Enter the basic information:

Configuration Item | Description |
---|
Task Description |
Describe the task. |
Execution Time |
The default execution time is from the current time to 24 hours later . You can select a time range up to seven days.
|
Event Callback Notification |
Enter a callback URL for receiving relay event notifications. |
- Provide the source information.
- Region: Random (Chinese mainland), North China region (Beijing), East China (Shanghai), South China (Guangzhou), Southeast Asia (Singapore), Southeast Asia (Bangkok), Northeast Asia (Seoul), South Asia (Mumbai), Hong Kong
- If you select Random (Chinese mainland), the system will assign a region that is nearby.
- For Content Type, you can select Live streaming, Custom video path, or Image.
- Live streaming:
- Enter a live streaming URL (only one is allowed).

- If you select Enable backup, when the system fails to pull content from the primary source, it will automatically switch to the backup source. After the primary recovers, you need to manually switch back. Backup sources support only loop of a single video.
- Custom video path:
- You can enter multiple (max 30) source URLs.
- Select Repeat to repeat the playback indefinitely or Specified to specify the number of times (1-100) to play the content.
- If you enable local mode, sources in MP4 format will be cached to the local node before they are relayed. This ensures smoother and more reliable playback.

- Image:
- Upload an image or enter an image URL. You can click Preview to preview the image.
- Images in JPEG, JPG, PNG, or BMP format are supported. If you enter an image URL, there is no limit on image size. If you upload an image, it cannot exceed 2 MB.

Note:
- The system will stop a relay task either when the playback count reaches the specified value or when the task reaches its end time.
- In case of task modification:
- If you change only the playback count, after the new value is applied, the count will start from 2.
- If you change both the source URL and playback count, after the new configuration takes effect (whether immediately or after the current playback ends), the count will start from 1.
- If you change the destination URL, the playback count will be reset.
- Relaying a locally cached MP4 file will incur additional fees, which are based on the duration of the file relayed.
Enter a destination URL.
- Click Address Generator to enter the URL generation page.

- Select an existing push domain, enter the
Appname
, StreamName
, and expiration time, and click Confirm to generate a push URL, which will be auto-filled as Destination Address.
Note:
The URL expiration time must be later than the task end time. If you change the destination URL after the task starts, it will stop and restart.
You can click
next to Watermark Configuration to add a watermark. Watermark images in PNG, JPB, or GIF format are supported.
- Select a watermark type.
- If you select Custom watermark URL, enter a URL of the watermark image you want to use and click Preview to preview it.
- If you select Image Upload, click Select image to upload a watermark image. For better visual experience, transparent images in PNG format are recommended. The image size cannot exceed 2 MB.
- Position the watermark image in either of two ways:
- Drag the watermark image.
- Change the values of X-AXIS and Y-AXIS.
- Click Save.
Note:
- If the source is an image, watermarking is not supported.
- Using watermarks will incur transcoding fees.
- Click Save.
Managing Tasks
Viewing task details
In the task list, find your task, and click its description/ID to view task details in the pop-up window.

Note:
You can click the buttons at the bottom of the pop-up window to edit the task, switch sources, restart the task, or disable the task.
Viewing task status
In the task list, find your task, and click its description/ID to view its execution status in the pop-up window.

Task Status | Field Value | Description |
Not started |
Inactive |
The task has not started yet. |
Valid |
Active |
The task has started and is executed as expected. |
Inactive |
The task has started but is not executed as expected. |
Disabled |
Inactive |
The task is disabled. |
Expired |
Inactive |
The task has expired. |
Modifying a task
- In the task list, find the task you want to modify, and click Edit.

- Modify the task information, and then click Save.
- You cannot change the region or content type.
- When modifying the task end time, make sure that the destination URL is valid until the task ends. Modifying the destination URL will cause the task to stop and restart.
- If you change watermark settings for a live streaming source, the modifications will take effect immediately. For an on-demand video source, modifications to watermark settings will take effect starting from the next video. Modifying watermark settings may cause playback to stutter. We recommend you use the watermark feature for relay only if you relay to third-party sites that do not have watermarking capabilities. If you relay to CSS, you can use the live watermarking feature of CSS.

- In the pop-up window, check the information:
- Suppose you modified the start time, end time, and playback count of a task. You would see the following information in the pop-up window:

- If the source URLs for Custom video path are changed, you need to select whether to apply the change After the current video ends (default) or Now. After the changes take effect, relay will restart from the first source URL.

- If Destination Address is changed, the system will remind you that after you click Confirm, the current relay task will stop and restart.

- After checking, click Confirm.
Copying a task
- In the task list, find the relay task you want to copy, and click Copy. You will be directed to the task creation page.

- The information of the copied task will be auto-filled. You can modify it as needed.
- Click Save to create a new relay task.
Restarting a task
Restarting a task will not change its status. An ongoing task will be restarted from the beginning. Perform the following to restart a task:
- In the task list, find the relay task you want to restart, and click Restart.
- In the pop-up window, click Restart.

Disabling a task
If you disable a task, the task will stop. You can click Enable to start it again. Perform the following to disable a task:
- In the task list, find the relay task you want to disable, and click Disable.
- In the pop-up window, click Disable.

Enabling a task
If you enable a task, the task will start from the beginning. Perform the following to enable a task:
- In the task list, find the relay task you want to enable, and click Enable.
- In the pop-up window, click OK.

Deleting a task
Deleted tasks cannot be recovered. Perform the following to delete a task:
- In the task list, find the relay task you want to delete, and click Delete.
- In the pop-up window, click Delete.

Batch operations
You can delete, disable, and enable up to 10 relay tasks at a time.
In the task list, select the relay tasks you want to delete, disable, or enable.
Click Batch Operation, and select Delete, Disable, or Enable.

In the pop-up window, click Delete, Disable, or Enable.

Auto-Deleting Expired Tasks
A task expires after its end time. If you have too many relay tasks, you may fail to create new ones. To avoid this, you can enable auto-delete for the system to delete expired tasks automatically at the specified time. Deleted tasks cannot be recovered.
- Go to CSS Toolkit > Relay, and click Set in the Expired area.
- Click
to enable auto-delete.
- Specify a period (1-24 hours) to retain expired tasks before they are deleted.

Was this page helpful?