nginx-rtmp-module icon indicating copy to clipboard operation
nginx-rtmp-module copied to clipboard

Timeshifting in HLS ?

Open velsa opened this issue 12 years ago • 9 comments

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 !

velsa avatar Jun 20 '13 18:06 velsa

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.

arut avatar Jun 20 '13 18:06 arut

@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?

sureshpeter avatar Feb 08 '14 12:02 sureshpeter

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.

Samzom avatar Jul 07 '15 11:07 Samzom

Has anyone got the answer as arut stated as I am looking to do this too

ibizawold avatar Sep 26 '16 23:09 ibizawold

i'm looking the same

vigikaran avatar Nov 14 '16 10:11 vigikaran

same question

oeddyo avatar Feb 14 '17 08:02 oeddyo

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;
            }

oeddyo avatar Feb 14 '17 08:02 oeddyo

any one having luck with nginx rtmp timeshifting? I am not sure which is the best forked project on this?

xtendtech avatar Dec 14 '19 11:12 xtendtech

Need to know as well

Krautmaster avatar Jul 05 '22 20:07 Krautmaster