How can I use my own CDN?

Hi @aoko,

Not sure I understand… I assume we want to use profile ID 1004? if so, you need to set is_default to 1. Right now, I see it is set to 0.
Also, you shouldn’t touch the profile type manually. It should be 61, same as profile ID 1001.
You basically need exactly the same values as ID 1001 has, only with your own url and hostname.
Also, you can try to set is_default to 0 for ALL but the profile you want to make sure that one is selected.

hi jess. Thank you very much for you help.

I tried the following:
mysql> update delivery_profile set is_default=false;
mysql> update delivery_profile set is_default=true where id IN(1004);

But all [*.ts] file refer to my kaltura url.
The problem does not improve.:sweat:

Am I wrong, “[Publisher Specific Delivery Settings]”?
Delivery profile ids (JSON) is
{“hls”:[4],“applehttp”:[1004],“http”:[2],“hds”:[303],“mpegdash”:[301]}

hummmm :sob:

For profile ID 1004, is_default should be set to 1, not true. For the rest, set it to 0.
If it still does not work, please post all profiles again so I can see what the records look like post all your changes.

jess thanks.

Please confirm the following information.

ysql> select * from delivery_profile\G
*************************** 1. row ***************************
id: 1
partner_id: 0
created_at: 2016-08-27 00:23:07
updated_at: 2016-08-27 00:23:07
name: Default HTTP Delivery Profile
type: 10
system_name: Default_Akamai_HLS_direct
description: Default Akamai HLS direct
url: http://my_kaltura_url
host_name: my_kaltura_url
recognizer: NULL
tokenizer: NULL
status: 0
media_protocols: NULL
streamer_type: applehttp
is_default: 0
parent_id: 0
custom_data: NULL
priority: 0
*************************** 2. row ***************************
id: 2
partner_id: 0
created_at: 2016-08-27 00:23:07
updated_at: 2016-08-27 00:23:07
name: Default HTTP Delivery Profile
type: 14
system_name: Default HTTP Delivery Profile
description: Default HTTP Delivery Profile
url: http://my_kaltura_url
host_name: my_kaltura_url
recognizer: NULL
tokenizer: NULL
status: 0
media_protocols: NULL
streamer_type: http
is_default: 0
parent_id: 0
custom_data: NULL
priority: 0
*************************** 3. row ***************************
id: 3
partner_id: 0
created_at: 2016-08-27 00:23:07
updated_at: 2016-08-27 00:23:07
name: Default HLS Live Delivery Profile
type: 1001
system_name: Default_HLS_Live_Delivery_Profile
description: Default HLS Live Delivery Profile
url: NULL
host_name: NULL
recognizer: NULL
tokenizer: NULL
status: 0
media_protocols: NULL
streamer_type: applehttp
is_default: 0
parent_id: 0
custom_data: NULL
priority: 0
*************************** 4. row ***************************
id: 4
partner_id: 0
created_at: 2016-08-27 00:23:07
updated_at: 2016-08-27 00:23:07
name: Default HLS Network Live Delivery Profile
type: 1001
system_name: Default_HLS_Network_Live_Delivery_Profile
description: Default HLS Nework Live Delivery Profile
url: NULL
host_name: NULL
recognizer: NULL
tokenizer: NULL
status: 0
media_protocols: NULL
streamer_type: hls
is_default: 0
parent_id: 0
custom_data: NULL
priority: 0
*************************** 5. row ***************************
id: 5
partner_id: 0
created_at: 2016-08-27 00:23:07
updated_at: 2016-08-27 00:23:07
name: Default HLS To Multicast Live Delivery Profile
type: 1006
system_name: Default_HLS_To_Multicast_Live_Delivery_Profile
description: Default HLS To Multicast Live Delivery Profile
url: NULL
host_name: NULL
recognizer: NULL
tokenizer: NULL
status: 0
media_protocols: NULL
streamer_type: applehttp_to_mc
is_default: 0
parent_id: 0
custom_data: NULL
priority: 0
*************************** 6. row ***************************
id: 301
partner_id: 0
created_at: 2016-08-27 00:23:07
updated_at: 2016-08-27 00:23:07
name: Default MPEG-DASH Live Delivery Profile
type: 1003
system_name: Default MPEG-DASH Live Delivery Profile
description: Default MPEG-DASH Live Delivery Profile
url: NULL
host_name: NULL
recognizer: NULL
tokenizer: NULL
status: 0
media_protocols: NULL
streamer_type: mpegdash
is_default: 0
parent_id: 0
custom_data: NULL
priority: 0
*************************** 7. row ***************************
id: 302
partner_id: 0
created_at: 2016-08-27 00:23:07
updated_at: 2016-08-27 00:23:07
name: Default HD Network Live Delivery Profile
type: 1002
system_name: Default_HD_Network_Live_Delivery_Profile
description: Default HD Network Live Delivery Profile
url: NULL
host_name: NULL
recognizer: NULL
tokenizer: NULL
status: 0
media_protocols: NULL
streamer_type: hdnetworkmanifest
is_default: 0
parent_id: 0
custom_data: NULL
priority: 0
*************************** 8. row ***************************
id: 303
partner_id: 0
created_at: 2016-08-27 00:23:07
updated_at: 2016-08-27 00:23:07
name: Default HDS Live Delivery Profile
type: 1002
system_name: Default_HDS_Live_Delivery_Profile
description: Default HDS Live Delivery Profile
url: NULL
host_name: NULL
recognizer: NULL
tokenizer: NULL
status: 0
media_protocols: NULL
streamer_type: hds
is_default: 0
parent_id: 0
custom_data: NULL
priority: 0
*************************** 9. row ***************************
id: 304
partner_id: 0
created_at: 2016-08-27 00:23:07
updated_at: 2016-08-27 00:23:07
name: Default RTMP Live Delivery Profile
type: 1005
system_name: Default_RTMP_Live_Delivery_Profile
description: Default RTMP Live Delivery Profile
url: NULL
host_name: NULL
recognizer: NULL
tokenizer: NULL
status: 0
media_protocols: NULL
streamer_type: rtmp
is_default: 0
parent_id: 0
custom_data: a:1:{s:12:“enforceRtmpe”;s:1:“0”;}
priority: 0
*************************** 10. row ***************************
id: 1001
partner_id: 0
created_at: 2016-08-27 00:23:07
updated_at: 2016-08-27 00:23:07
name: Kaltura HLS segmentation
type: 61
system_name: Kaltura HLS segmentation
description: Kaltura HLS segmentation
url: http://my_kaltura_url:88/hls
host_name: my_kaltura_url
recognizer: NULL
tokenizer: NULL
status: 0
media_protocols: NULL
streamer_type: applehttp
is_default: 0
parent_id: 0
custom_data: NULL
priority: 0
*************************** 11. row ***************************
id: 1002
partner_id: 0
created_at: 2016-08-27 00:23:07
updated_at: 2016-08-27 00:23:07
name: Kaltura HDS segmentation
type: 63
system_name: Kaltura HDS segmentation
description: Kaltura HDS segmentation
url: http://my_kaltura_url:88/hds
host_name: my_kaltura_url
recognizer: NULL
tokenizer: NULL
status: 0
media_protocols: NULL
streamer_type: hdnetworkmanifest
is_default: 0
parent_id: 0
custom_data: NULL
priority: 0
*************************** 12. row ***************************
id: 1003
partner_id: 0
created_at: 2016-08-27 00:23:07
updated_at: 2016-08-27 00:23:07
name: Kaltura DASH segmentation
type: 68
system_name: Kaltura DASH segmentation
description: Kaltura DASH segmentation
url: http://my_kaltura_url:88/dash
host_name: my_kaltura_url
recognizer: NULL
tokenizer: NULL
status: 0
media_protocols: NULL
streamer_type: mpegdash
is_default: 0
parent_id: 0
custom_data: NULL
priority: 0
*************************** 13. row ***************************
id: 1004
partner_id: 102
created_at: 2016-10-18 18:41:26
updated_at: 2016-10-19 22:34:46
name: HLS MY_CDN_URL
type: 61
system_name: HLS MY_CDN_URL
description: HLS MY_CDN_URL
url: http://MY_CDN_URL/hls
host_name: MY_CDN_URL
recognizer: NULL
tokenizer: NULL
status: 0
media_protocols: NULL
streamer_type: applehttp
is_default: 1
parent_id: 0
custom_data: NULL
priority: 0

OK, looks fine. And what does the manifest look like now?

thanks.

In the following order, there is a HTTP request.

http://MY_CDN_URL/crossdomain.xml
http://MY_CDN_URL/p/102/sp/10200/playManifest/entryId/0_ja2c0ls3/flavorIds/0_82jpj4fk,0_ir6xhg9s,0_nx4sbzsy/format/applehttp/protocol/http/a.m3u8?referrer=aHR0cDovL2FvY2hpLnVuaXYuenhjdi5qcA==&playSessionId=6787268b-1843-317b-77c4-55f770aa123e&clientTag=html5:v2.46&uiConfId=23448312
http://MY_CDN_URL/hls/p/102/sp/10200/serveFlavor/entryId/0_ja2c0ls3/v/2/flavorId/0_82jpj4fk/name/a.mp4/index.m3u8
http://MY_CDN_URL/hls/p/102/sp/10200/serveFlavor/entryId/0_ja2c0ls3/v/2/flavorId/0_ir6xhg9s/name/a.mp4/index.m3u8
http://MY_CDN_URL/hls/p/102/sp/10200/serveFlavor/entryId/0_ja2c0ls3/v/2/flavorId/0_nx4sbzsy/name/a.mp4/index.m3u8
http://MY_KALTURA_URL/p/102/sp/10200/thumbnail/entry_id/0_ja2c0ls3/version/100002/acv/122/width/100/vid_slices/100
http://MY_KALTURA_URL:88/hls/p/102/sp/10200/serveFlavor/entryId/0_ja2c0ls3/v/2/flavorId/0_82jpj4fk/name/a.mp4/seg-1-v1-a1.ts
http://MY_KALTURA_URL:88/hls/p/102/sp/10200/serveFlavor/entryId/0_ja2c0ls3/v/2/flavorId/0_82jpj4fk/name/a.mp4/seg-1-v1-a1.ts
http://MY_KALTURA_URL:88/hls/p/102/sp/10200/serveFlavor/entryId/0_ja2c0ls3/v/2/flavorId/0_nx4sbzsy/name/a.mp4/seg-2-v1-a1.ts
http://MY_KALTURA_URL:88/hls/p/102/sp/10200/serveFlavor/entryId/0_ja2c0ls3/v/2/flavorId/0_nx4sbzsy/name/a.mp4/seg-2-v1-a1.ts
http://MY_KALTURA_URL:88/hls/p/102/sp/10200/serveFlavor/entryId/0_ja2c0ls3/v/2/flavorId/0_nx4sbzsy/name/a.mp4/seg-3-v1-a1.ts

Please try editing profile 1001, setting the url to the CDN you want to use and is_default to 1.

hi jess.

As a result of editing profile 1001, did not improve…

Profile 1001 has been set as follows.

id: 1001
partner_id: 0
created_at: 2016-08-27 00:23:07
updated_at: 2016-08-27 00:23:07
name: Kaltura HLS segmentation
type: 61
system_name: Kaltura HLS segmentation
description: Kaltura HLS segmentation
url: http://mycdn.url/hls
host_name: mykaltura.url
recognizer: NULL
tokenizer: NULL
status: 0
media_protocols: NULL
streamer_type: applehttp
is_default: 1
parent_id: 0
custom_data: NULL
priority: 0

Publisher Specific Delivery Settings Delivery profile ids (JSON) is following.

{"hls":[4],"applehttp":[1001],"http":[2],"hds":[303],"mpegdash":[301]}

all [*.ts] file refer to MY_KALTURA_URL:88.

http://MY_CDN_URL/p/102/sp/10200/playManifest/entryId/0_ja2c0ls3/flavorIds/0_82jpj4fk,0_ir6xhg9s,0_nx4sbzsy/format/applehttp/protocol/http/a.m3u8
http://MY_CDN_URL/crossdomain.xml
http://MY_CDN_URL/hls/p/102/sp/10200/serveFlavor/entryId/0_ja2c0ls3/v/2/flavorId/0_82jpj4fk/name/a.mp4/index.m3u8
http://MY_KALTURA_URL:88/hls/p/102/sp/10200/serveFlavor/entryId/0_ja2c0ls3/v/2/flavorId/0_82jpj4fk/name/a.mp4/seg-1-v1-a1.ts
http://MY_KALTURA_URL:88/hls/p/102/sp/10200/serveFlavor/entryId/0_ja2c0ls3/v/2/flavorId/0_82jpj4fk/name/a.mp4/seg-1-v1-a1.ts

Hi @aoko,

Something is off here… what does:

return?

hi! hess

3records return.

mysql> select * from delivery_profile where url like “%:88%”\G

*************************** 1. row ***************************
             id: 1001
     partner_id: 0
     created_at: 2016-08-27 00:23:07
     updated_at: 2016-08-27 00:23:07
           name: Kaltura HLS segmentation
           type: 61
    system_name: Kaltura HLS segmentation
    description: Kaltura HLS segmentation
            url: http://MY_KALTURA_URL:88/hls
      host_name: MY_KALTURA_URL
     recognizer: NULL
      tokenizer: NULL
         status: 0
media_protocols: NULL
  streamer_type: applehttp
     is_default: 1
      parent_id: 0
    custom_data: NULL
       priority: 0
*************************** 2. row ***************************
             id: 1002
     partner_id: 0
     created_at: 2016-08-27 00:23:07
     updated_at: 2016-08-27 00:23:07
           name: Kaltura HDS segmentation
           type: 63
    system_name: Kaltura HDS segmentation
    description: Kaltura HDS segmentation
            url: http://MY_KALTURA_URL:88/hds
      host_name: MY_KALTURA_URL
     recognizer: NULL
      tokenizer: NULL
         status: 0
media_protocols: NULL
  streamer_type: hdnetworkmanifest
     is_default: 1
      parent_id: 0
    custom_data: NULL
       priority: 0
*************************** 3. row ***************************
             id: 1003
     partner_id: 0
     created_at: 2016-08-27 00:23:07
     updated_at: 2016-08-27 00:23:07
           name: Kaltura DASH segmentation
           type: 68
    system_name: Kaltura DASH segmentation
    description: Kaltura DASH segmentation
            url: http://MY_KALTURA_URL:88/dash
      host_name: MY_KALTURA_URL
     recognizer: NULL
      tokenizer: NULL
         status: 0
media_protocols: NULL
  streamer_type: mpegdash
     is_default: 1
      parent_id: 0
    custom_data: NULL
       priority: 0
3 rows in set (0.00 sec)

Hi @aoko,

Now I do not understand the problem. Your manifest request returns “http://MY_KALTURA_URL:88/hls/p/102/sp/10200/serveFlavor/entryId/0_ja2c0ls3/v/2/flavorId/0_82jpj4fk/name/a.mp4/seg-1-v1-a1.ts” which complies perfectly with the ‘url’ column in delivery_profile id 1001… What is the issue?

The problem is “ts file URL” is described in index.m3u8 file.

Now I do not understand the problem. Your manifest request returns “http://MY_KALTURA_URL:88/hls/p/102/sp/10200/serveFlavor/entryId/0_ja2c0ls3/v/2/flavorId/0_82jpj4fk/name/a.mp4/seg-1-v1-a1.ts” which complies perfectly with the ‘url’ column in delivery_profile id 1001… What is the issue?

What do I me what settings. To refer to the “MY_CDN_URL” from index.m3u8?
I hope that the following result is returned.
“http://MY_CDN_URL/hls/p/102/sp/10200/serveFlavor/entryId/0_ja2c0ls3/v/2/flavorId/0_82jpj4fk/name/a.mp4/seg-1-v1-a1.ts”

Uh-oh. it is just transmitted a result,
The following contents have been tested.

Also
manifest request returns “http://MY_KALTURA_URL:88/hls/p/102/sp/10200/serveFlavor/entryId/0_ja2c0ls3/v/2/flavorId/0_82jpj4fk/name/a.mp4/seg-1-v1-a1.ts” which complies perfectly with the ‘url’ column in delivery_profile id 1001… What is the issue?

Hi,

Sorry but I still don’t understand… your delivery profile had:
url: http://MY_KALTURA_URL:88/hls
so the manifest points there. If your CDN does not work over port 88, just update the record and remove the port.

Is there another problem I am missing?

The path to the TS files in any combination of delivery_profile, it will be set [MY_KALTURA_URL 88]. . .
I want to know [index.m3u8 file] is generated by any program. And, I’ll make sure the logic of the program.

Sorry but I still don’t understand what you want to accomplish.

By default, CE makes use of nginx-vod-module to serve files in HLS, HDS and DASH formats.

The first relevant service in that regard is playManifest, the code of which is here:
/opt/kaltura/app/alpha/apps/kaltura/modules/extwidget/actions/playManifestAction.class.php

Then, as I explained before, the following default profile IDs are used to serve HLS, HDS and DASH, respectfully:
mysql> select id,name,streamer_type from delivery_profile where id in (1001,1002,1003)\G
*************************** 1. row ***************************
id: 1001
name: Kaltura HLS segmentation
streamer_type: applehttp
url: http://CE_NGINX_HOST/hls
*************************** 2. row ***************************
id: 1002
name: Kaltura HDS segmentation
streamer_type: hdnetworkmanifest
url: http://CE_NGINX_HOST/hds
*************************** 3. row ***************************
id: 1003
name: Kaltura DASH segmentation
streamer_type: mpegdash
url: http://CE_NGINX_HOST/dash

By default, the url for each record points to the CE_NGINX_HOST, which has the vod-module loaded.
There is documentation for nginx-vod-module in its repo’s README.

Dear Jess.
Thank for very much for your support.

Problem was improved in there way for the moment.


This was a hint.

  1. Configure the proxy server to replace example.com/hls with example.com/video/hls by using

thanks

Hi @aoko

Not sure I understand where we stand at the moment but I just answered another post with a step by step walk through of all needed configurations.
You can see that here:

I just did a setup of a basic caching reverse proxy in front of Kaltura. I used this thread, among others, to make it work. I thought I’d share how it was done and my understanding of it.

I use two servers:
kalturacdn.com = reverse proxy.
kalturaserver.com = kaltura server.

I did the setup for a single partner. As Jess writes above, the default delivery_profiles used when playing an entry can be inspected using:

mysql>select * from delivery_profile where id in (1001,1002,1003)\G

Kaltura configuration

In admin console, in the Profiles column for my partner, I choose Delivery Profile.
I created a profile with these settings:

type = VOD_PACKAGER_HLS
Streamer Type = APPLE_HTTP
url = http://kalturacdn.com:88/hls 	
Delivery status = active

It results in the following row in the database (I stripped some irrelevant columns):

             id: 1004
     partner_id: 102
           type: 61
            url: http://kalturacdn.com:88/hls
      host_name: kalturacdn.com
         status: 0
media_protocols: NULL
  streamer_type: applehttp
     is_default: 0

Next step, in Admin console in the Actions column i choose Configure.
Under Publisher Specific Delivery Settings in the Add format drop-down list, I choose APPLE_HTTP and click the Add button. I can see my newly created delivery profile. I select it and click the OK button.

Nginx configuration

This is a very basic nginx configuration that I will use as a starting point:

http {
        proxy_cache_path /data/nginx/cache_static keys_zone=kaltura_static:100m inactive=10s max_size=1g;
        proxy_cache_path /data/nginx/cache_vod keys_zone=kaltura_vod:100m inactive=10s max_size=1g;

server {
        listen 88 default_server;
        server_name kalturacdn.com;
        add_header Access-Control-Allow-Origin *;
        proxy_cache kaltura_vod;
        location / {
                proxy_set_header Host $http_host;
                proxy_pass http://kalturaserver.com:88;
        }
}
server {
        listen 80 default_server;
        server_name kalturacdn.com;
        proxy_cache kaltura_static;
        location / {
                proxy_set_header Host $http_host;
                proxy_pass http://kalturaserver.com;
        }
}

The proxy_set_header directive is important. It seems the host attribute in the request headers from the reverse proxy will impact what url will be in the index.m3u8 file generated before playback.

Hello @pnts-se ,

We have been using our own CDN for years and here are my suggestions:

1-For kaltura server/api just configure the zzzkaltura.ssl.conf withe a wildcard (*) and a local certificate. Your CDN will do the SSL offloading but calling everything from kaltura con port 80.
This will make things easier.
2- For kaltura-ngninx, I suggest creating a different domain (ie, cdn.mykaltura.com) and adding this name to the nginx server/virtual domain. You need to configure each partner to use this particular delivery profile.
3- In order to avoid problems with your hls segments and manifests, add these lines to your kaltura.conf nginx file:

serve flavor HLS

            location ~ ^/hls/p/\d+/(sp/\d+/)?serveFlavor/ {
                 vod hls;

---- Add this—

   vod_segments_base_url $http_x_forwarded_proto://$http_x_forwarded_host;
    vod_base_url $http_x_forwarded_proto://$http_x_forwarded_host;
     .
     .

Using a CDN is more than imperative, I would say. A custom CDN will allow kaltura to scale at a reasonable cost.

I hope this helps,

David