Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLS: TS slices that have been generated should not be cleared when the server exits or restarts. #865

Closed
wuxianlijiang opened this issue Apr 30, 2017 · 5 comments
Assignees
Labels
Bug It might be a bug. TransByAI Translated by AI/GPT.
Milestone

Comments

@wuxianlijiang
Copy link

wuxianlijiang commented Apr 30, 2017

Version: 2.0.239 Release
Environment: CentOS 6
Configuration:

vhost dvr.host.com{
    hls {
        enabled         on;
        hls_path        /home/video/rec/live;
		hls_ts_file   [stream]/[stream]-[seq].ts;
		hls_m3u8_file  [stream].m3u8;
		hls_fragment    10;
		hls_window      86400;
		#hls_window      60;
		hls_wait_keyframe       on;
		hls_dispose     0;
		hls_cleanup     off;
    }
}

Situation: After restarting the SRS service, the previously recorded m3u8 and ts files are cleared, leaving only an empty ts directory.
Expectation: Whether stopping the stream or restarting SRS, the recorded data should not be cleared. Thank you!

TRANS_BY_GPT3

@wuxianlijiang
Copy link
Author

wuxianlijiang commented May 1, 2017

Reproduction of the situation:

  1. Use Adobe Flash Media Live Encoder (or other encoders) to stream.
    url: rtmp://domain.com/live stream:live0501AM
    Later, you can find live0501AM.m3u8 and the live0501AM folder with ts files inside at /home/video/rec/live.

  2. Attempting to stop and disconnect the live streaming will not delete the files generated above.

  3. Enter service srs restart in the shell,
    you can see that the m3u8 files generated in the above directory have been cleared, and the ts files under live0501AM have also been cleared.

  4. If you terminate the service with killall srs, the situation will be the same as in step 3.

TRANS_BY_GPT3

@winlinvip winlinvip changed the title hls功能希望能够添加不清除已生成数据的参数 HLS: 服务器退出或重启时不应该清除已生成TS切片 May 1, 2017
@winlinvip
Copy link
Member

winlinvip commented May 1, 2017

Already reproduced:

[2017-05-01 16:28:12.156][trace][22819][104] user terminate program, gracefully quit.
[2017-05-01 16:28:13.029][trace][22819][100] cleanup for gracefully terminate.
[2017-05-01 16:28:13.029][warn][22819][100][35] main cycle terminated, system quit normally.
[2017-05-01 16:28:13.031][trace][22819][100] gracefully dispose hls /live/livestream
[2017-05-01 16:28:13.031][trace][22819][100] srs terminated

It should be that Dispose was not disabled, resulting in cleanup.

TRANS_BY_GPT3

@winlinvip winlinvip added the Bug It might be a bug. label May 1, 2017
@winlinvip winlinvip added this to the srs 2.0 release milestone May 1, 2017
@winlinvip
Copy link
Member

winlinvip commented May 1, 2017

When killall srs or /etc/init.d/srs stop or /etc/init.d/srs restart is executed, it will attempt to clean the Server. At this time, it will unpublish the stream, clean temporary files, and then clean HLS (which means deleting all TS files).

In reality, only when hls_dispose is not 0, which means cleaning is enabled, can all TS files be cleaned.

TRANS_BY_GPT3

@winlinvip winlinvip self-assigned this Sep 17, 2021
@yipeng2001
Copy link

yipeng2001 commented Feb 14, 2023

hls_dispose' is set to 0, but after restarting, the ts files are still cleared.

TRANS_BY_GPT3

@yipeng2001
Copy link

yipeng2001 commented Feb 14, 2023

Set 'hls_cleanup' to 'off'; even after restarting, the 'ts' files are still being cleaned up.

TRANS_BY_GPT3

@winlinvip winlinvip changed the title HLS: 服务器退出或重启时不应该清除已生成TS切片 HLS: TS slices that have been generated should not be cleared when the server exits or restarts. Jul 28, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug It might be a bug. TransByAI Translated by AI/GPT.
Projects
None yet
Development

No branches or pull requests

3 participants