收录 Demucs 长视频分块与首音轨固定 - #122
Merged
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e4cd0f2c7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- 将单块读取、推理和写出收进独立作用域,下一块开始前释放完整张量 - 输入启用 FFmpeg RF64 自动切换,临时 stem 与最终输出固定使用 RF64 - 用 weakref 验证跨块释放,并补充真实磁盘公式与峰值保证
Merged
- 用 ffprobe 探测第一音轨声道数,mono 复制且多声道只取前两路 - 以 float32 和 RF64 自动策略解码,保持长音频精度与大文件能力 - 增加真实 5.1 独有频率与 mono 复制回归,更新磁盘空间公式
- 每次实际分离先清理旧输出并完整重算 - 两份 pending 写完后再发布,异常时清除所有残件 - 补充恢复回归及 SIGKILL 遗留策略文档
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
-map 0:a:0,保持多音轨视频固定使用第一条音频流。DEMUCS_CHUNK_SECONDS,默认 600 秒;空值使用默认值,非法值直接抛出明确错误。-rf64 auto,float32 stems 与最终 PCM16 输出使用 RF64,消除 4 GiB WAV 边界。main的 重做字幕、配音与组合输出模式 #125(6f78915)与 拒绝静默截短越界原音片段 #126(a139b74)变更。原始实现致谢
感谢 @lyk-bit 在 #112 中提供初始实现和思路。本次按当前
main重做并修正异常与配置边界,参考提交:提交中保留了
lyk-bit的共同作者署名。验证
.venv/bin/python -m pytest backend/tests/test_demucs_adapter.py -q:27 passed。.venv/bin/python -m pytest backend/tests -q:395 passed,1 条既有 Python 3.12audioop弃用警告。真实 Demucs 验收边界
本机复用的项目
.venv已有 Torch 2.12.0,但缺少torchaudio;导入demucs.api即以ModuleNotFoundError: No module named 'torchaudio'停止,因此本次没有声称完成真实htdemucs_ft推理。具备完整依赖和模型下载条件后可复现:首次运行需要下载
htdemucs_ft模型权重。验收时应确认输出帧数为 661,500、日志出现多个 part、/tmp/demucs-sample-session/tmp无 Demucs 临时文件,media中只保留两份 final 且没有.pending.wav。