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 · 5 comments
xxxman2008 commented
winlinvip commented
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:
- Files can be cleaned after a certain period of time when the RTMP stream stops.
- When the server stops.
TRANS_BY_GPT3
winlinvip commented
# 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
winlinvip commented
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
winlinvip commented
Already resolved. Restart and clean up HLS when there is no flow timeout.
TRANS_BY_GPT3
xiayongtao commented