tencent cloud

Feedback

Live Recording

Last updated: 2022-08-29 12:06:25

    CSS supports recording live streams and storing recording files in VOD for download and preview. This document describes how to create, bind, unbind, modify, and delete recording templates.
    You can create a recording template in two ways:

    Notes

    • Recording files are saved in VOD by default. Please activate VOD first. For more information, see Getting Started with VOD.
    • After enabling the recording feature, please make sure that your VOD service is in normal status. If it is not activated or is suspended due to overdue payments, live recording will fail. No recording files will be generated. Nor will fees be incurred.
    • A recording file is available in about 5 minutes after recording ends. For example, if you start recording a live stream at 12:00 and stop at 12:30, you can get the recorded video at around 12:35.
    • Because only FLV, .MP4, and HLS formats are supported, you can only use the H.264 video codec and the AAC audio codec.
    • After creating a recording template, you can bind it with push domain names. For detailed directions, see Recording Configuration. The binding takes effect in about 5-10 minutes.
    • For the naming rules of generated recording files, see VodFileName.
    • Binding, unbinding, or modifying a template affects only new live streams and not ongoing ones. To make the change apply to ongoing live streams, you need to stop them and push them again.
    • Mixed-stream recording does not support mixing streams inside the Chinese mainland with those outside. It will cause an error and playback will fail.

    Prerequisites

    Creating a Recording Template

    1. Log in to the CSS console and select Feature Configuration > Live Recording on the left sidebar.
    2. Click Create Recording Template.
    ItemDescription
    Template Name The template name, which can contain letters, digits, underscores (_), and hyphens (-).
    Template Description The template description, which can contain letters, digits, underscores (_), and hyphens (-).
    Recording Content Original stream Record videos before transcoding, watermarking, and stream mixing.
    Watermarked stream Record videos after they are watermarked according to the specified watermark template.
    Transcoded stream Record transcoded streams. You can select an existing transcoding template or click the name of a template to modify its configuration. If you select this, streams will be watermarked and transcoded as specified in the selected template before recording. If the template is deleted, streams will be recorded after they are watermarked.
    Recording Format Videos can be outputted in formats of HLS, MP4, FLV, and AAC (for audio-only recording).
    >! >- If you select **Original stream**, you cannot record the audio of WebRTC streams. >- You cannot record transcoded streams if you use the time shifting feature. If a recording template has time shifting configured, original streams will be recorded. >- If an audio-only transcoding template is selected, the recording format must be an audio format as well. >- To record transcoded streams, the system will initiate transcoding tasks, which will incur transcoding fees. If you use the same transcoding template for playback, the transcoding will be charged only once. 3. Select the recording content and formats and complete the following settings: ![](https://qcloudimg.tencent-cloud.cn/raw/0a835b00a6864bc29411da9d8088a626.png)
    ItemDescription
    Max Recording Time Per File
    • There is no upper limit on the length of a recording file in HLS format. If a live stream is interrupted and the timeout period for resumption elapses, a new recording file will be generated to continue recording.
    • The value range for the maximum length of a recording file in MP4, FLV, or AAC format is 1-120 minutes.
    Resumption Timeout Only the HLS format supports recording resumption after push interruption, and the value range for the timeout period for resumption is 1-1800 seconds.
    Storage Period (days) You can select Permanent to save a recording file permanently or Custom to specify a storage period (up to 1,500 days). If you set the period to 0, recording files will be saved permanently.
    VOD Subapplication/Category By default, streams are recorded to the primary application in VOD, but you can also record them to a specified category of a specified writable subapplication.
    Advanced Configuration Storage Policy
    • Select STANDARD (default) if the recording files need to be played back for business purposes.
    • Select STANDARD_IA (cold storage) if the recording files will not be accessed frequently or will be stored for a long period of time.
    VOD Task Flow Click Select to bind a task flow created under the specified VOD subapplication. In the pop-up window, you can click the name of a task flow to modify its configuration. The selected task flow will be executed on recording files upon generation, which will incur VOD fees.
    Upload while recording Currently, only the FLV format supports upload while recording. This feature makes it possible to finish uploading a video as soon as recording ends. It extends the maximum recording time per file to 12 hours and makes FLV recording more disaster tolerant. Online playback of the recording files may stutter, but local playback is unaffected.
    Note:

    For Storage Policy:

    • If you select STANDARD and cold storage is enabled for the selected application/category, streams will be recorded to STANDARD storage first before the configured cold storage policy is executed on the recording files. You can go to Cold Storage to view your cold storage policies.
    • If you select STANDARD_IA and cold storage is enabled for the selected application/category, streams will be recorded to STANDARD_IA storage first, and the system will then determine whether to execute the cold storage policy.
    1. Click Save.

    Binding a Domain Name

    1. Log in to the CSS console and select Feature Configuration > Live Recording on the left sidebar.
      • Bind a domain to an existing transcoding template: Click Bind Domain Name in the top left.
      • Bind a domain after creating a template: After creating a template, click Bind Domain Name in the dialog box that pops up.
    2. In the pop-up window, select a recording template and a push domain name and then click Confirm.
    Note:

    You can click Add to bind multiple push domain names to a template.

    Unbinding a Domain Name

    1. Log in to the CSS console and select Feature Configuration > Live Recording on the left sidebar.
    2. Select a recording template bound with domain names, find the target domain name, and click Unbind.
    3. In the pop-up window, click Confirm.
    Note:

    • Unbinding the recording template will not affect ongoing live streams.
    • For the unbinding to take effect for ongoing streams, stop the streams and push them again, after which no recording files will be generated.

    Modifying a Template

    1. Go to Feature Configuration > Live Recording.
    2. Select the target recording template, click Edit on the right, modify the settings, and click Save.

    Deleting a Template

    1. Log in to the CSS console and select Feature Configuration > Live Recording on the left sidebar.
    2. Select the target recording template, and click Delete in the upper right.
    3. In the pop-up window, click Confirm.
    Note:

    • If domain names are bound to a template, you need to unbind them before you can delete the template.
    • In the console, recording templates are managed at the domain level. To unbind recording rules created and bound by APIs, call DeleteLiveRecordRule.

    For more information about binding a domain name with and unbinding a domain name from a recording template, see Recording Configuration.

    FAQs

    How are recording files named?

    If a recording template is created in the console, the names of its recording files (the names returned by the recording callback) are in the following format:
    {StreamID}*{StartYear}-{StartMonth}-{StartDay}-{StartHour}-{StartMinute}-{StartSecond}*{EndYear}-{EndMonth}-{EndDay}-{EndHour}-{EndMinute}-{EndSecond}

    Fields:

    Placeholder Description
    {StreamID} Stream ID
    {StartYear} Start time - year
    {StartMonth} Start time - month
    {StartDay} Start time - day
    {StartHour} Start time - hour
    {StartMinute} Start time - minute
    {StartSecond} Start time - second
    {EndYear} End time - year
    {EndMonth} End time - month
    {EndDay} End time - day
    {EndHour} End time - hour
    {EndMinute} End time - minute
    {EndSecond} End time - second
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support