MENU
      스냅샷 생성

        스냅샷 생성


        기사 요약

        Live Station의 숏클립 생성을 위한 스냅샷 생성 API 입니다. 생성한 스냅샷 조회를 위해 스냅샷 정보 조회 API를 제공합니다.

        참고
        • 숏클립 기능
          • 채널에 설정된 타임머신 (useDVR==true) 설정을 통해 원하는 시점의 숏클립을 생성할 수 있습니다.
          • 생성된 스냅샷을 통해 최소 100ms , 최대 4시간 분량의 숏클립을 생성할 수 있습니다.
        • 스냅샷
          • 숏클립 생성을 위한 스냅샷을 제공합니다.
          • 녹화 시작부터 종료 지점까지 최대 4시간 분량의 영상을 제공하며 스냅샷 요청 시점에 따라 복수개의 스냅샷을 생성할 수 있습니다.
          • 유효한 스냅샷 ID 는 채널 목록,정보 조회를 통해 획득 가능합니다.
        주의
        • 스냅샷 생성시 유의 사항
          • 스냅샷은 녹화 중 상태일 때만 생성할 수 있습니다.
          • 스냅샷 생성은 녹화 시간이 100ms 초과한 이후부터 생성할 수 있습니다.
          • limitedDuration 을 요청 할 경우, 가장 최근 시점 부터 limitedDuration 시점 전까지 스냅샷을 생성 할 수 있습니다.
          • 스냅샷 요청 시간의 최소 시간은 1분입니다.
          • 채널을 삭제 할 경우, 생성한 스냅샷은 모두 삭제됩니다.
          • 녹화를 재시작 할 경우, 제공 스냅샷 시점 또한 초기화됩니다.
          • 생성한 스냅샷은 생성 시점부터 1시간만 유효합니다. (1시간 이후 만료)

        요청

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

        요청 파라미터

        파라미터명필수 여부타입제약 사항설명
        limitedDurationNoInteger1 ~ 240가장 최근 시점부터 생성할 스냅샷의 재생 시간 (단위 : 분)
        예시 : 01:00 에 limitedDuration 을 1로 요청 할 경우 00:59 ~ 01:00 시점 영상 제공

        요청 헤더

        헤더명필수 여부설명
        x-ncp-apigw-timestampYES1970년 1월 1일 00:00:00 협정 세계시(UTC)부터의 경과 시간을 밀리초(Millisecond)로 나타내며 API Gateway 서버와 시간 차가 5분 이상 나는 경우 유효하지 않은 요청으로 간주
        x-ncp-apigw-timestamp:{Timestamp}
        x-ncp-iam-access-keyYES네이버 클라우드 플랫폼 포털에서 발급받은 Access Key ID 값
        x-ncp-iam-access-key:{Sub Account Access Key}
        x-ncp-apigw-signature-v2YESAccess Key ID 값과 Secret Key로 암호화한 서명
        x-ncp-apigw-signature-v2:{API Gateway Signature}
        Content-TypeYESRequest body content type을 application/json으로 지정
        Content-Type: application/json
        x-ncp-region_codeYES리전 코드 (KR)

        응답

        필드명타입설명비고
        channelIdString스냅샷을 생성한 채널 ID
        channelStatusString스냅샷을 생성한 채널 상태CREATING, READY, PUBLISH, DELETED, BLOCK, FORCE_BLOCK, FORCE_DELETED
        snapshotObject스냅샷 Object
        snapshot.snapshotIdInteger스냅샷 ID
        snapshot.snapshotUrlString스냅샷 재생 URL스냅샷 URL 은 생성 시점부터 1시간만 유효합니다.
        snapshot.createdTimeInteger스냅샷 생성 시간
        snapshot.expireTimeInteger스냅샷 만료 시간
        snapshot.durationInteger스냅샷 생성 요청 시간단위 : 분

        예시

        응답 예시

        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

        이 문서가 도움이 되었습니까?

        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.