-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewpick_render.py
46 lines (38 loc) · 1.28 KB
/
viewpick_render.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import logging
import os
import threading
from webdriver_manager.chrome import ChromeDriverManager
from all_create import AllVideo
from program_function import convert_csv , extract_single_column , check_env
from render_video_wvc import render_video
# 声明变量
from config import *
# 日志记录
logging.basicConfig(format='[%(levelname)s]\t%(message)s',filename="log/" + time.strftime("%Y-%m-%d %H-%M-%S") + '.log', level=logging.INFO)
formatter = logging.Formatter('[%(levelname)s]\t%(message)s')
console_handler = logging.StreamHandler()
console_handler.setFormatter(formatter)
console_handler.setLevel('INFO')
logger = logging.getLogger()
logger.addHandler(console_handler)
check_env()
# 获取数据
ranked_list = convert_csv("data/viewpicked.csv")
# 段落合成
render_times = 0
rend_q = []
for viding in ranked_list:
render_times += 1
if os.path.exists(f"./output/clip/ViewRank_{render_times}.mp4"):
continue
# 正常渲染。
url = f"{render_prefix}/viewpick"
viding.update({ "output_src": f"./output/clip/ViewRank_{render_times}.mp4" , "url": url })
muitl_limit.acquire()
rend_s = threading.Thread(target=render_video,args=(viding,url))
rend_s.start()
rend_q.append(rend_s)
# render_video(viding,url)
for sq in rend_q:
sq.join()
# 总拼接