Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When first HLS subscribes connects to a stream on WCS server, especilally to CDN stream, it may take a time to split a stream to HLS segmets and to form a playlist. As a result, Safari browser on iOS devices may not be able to play HLS stream on the first attempt. To successfully play HLS stream in this case, the HLS preloader was added since build 5.2.371. The default preloader looks like this:

Preloader Default preloader segments are placed to /usr/local/FlashphonerWebCallserver/hls/.preloader folder when server is started

Code Block
themeRDark
ls /usr/local/FlashphonerWebCallserver/hls/.preloader
-rw-r--r-- 1 root root 51888 Oct 13 04:47 index0.ts
-rw-r--r-- 1 root root 52828 Oct 13 04:47 index10.ts
-rw-r--r-- 1 root root 54332 Oct 13 04:47 index11.ts
-rw-r--r-- 1 root root 53392 Oct 13 04:47 index12.ts
-rw-r--r-- 1 root root 52828 Oct 13 04:47 index13.ts
-rw-r--r-- 1 root root 52828 Oct 13 04:47 index14.ts
-rw-r--r-- 1 root root 53956 Oct 13 04:47 index15.ts
-rw-r--r-- 1 root root 54144 Oct 13 04:47 index16.ts
-rw-r--r-- 1 root root 52828 Oct 13 04:47 index17.ts
-rw-r--r-- 1 root root 52640 Oct 13 04:47 index18.ts
-rw-r--r-- 1 root root 53580 Oct 13 04:47 index19.ts
-rw-r--r-- 1 root root 52828 Oct 13 04:47 index1.ts
-rw-r--r-- 1 root root 53580 Oct 13 04:47 index2.ts
-rw-r--r-- 1 root root 54520 Oct 13 04:47 index3.ts
-rw-r--r-- 1 root root 52452 Oct 13 04:47 index4.ts
-rw-r--r-- 1 root root 52640 Oct 13 04:47 index5.ts
-rw-r--r-- 1 root root 53204 Oct 13 04:47 index6.ts
-rw-r--r-- 1 root root 54708 Oct 13 04:47 index7.ts
-rw-r--r-- 1 root root 52828 Oct 13 04:47 index8.ts
-rw-r--r-- 1 root root 52828 Oct 13 04:47 index9.ts

The default preloader can be replaced to custom one. To do thisminimal preloader segment duration is 2 seconds by default, and can be set in milliseconds with the following parameter

Code Block
themeRDark
hls_preloader_time_min=2000

Custom preloader configuration

To replace the default preloader to thecustom one, do the following:

1. Choose video clip (logo for example)

...

4. Prepare custom preloader HLS segments , one segment duration shoild be 2 with desired duration, for example 2 seconds

Code Block
languagebash
themeRDark
mediafilesegmenter -t 2 -B index -start-segments-with-iframe preloader.mp4
tar -cvzf preloader.tar.gz index*.ts

5. On WCS server, save default preloader backup copyMake a folder for custom preloader

Code Block
languagebash
themeRDark
cdmkdir /usr/local/FlashphonerWebCallserver/hls
tar -cvzf ~/preloader_backup.tar.gz .opt/custom_preloader

6. Unpack custom preloader segments from archive prepared on step 4

Code Block
languagebash
themeRDark
cd /usr/local/FlashphonerWebCallserver/hls/.preloader
rm -f index*.ts
opt/custom_preloader
tar -xvzf ~/preloader.tar.gz

7. Set custom preloader folder and duration in server settings

Code Block
themeRDark
hls_preloader_time_min=2000
hls_preloader_dir=/opt/custom_preloader

Known limits

A preloader aspect ratio should be the same as video published one. Otherwise, browser tries to scale video to preloader ratio, that can lead to picture distortion (stretching or compressing) for the first HLS subscriber.

Debug logs for HLS session

For an error report, debug logging can be enabled for HLS sessions using CLI

...