fix: HEVC description偏移修正+调试日志 (#1450)
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 1m0s
CI/CD Pipeline / Build Staging API Image (push) Successful in 1m57s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 3m41s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 3m59s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 5m32s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 5m36s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 53s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 45s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 47s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m13s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 10m51s
CI/CD Pipeline / Unit Tests (push) Successful in 14m48s
CI/CD Pipeline / Integration Tests (push) Successful in 5m41s
CI/CD Pipeline / CI Gate (push) Failing after 667h3m1s
CI/CD Pipeline / Canary Release to Production (push) Failing after 667h4m43s
CI/CD Pipeline / Deploy Production (push) Failing after 667h4m43s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 667h4m44s
CI/CD Pipeline / Build Production Web Image (push) Failing after 667h4m45s
CI/CD Pipeline / Build Production API Image (push) Failing after 667h4m45s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 667h19m30s
CI/CD Pipeline / Frontend Lint (push) Failing after 667h19m34s
CI/CD Pipeline / PR Build Web Image (push) Failing after 667h19m32s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 667h19m36s
CI/CD Pipeline / Production Browser E2E (push) Failing after 667h38m28s
CI/CD Pipeline / PR Build API Image (push) Failing after 667h53m20s

This commit is contained in:
张宏杰
2026-08-19 20:06:44 +08:00
parent 7775d5d118
commit 60d95e64ab
@@ -36,15 +36,27 @@ function findCodecConfig(buffer: ArrayBuffer, start: number, end: number): Array
// SampleDescriptionBox 是 fullbox: 8 header + 4 version/flags + 4 entry_count
const entryCount = view.getUint32(offset + 12)
let entryOffset = offset + 16
console.log("[findCodecConfig] stsd found:", {
entryCount,
stsdOffset: offset,
stsdSize: size,
})
for (let i = 0; i < entryCount && entryOffset < offset + size; i++) {
const entrySize = view.getUint32(entryOffset)
const entryType = String.fromCharCode(
view.getUint8(entryOffset + 4),
view.getUint8(entryOffset + 5),
view.getUint8(entryOffset + 6),
view.getUint8(entryOffset + 7),
)
console.log("[findCodecConfig] entry:", { index: i, entryOffset, entrySize, entryType })
// 视觉样本条目: 8 header + 6 reserved + 2 data_ref_index + remaining
// 子 box 从 entryOffset + 16 + 62 开始 (skip reserved + data_ref_index + predefined)
// 实际结构: 8(header) + 6(reserved) + 2(data_ref_index) + 16(predefined+reserved) + 2(width) + 2(height) + ...
// 子 box 从 entryOffset + 8 + 6 + 2 + 16 + 2 + 2 + 2 + 2 + 4 + 2 + 2 + 2 + 2 = entryOffset + 78
// 更简单的做法:扫描 entry 内的子 box
const entryEnd = entryOffset + entrySize
const subBoxStart = entryOffset + 8 + 70 // VisualSampleEntry 固定字段共 70 字节
const subBoxStart = entryOffset + 8 + 78 // VisualSampleEntry 固定字段共 78 字节(ISO 14496-12)
const result = findCodecConfig(buffer, subBoxStart, entryEnd)
if (result) return result
entryOffset += entrySize
@@ -246,7 +258,15 @@ export function useCanvasPlayer(
view.getUint8(offset + 7),
)
if (type === "moov") {
return findCodecConfig(buffer, offset + 8, offset + size)
const result = findCodecConfig(buffer, offset + 8, offset + size)
console.log("[useCanvasPlayer] extractCodecDescription:", {
moovOffset: offset,
moovSize: size,
searchRange: [offset + 8, offset + size],
found: !!result,
resultByteLength: result?.byteLength,
})
return result
}
if (size === 0) break
offset += size