Versions Compared

Key

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

...

By default, LL HLS playlist size is 12 full segments. Note that LL HLS cut is just started, a full segments quantity in the first playlists will be less than value set.

LL HLS preloader

A special Since build 5.2.1729, a special preloader can be used for LL HLS s as like as for usual HLS.

Code Block
themeRDark
hls_preloader_enabled=true

LL HLS preloader segments are placed by default to the folder

...

Code Block
themeRDark
ll_hls_preloader_dir=/opt/preloader

...

Default LL HLS preloader

...

A custom LL HLS preloader can be set up if necessary. To do this, it is recommended to use a staging WCS server instance, not a production one. Custom preloader should be created as follows

1. Set the following server parameters

consists of the following files, one per each standard video streams aspect ratio

Code Block
themeRDark
hls_preloader_enabled=false
ll_hls_create_preloader=true
hls_auto_start=true

and restart WCS

2. Publish an RTMP stream from OBS to the server using video source with aspect ratio 16:9 and stream key index 

Code Block
themeRDark
rtmp://wcs:1935/live/index

Image Removed

Set Resize output (source size) option for the source

Image Removed

...

16x9.mp4
2x1.mp4
4x3.mp4

If stream aspect ration is unknown, 16:9 preloader file will be used. If there are no preloader files at all, LL HLS stream cut will start without a preloader like

Code Block
themeRDark
ll_hls_custom_preloader_dir=/usr/local/FlashphonerWebCallServer/custom-preloader/created-segments

It is enough to write up to 20 main segments index0.ts - index20.ts 

...

enabled=false

Custom LL HLS preloader setup

A custom LL HLS preloader can be set up if necessary. The media files in three standard aspects 16:9, 4:3 и 2:1 should be prepared according to the following requirements:

  • MP4 container, video codec H264, audio codec AAC
  • the files should allow instant playback (MP4 moov atom must precede mdat one)
  • the files should not containt B frames
  • the file duration should be near 1 minute
  • the file should have a smooth FPS
  • keyframe interval should be near 2 seconds

Suppose a source files are prepared in a proper aspects in OBS Studio or in a video editor. Use the following command example to convert a preloader files to conform the requirements above:

Code Block
languagebash
themeRDark
cd /usr/local/FlashphonerWebCallServer/custom-preloader/created-segments
cp index*.ts /opt/preloader/16x9
rm -rf index*.ts

5. Repeat steps 2-4 using sources with aspect ratios 4:3 and 2:1

6. Restore server settings and set preloader foder as needed

Code Block
themeRDark
ll_hls_preloader_dir=/opt/preloader

...

ffmpeg -i 16x9-source.mp4 -bf 0 -acodec aac -vcodec h264 -preset ultrafast -g 60 -strict -2 -r 30 -ar 48000 -movflags faststart -ss 00:00:00 -t 00:01:00 16x9.mp4

Then the default preloader files should be replaced by custom preloader files, and WCS should be restarted.

To restore default preloader it is enough to remove cyustom preloader files and restart WCS.

m4s container support

Since build 5.2.1626 m4s container is supported for HLS segments cut, and since build 5.2.1632 the container is enabled by default for HLS ABR too

...