tencent cloud


Live Streaming Time Shifting

Last updated: 2023-07-26 16:12:36
    Combining the time shifting feature of CSS and the delivery acceleration capability of VOD, time shifting for live stream playback allows users to rewind and play back earlier parts of a live stream. This is commonly used to play back highlights during live streamed sports events. Users can drag the progress bar to view earlier parts of a live stream, and they can also switch back to continue viewing the currently ongoing live stream.


    Users can specify the delay for playing live content, i.e., the difference between the playback start time and current time.
    Users can specify the bitrate for time shifting if a live stream is recorded in multiple bitrates.


    You have signed up for a Tencent Cloud account and logged in.
    You have activated CSS and added a push domain.


    Before you can use the time shifting feature, you must first enable the feature for a stream.
    Currently, the smallest time-shift offset is 90 seconds, which means there must be a delay of at least 90 seconds between live content and time-shifted content.
    Time shifting relies on the live recording feature. Therefore, you may also incur VOD storage and traffic costs.


    Step 1. Activate VOD

    1. Go to the VOD console. Click Activate Now.
    2. Agree to the service agreement, and click OK to activate VOD.

    Step 2. Add a domain for time shifting

    Follow the steps below to add a VOD domain for time shifting:
    1. Log in to the VOD console. Select Application Management on the left sidebar and select the target application. Go to Distribution and Playback > Domain Name.
    2. Click Add Domain and enter a domain name. For detailed directions, see Distribution and Playback Settings.
    3. Add a CNAME record for the domain.

    Step 3. Bind a recording template

    1. Go to the CSS console and select Feature Configuration > Live Recording.
    2. Click Create Template. For detailed directions, see Live Recording.
    Select HLS as the file format.
    Set the file storage period, which cannot be shorter than the time-shift period.
    3. Bind the recording template to the push domain. For detailed directions, see Recording Configuration.

    Step 4. Enable time shifting

    You need to submit a ticket to enable the time shifting feature: Select "CSS", make your request, and provide the following parameters:
    The domain added in Step 2.
    The ID of the recording template created in Step 3.
    The time-shift period (timeshift_dur) in seconds.
    Time-shift period indicates how further back you can go in terms of time shifting. The maximum time-shift period allowed currently is 7 days.
    This feature may not work exactly according to the period configured. We recommend you set the period a little longer than you actually need.
    If the time-shift period is set to 7200 (two hours), you will be able to request content generated as early as two hours ago. (i.e., the value range for playback delay is 90 seconds to 2 hours). If content generated earlier than two hours ago is requested, HTTP 404 will be returned even if there is live streaming content at the requested time.

    Playback Request

    Request URL format


    Parameter description

    The domain you registered for time shifting (the domain you added in the VOD console).
    This is a fixed field. You don't need to modify it.
    The application name. For example, if your application is named live, pass in live.
    The stream name.
    This is a fixed field. You don't need to modify it.
    The playback delay (seconds). This parameter cannot be smaller than 90. If you pass in a value smaller than 90, 90 will be used.


    Suppose the time-shift domain name is testtimeshift.com, application name live, and stream name SLPUrIFzGPE. If you need to play back live content generated 5 minutes ago, the request URL should be:
    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