MENU
      Create short-clip

        Create short-clip


        Article summary

        An API to create short-clips for Live Station. Provides the short-clip list view API to view the list of created short-clips and the short-clip information view API to view detailed information on short-clips.

        Note
        • Short-clips
          • 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.
        • Short-clip creation
          • Specific, desired segments can be created as short-clips using previously created snapshots.
          • Created short-clips are automatically uploaded into the specified NAVER Cloud Object Storage.
          • Short-clips are provided in mp4 format.
          • startTime and endTime are in ms format, and ms-level trimming is supported.
          • When creating short-clips, startTime and endTime are entered relative to the playback time of the snapshots. (For example, if startTime: 0, endTime 1500 is requested, short-clip is to be created for 1.5 seconds (00:00:000 - 00:00:015) of the snapshots)
          • Created short-clips can be viewed through short-clip information/short-clip list.
        Caution
        • Cautions for short-clip creation
          • Short-clips can be created only when channel status is READY or PUBLISHING.
          • Short-clip end time (endTime) - short-clip start time (startTime) cannot exceed snapshot playback time.
          • The minimum short-clip end time is 100 ms.
          • Valid snapshot ID's can be obtained by viewing channel list information.

        Requests

        POST https://livestation.apigw.ntruss.com/api/v2/channels/{channelId}/{snapshotId}
        HTTP

        Request headers

        Header nameRequiredDescription
        x-ncp-apigw-timestampYESTime elapsed since January 1, 1970 00:00:00 UTC in milliseconds. The request is considered invalid if the time difference compared to the API Gateway server is 5 minutes or longer
        x-ncp-apigw-timestamp:{Timestamp}
        x-ncp-iam-access-keyYESAccess key ID value issued from 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-TypeYESSpecifies the request body content type as application/json
        Content-Type: application/json
        x-ncp-region_codeYESRegion code (KR)

        Request bodies

        Field nameRequiredTypeService limitsDescription
        startTimeYesIntegerMinimum input time: 0
        Requested time format: milliseconds (e.g., 0)
        Trimming start point of the short-clip to be created
        endTimeYesIntegerEnd time exceeding the snapshot playback time cannot be entered
        Minimum input time: current request time + 100 ms
        Maximum input time: snapshot playback time
        Requested time format: milliseconds (e.g., 100)
        Trimming end point of the short-clip to be created
        shortclipYesObjectShort-clip object
        shortclip.outputYesObjectSettings of the Object Storage in which the created short-clip is to be stored
        shortclip.output.accessControlYesStringPRIVATE, PUBLIC_READOption which specifies the scope of disclosure of the Object Storage Bucket in which the created short-clip is to be stored
        Default: PRIVATE
        shortclip.output.bucketNameYesStringBucket name of the Object Storage in which the created short-clip is to be stored
        shortclip.output.filePathYesStringfilePath of the Object Storage in which the created short-clip is to be stored
        filePaths must start with "/"

        Responses

        Field nameTypeDescriptionNote
        channelIdStringChannel ID used in creating short-clip
        snapshotIdStringSnapshot ID used in creating short-clip
        shortclipObjectShort-clip object
        shortclip.idIntegerShort-clip ID
        shortclip.statusStringShort-clip statusCREATING,COMPLETED,PROCESSING_FAIL,UPLOAD_FAIL
        shortclip.outputObjectInformation in which the created short-clip is to be stored
        shortclip.output.accessControlStringOption which specifies the scope of disclosure of the Object Storage Bucket in which the created short-clip is to be stored
        Default: PRIVATE
        PRIVATE,PUBLIC_READ
        shortclip.output.bucketNameStringBucket name of the Object Storage in which the created short-clip is to be stored
        shortclip.output.filePathStringfilePath of the Object Storage in which the created short-clip is to be stored
        filePaths must start with "/"
        shortclip.output.fileNameStringFile name of the created short-clip
        shortclip.createdTimeStringTime of creation of the created short-clip file
        shortclip.updatedTimeStringUpdate time of the created short-clip file

        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",
            "snapshotId": 1047,
            "shortclip": {
              "id": 1060,
              "status": "CREATING",
              "createdTime": 1655979377666,
              "updatedTime": 1655979377666,
              "output": {
                "accessControl": "PRIVATE",
                "bucketName": "myTestBucket",
                "filePath": "/",
                "fileName": "1024-1655290646131.mp4"
              }
            }
          }
        }
        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.