HLS Copy to S3

HLS Copy to S3 (serviceId eyevinn-hls-copy-s3, license MIT) copies a complete HLS package (playlists and media segments) to an S3 bucket, without first downloading all files and then uploading them yourself. In Eyevinn Open Source Cloud (OSC) it is a job service: each instance runs the copy once and then finishes.

What it can do

  • Copy a full HLS package from an HTTP(S) source playlist URL to an S3 bucket.
  • Write to AWS S3 or S3-compatible storage such as OSC MinIO (via the endpoint option).

Creating an instance

Prerequisite: a destination S3 bucket. If it is a bucket on OSC (MinIO), the access key is the RootUser and the secret key is the RootPassword of the MinIO instance (read them with describe-service-instance).

Store the destination credentials as service secrets with create-service-secret (serviceId eyevinn-hls-copy-s3), for example destaccesskey and destsecretkey. Then call create-service-instance with serviceId: "eyevinn-hls-copy-s3":

{
  "name": "mycopy",
  "cmdLineArgs": "https://lab.cdn.eyevinn.technology/osc/VINN-10/339bd6f7-5db1-4faf-9b95-eb5c90f017f5/index.m3u8 s3://dest-bucket/files/",
  "DestAccessKey": "{{secrets.destaccesskey}}",
  "DestSecretKey": "{{secrets.destsecretkey}}",
  "DestEndpoint": "https://minio.example.com"
}

DestRegion and DestEndpoint are optional. Verify completion with get-logs-for-instance (the job logs show the copy progress).

Options

Option Required Type Meaning
name Yes string Name of the job. Letters, digits and underscore (^\w+$); OSC limits names to 20 characters.
cmdLineArgs Yes string Command line arguments for the job: the URL of the source HLS (multi-variant) playlist followed by the destination S3 URL in the form s3://bucket/path/, for example https://example.com/vod/index.m3u8 s3://dest-bucket/files/. The full package is downloaded and uploaded to the bucket.
DestAccessKey Yes string, sensitive Access key ID for the destination bucket (env DEST_ACCESS_KEY).
DestSecretKey Yes string, sensitive Secret access key for the destination bucket (env DEST_SECRET_KEY).
DestRegion No string Region of the destination bucket, for example eu-north-1 (env DEST_REGION). Optional since some S3-compatible storage does not need one.
DestEndpoint No string Endpoint URL of the destination S3 service for S3-compatible storage such as MinIO, for example https://minio.example.com (env DEST_ENDPOINT).

Pass DestAccessKey and DestSecretKey as {{secrets.NAME}}, which must be the entire field value.

Resources