|
@@ -191,12 +191,13 @@ class AGC():
|
|
|
def zn_concatenate_videos(cls, videos, audio_duration, audio_video, platform, s_path, mark, v_oss_path):
|
|
|
text_ptah = cls.bk_text_folders(mark)
|
|
|
video_files = cls.concat_videos_with_subtitles(videos, audio_duration, platform, mark)
|
|
|
+ if video_files == "":
|
|
|
+ return ""
|
|
|
with open(text_ptah, 'w') as f:
|
|
|
for file in video_files:
|
|
|
f.write(f"file '{file}'\n")
|
|
|
Common.logger("video").info(f"{mark}的{platform}视频文件:{video_files}")
|
|
|
- if video_files == "":
|
|
|
- return ""
|
|
|
+
|
|
|
print(f"{mark}的{platform}:开始拼接视频喽~~~")
|
|
|
Common.logger("video").info(f"{mark}的{platform}:开始拼接视频喽~~~")
|
|
|
if os.path.exists(s_path):
|
|
@@ -363,11 +364,13 @@ class AGC():
|
|
|
data_list, videos = Material.get_all_data(feishu_id, video_call, mark)
|
|
|
list_data = cls.get_unique_uid_data(data_list, int(video_count))
|
|
|
count = 0
|
|
|
+ pj_count = 0
|
|
|
while True:
|
|
|
# 清空所有文件
|
|
|
cls.clear_mp4_files(mark)
|
|
|
s_path, v_path, video_path_url, v_oss_path = cls.create_folders(mark)
|
|
|
-
|
|
|
+ if pj_count == 10:
|
|
|
+ Feishu.bot('recommend', 'AGC拼接画面不足通知', f'视频画面不足,请即使补充!!', mark, mark_name)
|
|
|
if count == len(list_data):
|
|
|
break
|
|
|
# for d_list in list_data:
|
|
@@ -408,7 +411,6 @@ class AGC():
|
|
|
# 清空所有mp4数据
|
|
|
cls.clear_mp4_files(mark)
|
|
|
Feishu.bot('recommend', 'AGC异常通知', f'{platform}任务下,{uid}音频格式填写该任务跳过,请关注', mark, mark_name)
|
|
|
-
|
|
|
continue
|
|
|
if platform != "常规":
|
|
|
if platform == "爆款":
|
|
@@ -441,6 +443,7 @@ class AGC():
|
|
|
video_files = cls.zw_concatenate_videos(videos, audio_duration, audio_video, platform, s_path, v_path,
|
|
|
mark, v_oss_path)
|
|
|
if video_files == "":
|
|
|
+ pj_count += 1
|
|
|
Common.logger("video").info(f"{mark}的{platform}渠道使用拼接视频为空")
|
|
|
continue
|
|
|
if os.path.isfile(v_oss_path):
|
|
@@ -449,6 +452,7 @@ class AGC():
|
|
|
Common.logger("video").info(f"{mark}的{platform}渠道新视频生成失败")
|
|
|
continue
|
|
|
# 随机生成视频oss_id
|
|
|
+ pj_count = 0
|
|
|
oss_id = cls.random_id()
|
|
|
Common.logger("video").info(f"{mark}的{platform}渠道上传到 OSS 生成视频id为:{oss_id}")
|
|
|
oss_object_key = Oss.stitching_sync_upload_oss(v_oss_path, oss_id)
|