From 01d611c2271fc19fc6832d429c9ab17adce8e921 Mon Sep 17 00:00:00 2001 From: ThisBirchWood Date: Wed, 12 Feb 2025 13:45:56 +0000 Subject: [PATCH] PATCH: Fixed saved vods not saving in correct order, HLS segments save by system timestamp --- nginx/nginx.conf | 2 +- web_server/celery_tasks/__init__.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 020a04c..10a3b76 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -32,7 +32,7 @@ rtmp { hls_nested on; hls_fragment 5s; hls_playlist_length 60s; - hls_fragment_naming timestamp; + hls_fragment_naming system; hls_cleanup off; } } diff --git a/web_server/celery_tasks/__init__.py b/web_server/celery_tasks/__init__.py index 5a85441..1e6ae2c 100644 --- a/web_server/celery_tasks/__init__.py +++ b/web_server/celery_tasks/__init__.py @@ -34,6 +34,7 @@ def combine_ts_stream(stream_path, vods_path): """ ts_files = [f for f in listdir(stream_path) if f.endswith(".ts")] ts_files.sort() + print(ts_files) # Create temp file listing all ts files with open(f"{stream_path}/list.txt", "w") as f: @@ -61,3 +62,5 @@ def combine_ts_stream(stream_path, vods_path): # Remove ts files for ts_file in ts_files: remove(f"{stream_path}/{ts_file}") + # Remove m3u8 file + remove(f"{stream_path}/index.m3u8") \ No newline at end of file