nginx-rtmp-module
nginx-rtmp-module copied to clipboard
Timeshifting in HLS ?
I have created the following config for hls in application 'live':
hls on;
hls_path /hls;
hls_fragment 10s;
hls_playlist_length 18h;
hls_sync 100ms;
hls_fragment_naming system;
hls_continuous on;
hls_nested on;
pull rtmp://localhost:1935/live/test.stream name=test.stream live=1 static;
Now the index.m3u8 contains timestamp-named chunks and plays fine. My question is - is it possible to create a timeshifted version of the index.m3u8, which would play the stream shifted back in time ?
One idea is to implement it as an hls option, e.g.:
hls_timeshift_index name=index_5.m3u8 timeshift=5h;
hls_timeshift_index name=index_3.m3u8 timeshift=3h;
Another is to implement it as an argument in HTTP request (is it possible ?):
http://server/live/test.stream/index.m3u8?timeshift=5h
Thanks !
It's not possible as url argument (fragments are the same for all clients). Bit it's possible as a config setting.
However I don't see any reason for this feature. You can do it yourself in ngx_rtmp_hls_module.c, it's simple.
@velsa have you managed to modify the code to achieve what you wanted. I am also looking for a similar feature. I am not a native c programmer so I am struggling a bit to get this done.
@arut the .ts files are not cleaned up, it is keep growing. any idea how to clean the old file?
is there a method to so that can we set it to keep last X hours of files and delete all other old ones?
Anyone who can help me with this as well? I'm trying to achieve the same thing, arut said something about ngx_rtmp_hls_module.c. And that it's simple anyone who can provide help? Would be much appreciated.
Has anyone got the answer as arut stated as I am looking to do this too
i'm looking the same
same question
Here's my setting, but it doesn't really play from the beginning:
application hls {
live on;
hls on;
hls_fragment_naming system;
hls_fragment_slicing aligned;
hls_path /var/hls;
hls_nested on;
hls_continuous on;
hls_type event;
hls_fragment 2s;
hls_cleanup off;
hls_playlist_length 10m;
}
any one having luck with nginx rtmp timeshifting? I am not sure which is the best forked project on this?
Need to know as well