LVB Time Shifting

Last updated: 2020-09-25 15:28:57

    Based on the LVB recording capability, the time shifting feature stores the TS (Transport Stream) segment addresses and TS files separately into the VOD system. A client can replay video content before the current time point by passing in a time parameter in the URL with the time-shift playback domain name.

    How It Works

    In a common live broadcast in HLS format, the pushed video content is sliced into multiple TS segments. When a viewer watches it, the TS segment addresses are accessed by requesting the .m3u8 files to get the TS files. In this case, because the TS files are not persisted, the viewer cannot replay the live video content before the current time point.

    Notes

    Fees for VOD traffic and storage will be incurred when you enable the time shifting feature.

    Usage of Time Shifting

    Prerequisites

    Step 1: activate VOD service

    1. Log in to the VOD Console and click Activate Now.
    2. Check the checkbox to agree to the service agreement, and click OK to activate VOD service. Log in to the VOD console.

      Step 2: add domain name of the time-shift playback

    To add the Tencent Cloud VOD domain name for time-shift playback, perform the following:

    1. Enter VOD Console > Distribution & Playback Management > Domain Names.

    2. Click Add Domain Name and enter the VOD domain name. For more information, please see Distribution and Playback Settings

    3. Configure the new domain CNAME.

      Step 3: associate recording template

    4. Log in to the LVB Console and go to Function Template > Recording Configuration.

    5. Click + to create a recording template. For more information, please see Recording Configuration.

      Note:

      • Choose HLS for the file type.
      • Define the file storage duration, which should be no less than the time-shift duration
    6. Associate the recording template with the push domain name to be configured. For more information, please see Recording Configuration.

    Step 4: activate the time shifting feature

    Go to the ticket system to submit a ticket. Select “LVB” and request to activate time shift feature and provide the following parameters:

    • VOD domain name for **time-shift playback added in Step 2.
    • Recording template ID added in Step 3.
    • Define time-shift duration timeshift_dur in seconds

      Note:

      • Time-shift duration, which refers to the maximum time-shift duration (up to 7 days currently).
      • The defined duration may not take accurately. We recommend that you adding a little buffer.
      • Suppose the duration is configured as 7200 (2 hours), you will be able to request time-shifted contents generated less than 2 hours ago (delay, or the time-shift duration will range from 90 seconds to 2 hours). When any content generated more than 2 hours ago is requested, HTTP 404 will be returned even if there is live streaming content.

    Playback Request

    Request URL format

    http://[Domain]/timeshift/[AppName]/[StreamName]/timeshift.m3u8?delay=xxx

    Parameters

    Parameter Description
    [Domain] The registered domain name of the time shifting feature, namely, the time-shift playback domain name you added to the VOD console.
    timeshift Fixed field which needs no modification
    [AppName] Application name. Suppose your application name is live, then enter live
    [StreamName] Stream name. You need fill in the stream name of your request
    timeshift.m3u8 Fixed field which needs no modification
    delay The time-shift duration in seconds. This value is larger than or equals to 90. It will default back to 90 if the configured value is less than 90.

    Sample

    Suppose current time-shift domain name is testtimeshift.com, time-shift application name is live and the stream name is SLPUrIFzGPE. If you need to play back live content generated five minutes ago, the request URL should be:

    http://testtimeshift.com/timeshift/live/SLPUrIFzGPE/timeshift.m3u8?delay=300

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help