Compare commits

..

2 commits

View file

@ -179,6 +179,7 @@ def exec_recorder(stream_id, stream_name, stream_hls_url):
video_output = f'{rec_path}/live/{video_file}' video_output = f'{rec_path}/live/{video_file}'
thumb_output = f'{rec_path}/live/{thumb_file}' thumb_output = f'{rec_path}/live/{thumb_file}'
try:
# Record a mp4 file # Record a mp4 file
ffmpeg = ( ffmpeg = (
FFmpeg() FFmpeg()
@ -191,8 +192,13 @@ def exec_recorder(stream_id, stream_name, stream_hls_url):
def on_progress(progress: Progress): def on_progress(progress: Progress):
print(progress) print(progress)
ffmpeg.execute() ffmpeg.execute()
logger_job.warning(f'Recording {video_file} finished.') logger_job.warning(f'Recording of {video_file} finished.')
except Exception as joberror:
logger_job.error(f'Recording of {video_file} failed!')
logger_job.error(joberror)
else:
# Show Metadata # Show Metadata
ffmpeg_metadata = ( ffmpeg_metadata = (
FFmpeg(executable="ffprobe") FFmpeg(executable="ffprobe")
@ -226,6 +232,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'{video_output}', f'{rec_path}/vod/{video_file}')
os.rename(f'{thumb_output}', f'{rec_path}/thumb/{thumb_file}') os.rename(f'{thumb_output}', f'{rec_path}/thumb/{thumb_file}')
finally:
# Reset the rechead # Reset the rechead
time.sleep(5) time.sleep(5)
rechead = {} rechead = {}