Upload 2 files
Browse files- Dockerfile +1 -11
- app.py +2 -2
Dockerfile
CHANGED
|
@@ -5,20 +5,10 @@ WORKDIR /app
|
|
| 5 |
# 安装FFmpeg
|
| 6 |
RUN apt-get update && \
|
| 7 |
apt-get install -y ffmpeg \
|
| 8 |
-
|
| 9 |
apt-get clean && \
|
| 10 |
rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
-
# 创建字体目录
|
| 13 |
-
RUN mkdir -p /usr/share/fonts/windows
|
| 14 |
-
|
| 15 |
-
# 复制宋体文件到镜像中
|
| 16 |
-
COPY ./fonts/simsun.ttc /usr/share/fonts/windows/
|
| 17 |
-
|
| 18 |
-
# 设置字体权限并更新字体缓存
|
| 19 |
-
RUN chmod 644 /usr/share/fonts/windows/*.tt* && \
|
| 20 |
-
fc-cache -fv
|
| 21 |
-
|
| 22 |
# 安装Python依赖
|
| 23 |
COPY requirements.txt .
|
| 24 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 5 |
# 安装FFmpeg
|
| 6 |
RUN apt-get update && \
|
| 7 |
apt-get install -y ffmpeg \
|
| 8 |
+
fonts-noto-cjk && \
|
| 9 |
apt-get clean && \
|
| 10 |
rm -rf /var/lib/apt/lists/*
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
# 安装Python依赖
|
| 13 |
COPY requirements.txt .
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
app.py
CHANGED
|
@@ -317,7 +317,7 @@ def create_video(project_dir, image_paths, caption_subtitle_file, speech_subtitl
|
|
| 317 |
combined_filter = (
|
| 318 |
f"subtitles={process_sub_path(caption_subtitle_file)}:"
|
| 319 |
"force_style='"
|
| 320 |
-
"FontName=
|
| 321 |
"Fontsize={},"
|
| 322 |
"Alignment=2,"
|
| 323 |
"MarginV={},"
|
|
@@ -327,7 +327,7 @@ def create_video(project_dir, image_paths, caption_subtitle_file, speech_subtitl
|
|
| 327 |
),
|
| 328 |
f"subtitles={process_sub_path(speech_subtitle_file)}:"
|
| 329 |
"force_style='"
|
| 330 |
-
"FontName=
|
| 331 |
"Fontsize={},"
|
| 332 |
"Alignment=8,"
|
| 333 |
"MarginV={},"
|
|
|
|
| 317 |
combined_filter = (
|
| 318 |
f"subtitles={process_sub_path(caption_subtitle_file)}:"
|
| 319 |
"force_style='"
|
| 320 |
+
"FontName=Noto Sans CJK SC,"
|
| 321 |
"Fontsize={},"
|
| 322 |
"Alignment=2,"
|
| 323 |
"MarginV={},"
|
|
|
|
| 327 |
),
|
| 328 |
f"subtitles={process_sub_path(speech_subtitle_file)}:"
|
| 329 |
"force_style='"
|
| 330 |
+
"FontName=Noto Sans CJK SC,"
|
| 331 |
"Fontsize={},"
|
| 332 |
"Alignment=8,"
|
| 333 |
"MarginV={},"
|