~~~

srt_path = srt_path.replace('\\', '\\\\').replace(':', '\:')

# video+srt+硬字幕,默认字体和颜色

# cmd_mp4_srt = f"{FFMPEG_PATH} -i {third_video_path} -vf subtitles='{srt_path}' {four_srt_path} -loglevel quiet -y"

# 设置字幕字体大小和颜色

# https://stackoverflow.com/questions/21363334/how-to-add-font-size-in-subtitles-in-ffmpeg-video-filter

ffmpeg_font_size = f"subtitles={srt_path}:force_style='Fontsize={sub_title_font_size},PrimaryColour=&Hffffff&'"

cmd_mp4_srt = f'{FFMPEG_PATH} -i {third_video_path} -vf "{ffmpeg_font_size}" {four_srt_path} -loglevel quiet -y'

my_print(f"video+srt+硬字幕:{cmd_mp4_srt}")

ffmpeg_code = subprocess.call(cmd_mp4_srt, shell=True)

my_print(f"视频和硬字幕文件合并状态,ffmpeg_code:{ffmpeg_code}")

my_print(f"4:视频字幕合并的路径:{four_srt_path}")

~~~