How to enable LHLS in FFMPEG 4.1?

I know this thread is 18 months old, but I have been using it to experiment with -lhls support in ffmpeg. I have set up a test harness using @medhi.r post as a roadmap, but I am not seeing the EXT-X-PREFETCH in my manifest (as he mentions he resolved above).

I have tried to duplicate as many as the applicable settings, but still not seeing the extra entry.

I don't really have an answer, but thought others might be investigating this and wanted to post on one of the only threads that helped me get as far as I have.

Here is my argument list to ffmpeg (which I built from a fresh pull from git this morning):

ffmpeg -r 25 -re -i pipe:0 -y -an -vcodec copy \
-seg_duration 3 -window_size 5  -init_seg_name init.m4s \
-media_seg_name '$Time$-$Number$.m4s'  \
-strict experimental -streaming 1 -hls_playlist 1 -tune zerolatency -lhls 1 -master_m3u8_publish_rate 3 \
-f dash -method PUT -http_persistent 1  http://192.168.xx.xx:yyyy/camera/manifest.mpd

I was hoping to use lhls to drive the latency down to below 2 seconds or so, but I am not really seeing any reduction in latency, which is consistently around 12-15 seconds. I am using this to pipe the video from the system camera.


In the current implementation the lhls option doesn't work with file output. It'll work if you use another protocol like HTTP:

-f dash -method PUT http://example.com/live/manifest.mpd

See dash_write_packet in dashenc.c:

int use_rename = proto && !strcmp(proto, "file");
...
if (c->lhls) {
    char *prefetch_url = use_rename ? NULL : os->filename;
    write_hls_media_playlist(os, s, pkt->stream_index, 0, prefetch_url);
}