recorder should reset the rechead even with failed recordings

This commit is contained in:
deflax 2024-06-24 11:11:40 +00:00
parent eec8482df3
commit b421cb3e32

View file

@ -179,6 +179,7 @@ def exec_recorder(stream_id, stream_name, stream_hls_url):
video_output = f'{rec_path}/live/{video_file}'
thumb_output = f'{rec_path}/live/{thumb_file}'
try:
# Record a mp4 file
ffmpeg = (
FFmpeg()
@ -226,6 +227,7 @@ def exec_recorder(stream_id, stream_name, stream_hls_url):
os.rename(f'{video_output}', f'{rec_path}/vod/{video_file}')
os.rename(f'{thumb_output}', f'{rec_path}/thumb/{thumb_file}')
finally:
# Reset the rechead
time.sleep(5)
rechead = {}