fix(mux): -disposition 只对 MP4 写;hev1 源原地降级为 copy 重封装

顾问 Q-16 / Q-17(轮次 3 裁定):

- tracks.py::ffmpeg_args 的 -disposition 回写整块包进 container=="mp4"。
  不传时 matroska muxer 会从输入流继承整条 disposition 掩码(original/comment/
  hearing_impaired…),而 plan() 只提取 default/forced —— 显式传就是用单一标志
  覆盖整条掩码,抹掉 MKV 保真标记
- library_run.py::encode 在 tier_for_bpp 之后加一个分支:mp4 + hevc + tag!=hvc1 +
  yuv420p + 时间轴健康 → 直接 tier="copy"。走 -c:v copy -tag:v hvc1 无损重封装
  (copy 档本就跳过 SSIM),不再为一颗标签重编整片
This commit is contained in:
hoelee committed 2026-10-30 02:00:34 +08:00
1 parent 8b3d979eb3
commit 94350f18b3
2 files changed
+22 -5

No files matched your search

+11
View File
@@ -1424,6 +1424,17 @@ def process(src, args, dest=None, origin=None):
return "SKIP force-tier re-encode refused: already HEVC hvc1 (use --overwrite)", None
log(" force-tier %s (bpp rule said %s)" % (forced, tier))
tier = forced
elif (container == "mp4" and (info.get("vcodec") or "") == "hevc"
and (info.get("tag") or "") != "hvc1" and info.get("pix") in ("yuv420p",)
and not T.unusable_timeline(info, src)[0]):
# 顾问 Q-17(2026-10-30):这一项唯一不达标的地方就是 codec_tag 是 `hev1` ——
# 那是旧版 copy 档漏写 `-tag:v hvc1` 留下的产物(实测量级:io 车道历史只跑过 3 个文件,
# 不值得为它在队列层新增一动作类型)。为改一个标签重编整片是拿几十分钟换五秒钟的活:
# 降到 copy 档就走 `-c:v copy -tag:v hvc1`,无损重封装后原子替换,SSIM 门禁也不需要
# (画面位等同),结构回读 + 全景解码仍然照跑。
log(" codec_tag is %r, everything else is fine -> in-place remux to hvc1 (no re-encode)"
% (info.get("tag") or ""))
tier = "copy"
elif args.tier and args.tier != tier:
return "SKIP classified %s (run wants %s)" % (tier, args.tier), None
expect_vc = "hevc" if tier != "copy" else (info["vcodec"] or "h264")