|
@@ -18,14 +18,16 @@ sleep_time = 30 # 每多少秒扫描一次
|
|
|
|
|
|
def parse_to_mp4(merged_bag_file_path, parse_prefix1, local_parse_dir2, local_delete_list3):
|
|
def parse_to_mp4(merged_bag_file_path, parse_prefix1, local_parse_dir2, local_delete_list3):
|
|
try:
|
|
try:
|
|
- flag,local_mp4_dir = parse_robot_image.parse(merged_bag_file_path,local_parse_dir2 + '/camera/')
|
|
|
|
- if flag: # 没有话题就不生成视频了
|
|
|
|
|
|
+ flag, local_mp4_dir = parse_robot_image.parse(merged_bag_file_path, local_parse_dir2 + '/camera/')
|
|
|
|
+ if flag: # 没有话题就不生成视频了
|
|
mp4_file_name = 'camera'
|
|
mp4_file_name = 'camera'
|
|
local_mp4_file_path1 = local_mp4_dir + '/' + mp4_file_name + '.mp4'
|
|
local_mp4_file_path1 = local_mp4_dir + '/' + mp4_file_name + '.mp4'
|
|
local_delete_list3.append(local_mp4_file_path1)
|
|
local_delete_list3.append(local_mp4_file_path1)
|
|
oss_csv_object_key1 = parse_prefix1 + mp4_file_name + '.mp4'
|
|
oss_csv_object_key1 = parse_prefix1 + mp4_file_name + '.mp4'
|
|
bucket.put_object_from_file(oss_csv_object_key1, local_mp4_file_path1)
|
|
bucket.put_object_from_file(oss_csv_object_key1, local_mp4_file_path1)
|
|
|
|
+ local_delete_list.append(local_merged_bag_path)
|
|
else:
|
|
else:
|
|
|
|
+ # 有图像话题,解析完就删除,没有则不删除
|
|
logging.info("没有图像话题: %s", merged_bag_file_path)
|
|
logging.info("没有图像话题: %s", merged_bag_file_path)
|
|
except Exception as e2:
|
|
except Exception as e2:
|
|
logging.exception("生成摄像头视频报错: %s", e2)
|
|
logging.exception("生成摄像头视频报错: %s", e2)
|
|
@@ -82,7 +84,6 @@ if __name__ == '__main__':
|
|
except Exception as e:
|
|
except Exception as e:
|
|
logging.exception("下载合并后的bag包失败: %s" % str(e))
|
|
logging.exception("下载合并后的bag包失败: %s" % str(e))
|
|
|
|
|
|
- local_delete_list.append(local_merged_bag_path)
|
|
|
|
# 2 生成 pos_orig.csv 和 pos_hmi.csv
|
|
# 2 生成 pos_orig.csv 和 pos_hmi.csv
|
|
logging.info("生成视频: %s" % str(obj1.key))
|
|
logging.info("生成视频: %s" % str(obj1.key))
|
|
parse_to_mp4(local_merged_bag_path, parse_prefix_full, local_parse_dir, local_delete_list)
|
|
parse_to_mp4(local_merged_bag_path, parse_prefix_full, local_parse_dir, local_delete_list)
|