Packaging Service Guide

A watermarking service provided in the form of cloud SaaS. You can embed watermarking and package your content using the PallyCon cloud service without having to build a separate server using the CLI embedder or embedder library.

sequenceDiagram participant A as Service site participant B as PallyCon cloud A ->> B: Encoded MP4 B -->> B: Watermark embedding opt Apply Multi-DRM B -->> B: Content encryption end B ->> A: Packaged result Note right of B: DASH / HLS content
(two set with 0, 1 marked)

The packaging service can be used via the web UI of the PallyCon console site or the following HTTP APIs.

PallyCon Cloud HTTP API Specification

The HTTP API requests used by the PallyCon service follow the specifications below.

Request

  • HTTP Method : GET, POST

Body

Key Value
pallycon-apidata base64 Encoding ( JSON Data string )

JSON Data Format

{
    "data":"<base64 encode(*aes256 encrypted(*request data) by site key)>",
    "timestamp":"<yyyy-mm-ddThh:mm:ssZ>",
    "hash":"<base64 encode(sha256(message format))>"
}

SHA256 message Format

<site access key> + <site_id> + <data> + <timestamp>

request data specification

request data refers to JSON data that is passed to the specified URL to execute the following APIs.

aes256 encrypted by site key

Encryption standard for transmission data protection. (See the specification below)

site access key

It is the access key value that is issued when creating PallyConsole Cloud service site. It can be checked on the PallyCon Console page.

Create Storage ID API

Request

JSON Data Format

{
    "type":"s3",
    "id":<aws key id>,
    "password":<aws access key>,
    "aws_bucket":<bucket name>
}
Name Value Required Description
type String Y “s3”
id String Y aws key id
password String Y aws access key
aws_bucket String Y bucket name

Response

JSON Data Format

{
  "storage_id":<storage id>,
  "error_code":<error code>,
  "error_message":<error message>
}
Name Value Required Description
storage_id String N generated storage id
error_code String Y “0000”: Error code defined as English / number in case of success or error
error_message String Y Error messages

Watermark & DRM Package API

Request

JSON Data Format

{
    "storage":{
        "input":{
            "storage_id":<storage id>,
            "contents_path":[ input content path ]
        },
        "output":{
            "storage_id":<storage id>,
            "path":<output path>
        }
    },
    "content_id":<content id>, 
    "streaming_format":[dash, hls], 
    "protect_type":[ drm, watermark ],
    "subtitles":[
        {
            "path":<subtitle path>,
            "language":<language>
        }
    ],
    "drm_option":{
      "mpeg_cenc":{
        "key_id":<key id>,  // optional
        "key":<key>  // optional
      },
      "hls_aes":{
        "key":<key>,  // optional
        "iv":<iv>  // optional
      },
    }   
}
Name Value Required Description
storage JSON Y Contents Storage type and file information
content_id String Y Content ID (CID, up to 200 bytes) unique within a service
streaming_format Array Y Streaming content type
protection_type Array N drm, watermark
drm_option JSON N drm packaging option

storage.input

Name Value Required Description
storage_id String Y The storage id issued by PallyCon.
contents_path Array Y Folder / file path where the original file is located. If more than one is specified, packaging by Adaptive

storage.output

Name Value Required Description
storage_id String Y The storage id issued by PallyCon.
contents_path Array Y Path where packaging results will be stored

subtitles

Name Value Required Description
path String N Subtitle file path
language String N Subtitle language

drm_option.mpeg_cenc (optional)

Name Value Required Description
key_id String N 16 byte unique value
key String N aes128 16 byte key

drm_option.hls_aes (optional)

Name Value Required Description
key hex-string No aes128 16 byte key
iv hex-string No aes128 16 byte iv

Response

JSON Data Format

{
    "job_id":<job id>, // Issued only if successful
    "error_code":<error code>, // success 0000,  
    "error_message":<error message>
}
Name Value Required Description
job_id String N Issue only if job registration succeeds
error_code String Y “0000”: Error code defined as English / number in case of success or error
error_message String N Error message

Package API Callback

When packaging is completed, the result mail will be forwarded to the representative mail registered at the Console site. In addition, the job result message is delivered according to the following specifications through the Callback URL specified in advance.

If you want to receive job results through the Callback URL page, you need to create the page according to the following specifications and then enter the URL in the integration setting page of the console site.

JSON Data Format

{
    "job_id":<job id>,  
    "error_code":<error code>,
    "error_message":<error message>,
    "input_contents_path":[input contents path],
    "output_path":<output path>
}
Name Value Required Description
job_id String Y Packaging request ID
error_code String Y “0000”: Error code defined as numeric if success or error
error_message String Y Error message
input_contents_path Array Y Input Source file path
output_path String Y Output folder path

AES256 Encryption

Aes256 encryption / decryption processing is performed as below using the site key value issued when joining PallyCon service. (Check PallyCon Console site)

aes256 Encryption

  • mode : CBC
  • key : 32 byte (Site key issued from PallyCon Console site)
  • iv : fixed 16 byte (0123456789abcdef)
  • padding : pkcs7