[SOLVED]Video playing not working

Hi,
I have a kaltura server version 13.14
The storage is s3 and the content is exported and deleted from my main server.
When trying to play the content I see the player first send this url:
http://{server}/p/101/sp/10100/playManifest/entryId/0_8e7quar6/flavorIds/0_bh20g2yb,0_dqco1ogc,0_wqw4hy0x,0_rb34x7oo/format/applehttp/protocol/http/a.m3u8
And gets back a manifest with this content:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1043395,RESOLUTION=640x368
http://{server}/i/20180501/0/0_8e7quar6_0_bh20g2yb_2.mp4/index_0_av.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1726603,RESOLUTION=1024x576
http://{server}/i/20180501/0/0_8e7quar6_0_dqco1ogc_2.mp4/index_0_av.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2865981,RESOLUTION=1264x720
http://{server}/i/20180501/0/0_8e7quar6_0_wqw4hy0x_2.mp4/index_0_av.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=4477223,RESOLUTION=1904x1072
http://{server}/i/20180501/0/0_8e7quar6_0_rb34x7oo_2.mp4/index_0_av.m3u8

A call to each if these urls yeilds 404
What is this /i url, is it ok, what should I look for?

Ofer

1 Like

Hi @oferc1,

Please provide your full Nginx config.
You may find this helpful as well:

@jess This is 13.14 so the config is a bit different (I tried to make some modification according to the link)
nsginx.conf:
user kaltura;
worker_processes auto;

error_log

pid /var/run/nginx.pid;

events {
worker_connections 1024;
multi_accept on;
use epoll;
}

http {
upstream kalapi {
server {MY CF SERVRE};
}

include	   mime.types;
default_type  application/octet-stream;

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
	'$status $bytes_sent $request_time "$http_referer" "$http_user_agent" "-" - '
	'"$sent_http_x_kaltura" "$http_host" $pid $sent_http_x_kaltura_session - '
	'$request_length "$sent_http_content_range" "$http_x_forwarded_for" '
	'"$http_x_forwarded_server" "$http_x_forwarded_host" "$sent_http_cache_control" '
	'$connection ';

access_log /opt/kaltura/log/kaltura_nginx_access.log main;

sendfile on;
tcp_nopush on;
tcp_nodelay on;

keepalive_timeout 60;
keepalive_requests 1000;
client_header_timeout 20;
client_body_timeout 20;
reset_timedout_connection on;
send_timeout 20;

gzip  on;
gzip_types application/vnd.apple.mpegurl video/f4m application/dash+xml text/xml;
# common vod settings
vod_mode remote;
vod_upstream_location /kalapi_proxy;
#vod_upstream_extra_args "pathOnly=1";

# shared memory zones
vod_metadata_cache metadata_cache 512m;
vod_mapping_cache mapping_cache 64m;
vod_response_cache response_cache 64m;
vod_performance_counters perf_counters;

# common file caching / aio
open_file_cache max=1000 inactive=5m;
open_file_cache_valid 2m;
open_file_cache_min_uses 1;
open_file_cache_errors on;
aio on;

server {
	listen 88;
	server_name {MY WEB SERVER};
	include /etc/nginx/conf.d/live.conf;
	include /etc/nginx/conf.d/kaltura.conf;

}
include /etc/nginx/conf.d/ssl.conf;

}

RTMP configuration

rtmp {
server {
listen 1935; # Listen on standard RTMP port
chunk_size 4000;

    # This application is to accept incoming stream
    application kLive {
            live on; # Allows live input from above
            dash on;
            dash_path /var/tmp/dashme;

            hls on; # Enable HTTP Live Streaming
            hls_cleanup on;
            hls_sync 100ms;
            hls_fragment 2s;

            hls_path /var/tmp/hlsme/;


    }
}

}

kaltura.conf:

	# static files (crossdomain.xml, robots.txt etc.) + fallback to api
	location / {
		root   /etc/nginx/static;
		try_files $uri @api_fallback;
	}

	# nginx status page
	location /nginx_status {
		stub_status on;
		access_log off;
	}

	# vod status page
	location /vod_status {
		vod_status;
		access_log off;
	}
	
	# internal location for vod subrequests
          location ~ /kalapi_proxy/[^/]+/(.*) {
                    internal;
                    proxy_pass http://kalapi/$1;
                    proxy_http_version 1.1;
                    proxy_set_header Host {MY CF SERVER};
                    proxy_set_header Connection "";
            }

	# serve flavor progressive (clipFrom/To are not supported with 'vod none' so they are proxied)
	location ~ ^/p/\d+/(sp/\d+/)?serveFlavor/((?!clipFrom)(?!clipTo).)*$ {
		vod none;

		add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
		expires 100d;
	}
	
	# serve flavor HLS
	location ~ ^/hls/p/\d+/(sp/\d+/)?serveFlavor/ {
		vod hls;
		vod_bootstrap_segment_durations 2000;
		vod_bootstrap_segment_durations 2000;
		vod_bootstrap_segment_durations 2000;
		vod_bootstrap_segment_durations 4000;

		add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
		add_header Access-Control-Allow-Headers "*";
		add_header Access-Control-Expose-Headers "Server,range,Content-Length,Content-Range";
		add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS";
		add_header Access-Control-Allow-Origin "*";
		expires 100d;
	}
	
	# serve flavor DASH
	location ~ ^/dash/p/\d+/(sp/\d+/)?serveFlavor/ {
		vod dash;
		vod_segment_duration 4000;
		vod_bootstrap_segment_durations 3500;
		vod_align_segments_to_key_frames on;
		vod_dash_manifest_format segmenttemplate;
		
		add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
		add_header Access-Control-Allow-Headers "origin,range,accept-encoding,referer";
		add_header Access-Control-Expose-Headers "Server,range,Content-Length,Content-Range";
		add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS";
		add_header Access-Control-Allow-Origin "*";
		expires 100d;
	}
	
	# serve flavor HDS
	location ~ ^/hds/p/\d+/(sp/\d+/)?serveFlavor/ {
		vod hds;
		vod_segment_duration 6000;
		vod_align_segments_to_key_frames on;
		vod_segment_count_policy last_rounded;
		
		add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
		add_header Access-Control-Allow-Origin "*";
		expires 100d;
	}

	# serve flavor MSS
	location ~ ^/mss/p/\d+/(sp/\d+/)?serveFlavor/ {
		vod mss;
		vod_segment_duration 4000;
		vod_manifest_segment_durations_mode accurate;
		
		add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
		expires 100d;
	}	
	
	# all unidentified requests fallback to api (inc. playManifest)
	location @api_fallback {
		proxy_pass http://kalapi;
		proxy_set_header Host $http_host;
	}
	
	#error_page  404			  /404.html;

	# redirect server error pages to the static page /50x.html
	#
	error_page   500 502 503 504  /50x.html;
	location = /50x.html {
		root   html;
	}

            location /dashme {
                    open_file_cache off;
                    root /var/tmp;
                    add_header Cache-Control no-cache;
                    # To avoid issues with cross-domain HTTP requests (e.g. during development)
                    add_header Access-Control-Allow-Origin *;
            }
            location /hlsme {
                    open_file_cache off;
                    types {
                            application/vnd.apple.mpegurl m3u8;
                    }
                    root /var/tmp;
                    add_header Cache-Control no-cache; # Prevent caching of HLS fragments
                    add_header Access-Control-Allow-Origin *; # Allow web player to access our playlist
            }

@jess Any idea? How should I start debug it?
In the flash player everything play fine (on top of the CDN + S3), but not int the html5 player

Hi @oferc1,

Have you checked the Nginx error log? If you can’t determine the cause after doing so, I suggest you check the request going out to the upstream [CF] to understand why and how it fails.
You can use tcpdump for that purpose, or, alternatively, install the kaltura-nginx-debug and kaltura-nginx-debuginfo packages from the 13.19.0 repo, then modify /etc/nginx/nginx.conf so that:

error_log  /opt/kaltura/log/kaltura_nginx_errors.log;

becomes:

error_log  /opt/kaltura/log/kaltura_nginx_errors.log debug;

then reload Nginx, make the request and check the error log.

I see these 2 messages in the log:
2018/05/04 13:59:18 [warn] 7059#7059: audio_encoder_process_init: failed to get AAC encoder, audio encoding is disabled. recompile libavcodec with libfdk_aac to enable it

2018/05/04 13:59:39 [info] 7057#7057: *1 client timed out (110: Connection timed out) while waiting for request, client: 172.31.30.68, server: 0.0.0.0:88

The 2nd one reaping many times

Did you install the debug packages, enable debug mode or use a sniffer like I wrote in my previous reply?

I installed the debug package (and debuginfo) and set the debug on error log (from 13.19)

You’ll need to run a sniffer to understand which request keeps timing out then.

Just to make the {server}/i/{path} is a valid kaltura request? not some mal config I used somewhere

@oferc1,

I’m confused. Are you now working in “remote” mode directly against AWS CF or are you trying to get the flavours from your Kaltura storage, i.e: “mapped” mode?

If the former, follow the configuration in the doc I referred you to. It was tested and should work correctly, assuming the CF endpoint your provided is valid and publicly accessible [as stated in the doc, you could add token configuration if need be but it’s covered in it]. If the later, then just re-run the kaltura-nginx-config.sh script. It auto configures everything and no manual changes should be necessary.

I’m trying to get it from CF. And I’m working with the doc you send.
I’m saying the I see in the browser this url:
http://{server}/i/20180501/0/0_8e7quar6_0_bh20g2yb_2.mp4/index_0_av.m3u8
I never saw a /i/ format, so i’m validating the issue is with the nginx and not somewhere else.

Is {server} the CF endpoint? As for the rest of the URI, it would depend on the FS structure you set up for the volume.
Does http://{server}/i/20180501/0/0_8e7quar6_0_bh20g2yb_2.mp4 actually exist?
What’s the path for the entry’s flavours under /opt/kaltura/web?

no. it doesnt exist.
what I’m trying to understand is, is /i/ a valid kaltura predefined path (like /hls, /mms, etc,) or a caused by mal configuration I created.
From you response I get it is not something you know, so I guess it is some wrong configuration I did somwhere

I’ll try reinstalling and see how it goes

@jess
I figured it our, I was using the wrong Delivery profile for HLS.
So now it is basically working.
However I have another question.
I configured a CF on top of the vod nginx, (so after first time content should come from CF not nginx)
However the nginx itself is sitting under ELB (so I have CF -> ELB > nginx)
What happens is that the main index indeed returns urls that points to the CF, but all the sub indexes returns a url that points to the ELB and not to the CF.
http://{ELB}/hls/kaltura/content/entry/data/0/0/0_lai8bdd1_0_s7ar21ea_2.mp4/seg-1-v1-a1.ts
Instead of
http://{stream CF}/hls/kaltura/content/entry/data/0/0/0_lai8bdd1_0_s7ar21ea_2.mp4/seg-1-v1-a1.ts
Any idea?

Ok, Found vod_segments_base_url, that did the trick
Ofer

1 Like

So, just to make certain, are we all good here?

@jess
Yes, Thank you