[object Object] Icon

Learn how to create, start, manage and modify Encodings

[object Object] Icon

Learn how to create, start, manage and modify Players

[object Object] Icon

Learn how to create, start, manage and modify Analyticss

Docs Home
User shortcuts for search
Focus by pressing f
Hide results by pressing Esc
Navigate via   keys

Tue Jul 05 2022

Bitmovin CDN Output (Beta)

Tue Jul 05 2022

OverviewLink Icon

The Bitmovin Content Delivery Network (CDN) helps set up your workflows faster by simplifying your content distribution. It’s easy to use and removes the need to set up your own output storage. Your content will be automatically distributed around the globe, enabling fast and efficient delivery to all your viewers without any additional effort.

RequirementsLink Icon

  • SDK Version: 1.111.0 or higher
  • Content-Type: VoD (1.111.0 or higher), LIVE (1.113.0 or higher)
  • Available to Bitmovin Accounts created after April 5th, 2022 that have
    • Starter or PAYG subscription, and
    • Users during their 30-Day Encoding Trial.

Supported FeaturesLink Icon

  • Simple Encoding API for VoD and LIVE
  • customized encoding workflows for VoD

Usage in the DashboardLink Icon

The Bitmovin CDN Output is listed in the Outputs overview, where you find your existing Output resources as well. So, you can also use it as an Output destination in Step 6 when you create a new Encoding through the Dashboard:

  1. Go to https://bitmovin.com/dashboard/
  2. On the left, open the "Encoding" section, and select "Encodings"
  3. In the upper right corner of the Overview, click "Create new encoding"
  4. Go through each step and select your Input and all desired renditions and manifests for your encoding.
  5. In step 6, select "CDN" in the Output List encoding-ui-output-list--cdn
  6. In step 7 of the Encoding Wizard, click "Start Encoding", then "Go to Encoding" once the encoding successfully started to open its encoding detail view.
  7. There, select the “Manifests” tab. You will find the CDN URL to your encoded content there. Click the “Preview” button to view in the dashboard right away :slight_smile: encoding-details-manifest-cdn-url

ℹ️ The domain name in this URL is unique to your account. It gets set up the first time you use the CDN as output for an encoding. So, it can take a couple of minutes for its DNS entry to become globally available. As soon as it is reachable, you will be able to play your content as expected.

Usage with the Simple Encoding APILink Icon

This API is the most simple, and easy way to start an encoding today. Using your dedicated CDN Output only requires to provide outputs:[{ type: "CDN" }] in your Simple Encoding API request:

1curl --location --request POST 'https://api.bitmovin.com/v1/encoding/simple/jobs/vod' \
2 --header 'x-api-key: YOUR_BITMOVIN_API_KEY' \
3 --header 'Content-Type: application/json' \
4 --data-raw '{
5 "name": "simple_encoding_name",
6 "encodingTemplate": "H264",
7 "inputs": [
8 {
9 "url": "s3://my-bucket/path/file.mp4",
10 "credentials": {
11 "accessKey": "S3_INPUT_ACCESS_KEY",
12 "secretKey": "S3_INPUT_SECRET_KEY"
13 }
14 }
15 ],
16 "outputs": [
17 {
18 "type": "CDN"
19 }
20 ]
21 }'

Using the Bitmovin SDK for Java (v1.111 or higher), this translates to

1simpleEncodingJob.addOutputsItem(new SimpleEncodingVodJobCdnOutput());

Doing so, you tell the Simple Encoding API to use the Bitmovin CDN Output that is present in your account.

1// define input
2var input = new SimpleEncodingVodJobUrlInput();
5// input credentials
6var inputCredentials = new SimpleEncodingVodJobAccessKeyCredentials();
11// put it all together
12SimpleEncodingVodJobRequest simpleEncodingJob = new SimpleEncodingVodJobRequest();
13simpleEncodingJob.setEncodingTemplate(EncodingTemplate.H264) //or EncodingTemplate.AV1
15// define CDN output
16simpleEncodingJob.addOutputsItem(new SimpleEncodingVodJobCdnOutput());
18// call the API to start the Job

Usage with the Bitmovin APILink Icon

ℹ️ Take a look at our Getting Started Guide to learn how to use the Bitmovin API to create your first custom encoding workflow.

Using the Bitmovin API, you will have to look up the CDN Output in your account to obtain its ID first to use it in the EncodingOutput Configuration Objets of your encoding workflow. The simplest way to do that is to use the “List CDN Outputs” endpoint:

1CdnOutput cdnOutput = bitmovinApi.encoding.outputs.cdn.list().getItems().get(0);

or, you obtain its details by using its ID. You can look up its ID in the dashboard under “Encoding => Outputs“. Click on the "CDN" Output there to open its detail view, copy its ID, and replace with it yourCdnOutputId in the code snippet below:

1CdnOutput cdnOutput = bitmovinApi.encoding.outputs.cdn.get("yourCdnOutputId");

Output paths for CDN Outputs

When you create an encoding you configure it as you do usually. Once an encoding is started, all EncodingOutput Configuration Objects that refer to CDN Output will be automatically adjusted to meet CDN Output file structure requirements:

  • Every outputPath of an EncodingOutput Configuration Object will be pre-fixed with an Asset ID which is unique within an encoding. Doing so, it is ensured that all resources created by an encoding share the same root folder on your CDN Output.
  • ACL permissions are set to PRIVATE to ensure the content on the CDN storage is only accessible through its attached CDN Endpoint URL.

Obtain the CDN URL for your encoded contents

outputPaths only contain relative URLs. By concatenating the domainName of your CDN Output with those output paths you will obtain the URL to a particular resource on your CDN storage.

ℹ️ The domainName of an CDN Output is only available, after it was used at least once by an successful encoding.

The following example show how you can programmatically obtain the CDN URL for an output of an Progressive MP4 Muxing:

1// retrieve updated CDN output details
2CdnOutput cdnOutput = bitmovinApi.encoding.outputs.cdn.get(cdnOutput.getId())
4// retrieve updated muxing details (https://bitmovin.com/docs/encoding/api-reference/all#/Encoding/GetEncodingEncodingsMuxingsByEncodingIdAndMuxingId)
5Mp4Muxing retrievedMuxing =
6 bitmovinApi.encoding.encodings.muxings.mp4.get(encoding.getId(), muxing.getId());
8// find the EncodingOutput of the muxing that refers to the CdnOutput (in case there are more than one)
9EncodingOutput cdnEncodingOutput =
10 retrievedMuxing.getOutputs().stream()
11 .filter(encodingOutput -> encodingOutput.getOutputId().equals(cdnOutput.getId())).findFirst().get();
13// build the CDN URL
14String pathOnCdn = String.format("https://%s/%s%s", cdnOutput.getDomainName(), cdnEncodingOutput.getOutputPath(), retrievedMuxing.getFilename());

The following example shows how you can programmatically obtain the CDN URL for a Manifest:

1// retrieve updated output details (domainName is only available after the first usage) (https://bitmovin.com/docs/encoding/api-reference/sections/outputs#/Encoding/GetEncodingOutputsCdnByOutputId)
2CdnOutput cdnOutput = bitmovinApi.encoding.outputs.cdn.get(cdnOutput.getId())
4// retrieve updated manifest details (https://bitmovin.com/docs/encoding/api-reference/sections/manifests#/Encoding/GetEncodingManifestsDashByManifestId)
5DashManifest retrievedManifest =
6 bitmovinApi.encoding.manifests.dash.get(manifest.getId());
8// find the EncodingOutput of the muxing that refers to the CdnOutput (in case there are more than one)
9String manifestOutputPath =
10 retrievedManifest.getOutputs().stream()
11 .filter(encodingOutput -> encodingOutput.getOutputId().equals(cdnOutput.getId()))
12 .findFirst()
13 .map(EncodingOutput::getOutputPath).get();
15// build the absolute path
16String pathOnCdn =
17 String.format(
18 "https://%s/%s%s",
19 cdnOutput.getDomainName(),
20 manifestOutputPathOptional.get(),
21 manifest.getManifestName());

Known LimitationsLink Icon

  • When using the Bitmovin CDN Output for the first time, it can take a couple of minutes until the necessary DNS entries for your CDN are propagated. The storage for your CDN is immediately available.
  • Only automatically generated manifests that are created as part of the Encoding Start Request, can be used when using the Bitmovin CDN Output.
  • Live Encodings don’t support the Bitmovin CDN Output at the moment.

CDN Usage Statistics APILink Icon

In order to retrieve the usage statistics of your CDN, a GET request can be made to the following endpoint https://api.bitmovin.com/v1/encoding/statistics/cdn/usage?from={time-stamp}&to={time-stamp}, where the from and to query parameters determine the time period for which the usage statistics are retrieved.

ℹ️ Note: both of the following date formats are accepted in the request: yyyy-MM-dd and yyyy-MM-ddThh:mm:ssZ. The maximum retrieval time period is of 100 days.

1curl 'https://api.bitmovin.com/v1/encoding/statistics/cdn/usage?from=2022-04-12&to=2022-04-15' \
2 --header 'x-api-key: YOUR_BITMOVIN_API_KEY' \
3 --header 'Content-Type: application/json'

The request will return to the total amount of transfer usage and storage usage, as well as those usages by day:

2 "from": "2022-04-12T00:00:00Z",
3 "to": "2022-04-15T00:00:00Z",
4 "transferUsageTotal": 260.0,
5 "storageUsageTotal": 170.0,
6 "usage":
7 [
8 {
9 "from":"2022-04-12T00:00:00Z",
10 "to":"2022-04-13T00:00:00Z",
11 "storageUsage": 100.0,
12 "transferUsage": 120.0
13 },
14 {
15 "from":"2022-04-13T00:00:00Z",
16 "to":"2022-04-14T00:00:00Z",
17 "storageUsage": 100.0,
18 "transferUsage": 0.0
19 },
20 {
21 "from":"2022-04-14T00:00:00Z",
22 "to":"2022-04-15T00:00:00Z",
23 "storageUsage": 50.0,
24 "transferUsage": 50.0
25 },
26 {
27 "from":"2022-04-15T00:00:00Z",
28 "to":"2022-04-16T00:00:00Z",
29 "storageUsage": 10.0,
30 "transferUsage": 0.0
31 }
32 ]

ℹ️ The measure unit for storage is GB/month, conveying how many gigabytes per month are consumed for storage, while the measure unit for transfer is GB, which conveys the number of gigabytes transferred.


In the dashboard, the CDN usage statistics can be found under the billing statistics page. The data for the last 2 days has a latency, so it may be either incomplete or not available yet.

CDN Output Statistics - Storage

CDN Output Statistics - CDN usage

Give us feedback