tencent cloud


Live Recording

Last updated: 2022-05-06 16:46:13

    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:


    • The recorded video files are stored in the VOD console by default. We recommend you activate the VOD service in advance. For more information, please 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 payment, live recording will not be available, no recording files will be generated, and no recording fees will 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.
    • As only .flv, .mp4, and .hls video formats are supported, the video codec can only be H.264 and audio codec can only be AAC.
    • 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.


    Creating a Recording Template

    1. Log in to the CSS console and select Feature Configuration > Live Recording.
    2. Click Create Recording Template and set template information as follows:
    Template Name Custom live recording template name, which can contain letters, digits, underscores (_), and hyphens (-).
    Template Description Custom live recording 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, for which you will be charged transcoding fees. If you use the same transcoding template for playback, the transcoding will be charged only once.
    1. Select the recording content and formats and, in the sections that expand, complete the following configuration:
    Max Recording Time Per File
    • There is no upper limit on the recording time of a 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 length of a single file recorded in .mp4, .flv, or .aac format ranges from 1 to 120 minutes.
    Resumption Timeout Only the .hls format supports recording resumption after push interruption, and the timeout period for resumption can be set between 1 and 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). Setting the period to `0` means to save recording files 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 VOD subapplication. You can also click a task flow to go to the VOD console, where you can modify the task flow or create new ones. The bound task flow will be executed on recording files upon generation, for which you will be charged VOD fees.

    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.
      • Bind a domain name to an existing transcoding template: Click Bind Domain Name in the top left.
      • You can also click Bind Domain Name in the dialog box that pops up upon successful template creation.
    2. In the pop-up window, select a recording template and a push domain name and then click Confirm.

    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.
    2. Select a recording template with bound domain names, find the target domain name, and click Unbind.
    3. In the pop-up window, click Confirm.

    • 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.
    2. Select the target recording template, and click Delete in the upper right.
    3. In the pop-up window, click Confirm.

    • 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, and you cannot unbind rules created and bound by APIs. You need to call DeleteLiveRecordRule to unbind them.

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


    How are recording files named?

    If a recording template is created in the console, the recording files generated are named (the names returned by the recording callback) in the following format by default:


    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