Create Snapshots
    • PDF

    Create Snapshots

    • PDF

    Article Summary

    A snapshot API for creating short-clips for Live Station. Provides a snapshot information search API for searching created snapshots.

    Note
    • Short-clip functions
      • Short-clips can be created at a desired point of time through time machine settings (useDVR==true).
      • Short-clips of 100 ms to 4 hours in length can be created through created snapshots.
    • Snapshot
      • Provides snapshots for creating short-clips.
      • Provides videos of up to 4 hours from recording start time to end time and can create multiple snapshots depending on the point of time of snapshot request.
      • Valid snapshot ID's can be obtained by viewing channel list information.
    Caution
    • Cautions for snapshot creation
      • Snapshots can be created only during recording.
      • Snapshots can be created from the point of time when recording time reaches 100 ms.
      • If limitedDuration is requested, snapshots can be created from the latest point of time to the point of limitedDuration.
      • The minimum requested duration for snapshots is 1 minute.
      • If channel is deleted, all created snapshots are deleted.
      • If recording is re-started, the previously provided snapshot time is reset as well.
      • Created snapshots are valid only for 1 hour from the time of creation. (Expires after 1 hour)

    Requests

    POST https://livestation.apigw.ntruss.com/api/v2/channels/{channelId}/snapshot?limitedDuration={limitedDuration}
    

    Request Parameters

    Parameter nameRequirement statusTypeRestrictionsDescription
    limitedDurationNoInteger1 – 240Play time of the snapshot to be created from the latest point of time (unit: minutes)
    Example: if limitedDuration is requested as 1 at 01:00, videos for 00:59 – 01:00 are provided

    Request headers

    Header nameRequirement statusDescription
    x-ncp-apigw-timestampYESIt indicates the time elapsed since January 1, 1970, 00:00:00 UTC in milliseconds and the request is considered invalid if the time difference with the API Gateway server is greater than 5 minutes
    x-ncp-apigw-timestamp:{Timestamp}
    x-ncp-iam-access-keyYESValue of access key ID issued in the NAVER Cloud Platform portal
    x-ncp-iam-access-key:{Sub Account Access Key}
    x-ncp-apigw-signature-v2YESSignature encrypted with the access key ID value and secret key
    x-ncp-apigw-signature-v2:{API Gateway Signature}
    Content-TypeYESSpecify the request body content type as application/json
    Content-Type: application/json
    x-ncp-region_codeYESRegion code (KR)

    Responses

    Field nameTypeDescriptionRemarks
    channelIdStringID of the channel in which the snapshots were created
    channelStatusStringStatus of the channel in which the snapshots were createdCREATING, READY, PUBLISH, DELETED, BLOCK, FORCE_BLOCK, FORCE_DELETED
    snapshotObjectSnapshot object
    snapshot.snapshotIdIntegerSnapshot ID
    snapshot.snapshotUrlStringSnapshot playback URLSnapshot URL is valid only for 1 hour from the time of creation.
    snapshot.createdTimeIntegerSnapshot creation time
    snapshot.expireTimeIntegerSnapshot expiration time
    snapshot.durationIntegerSnapshot creation request timeUnit: minute

    Examples

    Response examples

    HTTP/1.1 200 OK
    Server: nginx
    Date: Fri, 26 Jun 2022 09:53:32 GMT
    Content-Type: application/json;charset=utf-8
    Connection: keep-alive
    Access-Control-Allow-Origin: *
    x-ncp-trace-id: 36c9k60om4p3238cpmc9gm4cj4
    
    {
      "content": {
        "channelId": "ls-20220623115623-fHnXy",
        "channelStatus": "PUBLISHING",
        "snapshot": {
          "snapshotId": 1047,
          "snapshotUrl": "https://myTestCdn.ntruss.com/dvr/snapshot/1655982268177/ls-nmssencg001/mtfpkgmjxmyecget2wjzthbeplp5vk9a7o6c/480p-16-9/1047-1655978668177.m3u8",
          "createdTime": 1660637947987,
          "expireTime": 1660641547987,
          "duration": 1
        }
      }
    }
    

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.