Spaces:
No application file
No application file
File size: 1,606 Bytes
6755a2d |
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 47 48 49 50 51 52 53 54 |
from .. import VideoMapSeq, VideoMetaInfo, VideoMap
def load_video_map(
video_map_paths,
video_paths,
emb_paths,
start: float = None,
end: None = None,
target_width_height_ratio: float = None,
target_width: float = None,
target_height: float = None,
**kwargs,
):
"""读取视频谱面,转化成VideoInfo。当 videoinfo_path_lst 为列表时,表示多歌曲
Args:
videoinfo_path_lst (str or [str]): 视频谱面路径文件列表
video_path_lst (str or [str]): 视频文件路径文件列表,须与videoinfo_path_lst等长度
target_width_height_ratio (float): 目标视频宽高比
target_width (int): 目标视频宽
target_height (int): 目标视频高
Returns:
VideoInfo: 视频谱面信息
"""
dct = {
"start": start,
"end": end,
"target_width_height_ratio": target_width_height_ratio,
"target_width": target_width,
"target_height": target_height,
}
if isinstance(video_map_paths, list):
video_map = VideoMapSeq.from_json_paths(
media_map_class=VideoMap,
media_paths=video_paths,
media_map_paths=video_map_paths,
emb_paths=emb_paths,
**dct,
**kwargs,
)
if len(video_map) == 1:
video_map = video_map[0]
else:
video_map = VideoMap.from_json_path(
path=video_map_paths,
emb_path=emb_paths,
media_path=video_paths,
**dct,
**kwargs,
)
return video_map
|