Live Station overview
    • PDF

    Live Station overview

    • PDF

    Article summary

    Summary

    Live Station is a video encoding platform that provides all the features needed to build a real-time live broadcast service.
    With Live Station, you can easily and quickly create multiple multi-bitrate output streams from a single RTMP source stream through a web interface, and packetize and transmit video to HLS and DASH.
    In addition to converting a single high-definition live video to various quality, it also provides a real-time digital video recorder (DVR) feature, which allows you to build a broadcast replay service using the generated video files.

    It also provides the re-streaming feature where you can simultaneously transmit live media videos to other platforms easily. You can transmit videos simultaneously to various broadcasting platforms such as YouTube, Twitch, Afreeca TV, etc., and manage the transmission statuses at once in Live Station.

    Common settings

    Live Station API URL

    https://livestation.apigw.ntruss.com/api/v2
    

    Request headers

    Header nameRequiredDescription
    x-ncp-apigw-timestampYESIt indicates the elapsed time in milliseconds since January 1, 1970 00:00:00 UTC, and the 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-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)

    Authentication header

    An API Gateway authentication is required to use the Live Station API.

    See NAVER Cloud Platform API for more detailed guides related to API Gateway authentication.

    Create AUTHPARAMS

    AUTHPARAMS request example

    curl -i -X GET \
       -H "x-ncp-apigw-timestamp:1505290625682" \
       -H "x-ncp-iam-access-key:D78BB444D6D3C84CA38A" \
       -H "x-ncp-apigw-signature-v2:WTPItrmMIfLUk/UyUIyoQbA/z5hq9o3G8eQMolUzTEo=" \
       -H "x-ncp-region_code:KR" \
    'https://livestation.apigw.ntruss.com/api/v2/channels'
    
    • Create a signature (add a new line with \n)

      • Create StringToSign matching the request, encrypt using SecretKey with HmacSHA256 algorithm, and encode using Base64.

      • This value is used as x-ncp-apigw-signature-v2.

        RequestStringToSign
        GET /api/v2/channels?pageNo=1
        x-ncp-apigw-timestamp={timestamp}
        x-ncp-iam-access-key={accesskey}
        x-ncp-apigw-signature-v2={signature}
        GET /api/v2/channels?pageNo=1
        {timeStamp}
        {accessKey}
    • Sample code

    public String makeSignature() {
        String space = " ";					// Space
        String newLine = "\n";  				// Line break
        String method = "GET";  				// HTTP method
        String url = "/api/v2/channels?pageNo=1";	// Full URL under "/" (including query strings), excluding the domain
        String accessKey = "{accessKey}";		// access key id (from portal or Sub Account)
        String secretKey = "{secretKey}";		// secret key (from portal or Sub Account)
        String timestamp = String.valueOf(System.currentTimeMillis());		// Current timestamp (epoch, millisecond)
    
        String message = new StringBuilder()
            .append(method)
            .append(space)
            .append(url)
            .append(newLine)
            .append(timestamp)
            .append(newLine)
            .append(accessKey)
            .toString();
    
        SecretKeySpec signingKey = new SecretKeySpec(secretKey.getBytes("UTF-8"), "HmacSHA256");
        Mac mac = Mac.getInstance("HmacSHA256");
        mac.init(signingKey);
    
        byte[] rawHmac = mac.doFinal(message.getBytes("UTF-8"));
        String encodeBase64String = Base64.encodeBase64String(rawHmac);
    
      return encodeBase64String;
    }
    
    /*
    https://code.google.com/archive/p/crypto-js/
    https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/crypto-js/CryptoJS%20v3.1.2.zip
    */
    
    /*
    CryptoJS v3.1.2
    code.google.com/p/crypto-js
    (c) 2009-2013 by Jeff Mott. All rights reserved.
    code.google.com/p/crypto-js/wiki/License
    */
    
    
    
    function makeSignature(secretKey, method, url, timestamp, accessKey) {
    	var space = " ";
    	var newLine = "\n";
    
    	var hmac = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, secretKey); // secret key
    	hmac.update(method);		// HTTP method
    	hmac.update(space);		// Space
    	hmac.update(url);		// Full URL under "/" (including query strings), excluding the domain
    	hmac.update(newLine);		// Line break
    	hmac.update(timestamp);		// Current timestamp (epoch, millisecond)
    	hmac.update(newLine);		// Line break
    	hmac.update(accessKey);		// access key (from portal or iam)
    
    	var hash = hmac.finalize();
    
    	return hash.toString(CryptoJS.enc.Base64);
    }
    
    import sys
    import os
    import hashlib
    import hmac
    import base64
    import requests
    import time
    
    def	make_signature():
    	timestamp = int(time.time() * 1000)
    	timestamp = str(timestamp)				# Current timestamp (epoch, millisecond)
    
    	access_key = "{accessKey}"				# access key id (from portal or Sub Account)
    	secret_key = "{secretKey}"				# secret key (from portal or Sub Account)
    	secret_key = bytes(secret_key, 'UTF-8')
    
    	method = "GET"						# HTTP method
    	uri = "/api/v2/channels?pageNo=1"			# Full URL under "/" (including query strings), excluding the domain
    
    	message = method + " " + uri + "\n" + timestamp + "\n"
    	+ access_key
    	message = bytes(message, 'UTF-8')
    	signingKey = base64.b64encode(hmac.new(secret_key, message, digestmod=hashlib.sha256).digest())
    	return signingKey
    
    function makeSignature() {
    	nl=$'\\n'
    
    	TIMESTAMP=$(echo $(date +%s000))	# Current timestamp (epoch, millisecond)
    	ACCESSKEY="{accessKey}"				# access key id (from portal or Sub Account)
    	SECRETKEY="{secretKey}"				# secret key (from portal or Sub Account)
    	METHOD="GET"					# HTTP method
    	URI="/api/v2/channels?pageNo=1"		# Full URL under "/" (including query strings), excluding the domain
    
    	SIG="$METHOD"' '"$URI"${nl}
    	SIG+="$TIMESTAMP"${nl}
    	SIG+="$ACCESSKEY"
    
    	SIGNATURE=$(echo -n -e "$SIG"|iconv -t utf8 |openssl dgst -sha256 -hmac $SECRETKEY -binary|openssl enc -base64)
    }
    

    Live Station API request configuration

    Header
      x-ncp-apigw-timestamp:{Timestamp}
      x-ncp-iam-access-key:{Sub Account Access Key}
      x-ncp-apigw-signature-v2:{API Gateway Signature}
      x-ncp-region_code:KR
      Content-Type:application/json
    Body
      Json Object
    URL
      https://livestation.apigw.ntruss.com/api/v2/{action}
    

    Live Station API request sample

    curl -i -s -X POST \
       -H "Content-Type:application/json" \
       -H "x-ncp-apigw-timestamp:1521787414578" \
       -H "x-ncp-iam-access-key:6uxz1nKkcYwUjWRG5Q1V7NsW0i5jErlu2NjBXXgy" \
       -H "x-ncp-apigw-signature-v2:iJFK773KH0WwQ79PasqJ+ZGixtpDQ/abS57WGQdld2M=" \
       -H "x-ncp-region_code:KR" \
       "https://livestation.apigw.ntruss.com/api/v2/channles"\
       -d "{ \"channelName\": \"api-guide\", \"qualitySetId\": 1234, \"qualitySetId\": false, \"record\" : {\"type\":\"NO_RECORD\"}, \"cdn\": { \"createCdn\" : true, \"cdnType\": \"GLOBAL_EDGE\", \"profileId\":1111, \"regionType\":\"KOREA\", \"cdnInstanceNo\":123456}, \"drmEnabledYn\":false}"
    

    Live Station API Content-Type

    application/json is used for the Content-type of all data delivered through Live Station API HTTP requests and response bodies.


    Was this article helpful?

    What's Next
    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.