MENU
      Create snapshot

        Create snapshot


        Article summary

        This is a snapshot creation API for creating short clips of Live Station. Get snapshot information API is provided to see created snapshots.

        Note
        • Short clip feature
          • You can create short clips from any point in time via the time machine (useDVR==true) setting set on the channel.
          • You can create a short clip of at least 100 ms and up to 4 hours through the created snapshot.
        • Snapshot
          • It provides a snapshot for short clip creation.
          • It provides up to 4 hours of video from the start of recording to the end point, and multiple snapshots can be created depending on when the snapshot is requested.
          • Valid snapshot ID can be obtained by querying channel list and information.
        Caution
        • Precautions when creating snapshots
          • Snapshots can only be created while recording is in progress.
          • Snapshots can be created only after the recording time exceeds 100 ms.
          • If you request a limitedDuration, you can take a snapshot from the most recent point in time until the limitedDuration point in time.
          • The minimum snapshot request time is 1 minute.
          • When deleting a channel, all snapshots created will be deleted.
          • When recording is restarted, the time of the provided snapshot is also reset.
          • Snapshots created are only valid for 1 hour from the time of creation (expires after 1 hour).

        Request

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

        Request parameters

        Parameter nameRequiredTypeRestrictionsDescription
        limitedDurationNoInteger1 - 240The playback time of the snapshot to be created from the most recent point in time (unit: minute)
        e.g., If you request limitedDuration of 1 at 01:00, you will get video from 00:59 - 01:00

        Request headers

        Header nameRequiredDescription
        x-ncp-apigw-timestampYESIt indicates the elapsed time in milliseconds since January 1, 1970 00:00:00 UTC. Request is considered invalid if the timestamp differs from the current time by more than 5 minutes
        x-ncp-apigw-timestamp:{Timestamp}
        x-ncp-iam-access-keyYESAccess key ID value issued on 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)

        Response

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

        Examples

        Response example

        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://mytest.edge.naverncp.com/dvr/snapshot/1655982268177/ls-nmssencg001/mtfpkgmjxmyecget2wjzthbeplp5vk9a7o6c/480p-16-9/1047-1655978668177.m3u8",
              "createdTime": 1660637947987,
              "expireTime": 1660641547987,
              "duration": 1
            }
          }
        }
        HTTP

        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.