Skip to content

隐藏控制台窗口#1103

Open
hjkl950217 wants to merge 2 commits into
WEIFENG2333:masterfrom
hjkl950217:master
Open

隐藏控制台窗口#1103
hjkl950217 wants to merge 2 commits into
WEIFENG2333:masterfrom
hjkl950217:master

Conversation

@hjkl950217

Copy link
Copy Markdown

现在pip安装的gui版本,在运行时会弹出来ffmpeg的控制台窗口,让AI改了下代码,隐藏了控制台

hjkl950217 and others added 2 commits May 5, 2026 13:38
- 新增 get_subprocess_kwargs() 统一封装 Windows 静默启动参数(CREATE_NO_WINDOW + SW_HIDE)
- 重构 ffmpeg/7z/ASR 等子进程调用,统一使用 get_subprocess_kwargs()
- 解决了 GUI 版本执行任务时弹出控制台窗口的问题

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 5, 2026 05:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

这个 PR 的目的是在 GUI 版本中统一隐藏外部子进程启动时弹出的 Windows 控制台窗口,减少 ffmpeg / ASR / 解压工具运行时对用户体验的干扰。它通过把分散的 creationflags 逻辑收敛到公共工具函数中,使相关模块的子进程启动参数更一致。

Changes:

  • platform_utils 中扩展 get_subprocess_kwargs(),统一封装 Windows 下隐藏控制台窗口的子进程参数。
  • 将多个 ffmpeg / whisper / 7z 调用点从内联 creationflags 改为复用公共 helper。
  • 让字幕渲染、音频提取、ASR 执行和解压流程的子进程启动行为保持一致。

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
videocaptioner/ui/components/FasterWhisperSettingWidget.py 将 7z 解压进程切换为复用公共子进程参数。
videocaptioner/core/utils/video_utils.py 统一 ffmpeg 调用的隐藏窗口参数。
videocaptioner/core/utils/platform_utils.py 扩展公共 subprocess helper,集中处理 Windows 隐藏窗口逻辑。
videocaptioner/core/subtitle/rounded_renderer.py 将圆角字幕渲染相关 ffmpeg 调用切换到公共 helper。
videocaptioner/core/subtitle/ass_renderer.py 将 ASS 预览/渲染相关 ffmpeg 调用切换到公共 helper。
videocaptioner/core/asr/whisper_cpp.py 将 whisper.cpp 与 ffmpeg 调用切换到公共 helper。
videocaptioner/core/asr/faster_whisper.py 将 faster-whisper 进程启动切换到公共 helper。

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants