ossrs / srs

SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181.

Home Page:https://ossrs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

After the RTMP streaming of the video source stops, can the corresponding HLS files m3u8 and ts be cleaned up? #209

xxxman2008 opened this issue · comments

The cessation of RTMP streams does not necessarily mean the termination of the service. However, there are two situations in which cleaning can be done:

  1. Files can be cleaned after a certain period of time when the RTMP stream stops.
  2. When the server stops.

TRANS_BY_GPT3

        # the timeout in seconds to dispose the hls,
        # dispose is to remove all hls files, m3u8 and ts files.
        # when timeout or server terminate, dispose hls.
        # default: 300
        hls_dispose     300;

Add a new option to set the timeout for HLS, with a default value of 5 minutes. If there is no stream for 5 minutes, all existing HLS files will be cleared.

TRANS_BY_GPT3

When the server stops, clean up HLS segments.

winlin:srs winlin$ ll objs/nginx/html/live/livestream
total 1784
-rw-r--r--  1 winlin  staff  576784 May 30 13:38 1432964311500.ts
-rw-r--r--  1 winlin  staff  330880 May 30 13:38 1432964326198.ts.tmp
-rw-r--r--  1 winlin  staff     159 May 30 13:38 live.m3u8
winlin:srs winlin$ time ./etc/init.d/srs stop
Stopping SRS(pid 13213)...                                 [  OK  ]
SRS stopped by SIGTERM                                     [  OK  ]


real    0m0.470s
user    0m0.035s
sys 0m0.049s
winlin:srs winlin$ ll objs/nginx/html/live/livestream
winlin:srs winlin$ 

TRANS_BY_GPT3

Already resolved. Restart and clean up HLS when there is no flow timeout.

TRANS_BY_GPT3

Which version of the code added the mechanism to delete HLS? I downloaded the develop code and restarted, but it still doesn't work. The configuration should be correct, right?
image

TRANS_BY_GPT3