Today I've added a new directive
hls_cleanup toggling HLS fragment and playlist cleanup from nginx cache manager process. By default cleanup is on. Now you can turn it off and have plain MPEG-TS chunked recorder.
application myapp {
live on;
hls on;
hls_path /tmp/hsls;
hls_cleanup off;
}
Work great!
ReplyDeleteThanks.
Hi, great work!
ReplyDeleteIs there any reasonable way to get playlist which plays all "recorded" .ts files? Now I have about million .ts files, and one index.m3u8, which plays few last .ts..
The simplest way is set HLS playlist to a big value like 10 years: hls_playlist_length 10y;
ReplyDeleteOn stream restart old playlist is parsed unless hls_continuous is off. That may take long time
when you have millions of entries.
Thank you for good application.
ReplyDeleteCan put timestamp on segment file? or Can find date time of old segment?
Thank
if I got you right "hls_fragment_naming timestamp;" does what you want
ReplyDeleteThank you, look it work but How to read it?
ReplyDeleteI found fragment file is
live-37043550.ts
#EXTINF:16.367,
live-38417490.ts
#EXTINF:15.967,
live-39890520.ts
I'm sorry for ask, but I try to convert digit to unix date/time but it not correct.
Now this time date on server is "Wed Jun 12 00:42:47 ICT 2013"
Thank
These are incoming timestamps. If you want your system timestamps then use "hls_fragment_naming system".
ReplyDeleteThank you very much.
ReplyDeleteI'm try convert digit in fragment file to date time.
ReplyDeleteBut not success, Can you tell me what method convert fragments time?
This is my fragments list.
live-911572788.ts live-920955885.ts live-930456268.ts live-939865827.ts
live-911588713.ts live-920971650.ts live-930474137.ts live-939884294.ts
Thank you very much.
It should be unixtime in milliseconds. However there might be 32-bit overflow if you have 32-bit system. What is your system?
ReplyDeleteMy system is Ubuntu 32bit.
ReplyDeleteOk now I try on 64 bit it work. Thank you very much.
ReplyDeleteFixed that in master. Please try again on 32- bit system. Thanks for the report.
ReplyDeleteThank you. I will test on 32-bit again.
ReplyDeleteBut fragments file will be delete (clean) after restart?
I found after restart machine, all fragments will be deleted.
my config.
application live {
live on;
hls on;
hls_path /tmp/live;
hls_fragment 15s;
hls_fragment_naming system;
hls_cleanup off;
hls_playlist_length 3d;
allow play all;
}
Fragments are deleted when expired.
ReplyDeleteI think in my confic will keep frangments 3 days.
ReplyDeleteBut after i restart server all frangments will be lost. No any frangments in /tmp.
This is happening because the /tmp file system is cleaned at reboot ...
ReplyDeletehls fragmented files deleted after a while i upload them to the server!
ReplyDeletehere is my hls config:
# Define the Application
application show {
live on;
# Turn on HLS
hls on;
hls_path /mnt/hls/;
hls_cleanup off;
hls_playlist_length 10y;
hls_fragment 3;
......
Any Idea!TNX.