You've already forked my-video-workflow
双GPU支持(BETA)
This commit is contained in:
@ -1,9 +1,8 @@
|
||||
import os.path
|
||||
from datetime import datetime
|
||||
|
||||
from exception.danmaku import DanmakuException
|
||||
from workflow.danmaku import get_file_start, diff_danmaku_files, danmaku_to_subtitle
|
||||
from workflow.video import encode_video_with_subtitles, quick_split_video
|
||||
from workflow.video import multi_gpu_encode_video_with_subtitles, quick_split_video
|
||||
|
||||
|
||||
def do_workflow(video_file, danmaku_base_file, *danmaku_files):
|
||||
@ -11,8 +10,6 @@ def do_workflow(video_file, danmaku_base_file, *danmaku_files):
|
||||
...
|
||||
result = []
|
||||
start_ts = get_file_start(danmaku_base_file)
|
||||
base_start = datetime.fromtimestamp(start_ts)
|
||||
new_file_name = base_start.strftime("%Y%m%d_%H%M.flv")
|
||||
result.append(danmaku_to_subtitle(danmaku_base_file, 0))
|
||||
for danmaku_file in danmaku_files:
|
||||
try:
|
||||
@ -24,10 +21,11 @@ def do_workflow(video_file, danmaku_base_file, *danmaku_files):
|
||||
print("弹幕文件", danmaku_file, "异常")
|
||||
continue
|
||||
print(result)
|
||||
encode_video_with_subtitles(video_file, result, new_file_name)
|
||||
quick_split_video(new_file_name)
|
||||
# clean files
|
||||
file_need_split = multi_gpu_encode_video_with_subtitles(video_file, result, start_ts)
|
||||
for filename in file_need_split:
|
||||
quick_split_video(filename)
|
||||
# clean files
|
||||
os.remove(filename)
|
||||
for file in result:
|
||||
os.remove(file)
|
||||
os.remove(new_file_name)
|
||||
|
||||
|
Reference in New Issue
Block a user