提交 72c41114 authored 作者: zw.wang's avatar zw.wang

fix: 无回放时间时

上级 97d735cd
...@@ -119,19 +119,19 @@ class StreamRecorder: ...@@ -119,19 +119,19 @@ class StreamRecorder:
HikVisionClient.iso_format(end_time) HikVisionClient.iso_format(end_time)
) )
log.info('playback: %s', playback_urls) log.info('playback: %s', playback_urls)
file_name = os.path.join(video_path, 'rtmp_{}_{}.mp4'.format(
start_time.astimezone(pytz.utc).strftime('%Y%m%dT%H%M%S'),
end_time.astimezone(pytz.utc).strftime('%Y%m%dT%H%M%S')
))
if len(playback_urls) > 0: if len(playback_urls) > 0:
# 可以只通过一个回放流地址取到其他时间段的流 # 可以只通过一个回放流地址取到其他时间段的流
playback_stream = playback_urls[0] playback_stream = playback_urls[0]
else: else:
return return {'file_name': file_name, 'is_completed': False, 'recovered_time': start_time}
part_num = retry_count = 0 part_num = retry_count = 0
is_completed = False is_completed = False
part_files_set = set() part_files_set = set()
file_name = os.path.join(video_path, 'rtmp_{}_{}.mp4'.format(
start_time.astimezone(pytz.utc).strftime('%Y%m%dT%H%M%S'),
end_time.astimezone(pytz.utc).strftime('%Y%m%dT%H%M%S')
))
while retry_count < 6: while retry_count < 6:
# 重试六次 # 重试六次
retry_count += 1 retry_count += 1
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论