deeme commited on
Commit
9d6ca07
·
verified ·
1 Parent(s): 97ef2df

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +7 -1
  2. app.py +2 -0
Dockerfile CHANGED
@@ -4,10 +4,16 @@ WORKDIR /app
4
 
5
  # 安装FFmpeg
6
  RUN apt-get update && \
7
- apt-get install -y ffmpeg fonts-liberation && \
 
 
 
8
  apt-get clean && \
9
  rm -rf /var/lib/apt/lists/*
10
 
 
 
 
11
  # 安装Python依赖
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
 
4
 
5
  # 安装FFmpeg
6
  RUN apt-get update && \
7
+ apt-get install -y ffmpeg \
8
+ fonts-noto-cjk \
9
+ fonts-noto-color-emoji \
10
+ fontconfig && \
11
  apt-get clean && \
12
  rm -rf /var/lib/apt/lists/*
13
 
14
+ # 刷新字体缓存
15
+ RUN fc-cache -fv
16
+
17
  # 安装Python依赖
18
  COPY requirements.txt .
19
  RUN pip install --no-cache-dir -r requirements.txt
app.py CHANGED
@@ -317,6 +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
  "Fontsize={},"
321
  "Alignment=2,"
322
  "MarginV={},"
@@ -326,6 +327,7 @@ def create_video(project_dir, image_paths, caption_subtitle_file, speech_subtitl
326
  ),
327
  f"subtitles={process_sub_path(speech_subtitle_file)}:"
328
  "force_style='"
 
329
  "Fontsize={},"
330
  "Alignment=8,"
331
  "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={},"