This is a script to run Apple's HLS Low Latency Beta Tool with Docker containers.
- You need Docker Desktop for Mac to be installed on your machine.
- You need HLS Low Latency Beta Tool to be installed on your machine.
- You need a high spec Mac since the tool encodes a full HD video. (I had a performance problem with MacBook Pro with 2 Core but it works fine with MacBook Pro with 4 Core.)
- You need macOS Mojave or later.
- You need iOS 13 Beta or iPadOS 13 Beta to be installed on a device.
- You need Xcode 11 Beta to be installed on your machine.
- Your machine and device need to be on the same network.
You can create a self signed certificate with:
$ ./init.sh
You can start running the HLS Low Latency Beta Tool and local Nginx with:
$ ./run.sh start
You can verify it with:
$ curl https://localhost/master.m3u8 --cacert ./webroot/server.crt
You can stop it with:
$ ./run.sh stop
Get your IP address on your machine.
$ ipconfig getifaddr en0
192.168.3.2
Change DNS server setting to use the IP address above on your device.
This article may be helpful to know how to do it.
You need to delete default DNS servers and include only IP address of your machine.
- Open safari and browse to http://streaming.example.com/server.crt. Safari will prompt you to install the SSL certificate.
- Open the Settings.app and navigate to General > About > Certificate Trust Settings, and find the streaming.example.com certificate, and switch it on to enable full trust for it
There are several HLS player samples. I usually use this one.
Follow the instructions on README.md in HLS Low Latency Beta Tool to add the entitlement to your app.
Point your player at https://streaming.example.com/master.m3u8. If you use this sample app, you can do this by adding the URL to Streams.plist.
You can check the access log with:
docker-compose logs -f
This should help you to understand how Low Latency HLS works.
If you have your own trusted certificate and key with your domain, you can use it. Just replace webroot/server.crt and webroot/server.key with your certificate and key, and replace streaming.example.com with your FQDN.
I coudn't manage to use Charles with the self signed certificate that my init.sh creates. However, it works with a trusted certificate.
It is interesting to change values of target duration
and partial target duration
. You can do this with replacing PART_TARGET_DURATION
and TARGET_DURATION
on run.sh.
If you want to use capture input instead of the default sample video, you can do it by adding -c
to COMPRESSOR_COMMAND in run.sh
You can see more detail of usage with:
$ tsrecompressor --help