fix: VisualSampleEntry 添加 fallback 搜索,兼容不同 MP4 结构
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 56s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 2m36s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 2m45s
CI/CD Pipeline / Build Staging API Image (push) Successful in 2m49s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 5m28s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 5m26s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 42s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 46s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1m17s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 7m30s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m1s
CI/CD Pipeline / Unit Tests (push) Successful in 11m42s
CI/CD Pipeline / Integration Tests (push) Successful in 4m12s
CI/CD Pipeline / Production Browser E2E (push) Failing after 664h23m8s
CI/CD Pipeline / Deploy Production (push) Failing after 664h23m9s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 664h23m10s
CI/CD Pipeline / CI Gate (push) Failing after 664h23m10s
CI/CD Pipeline / Build Production API Image (push) Failing after 664h23m10s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 664h34m51s
CI/CD Pipeline / PR Build API Image (push) Failing after 664h34m53s
CI/CD Pipeline / Frontend Lint (push) Failing after 664h34m54s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 664h34m54s
CI/CD Pipeline / Canary Release to Production (push) Failing after 664h56m53s
CI/CD Pipeline / Build Production Web Image (push) Failing after 664h56m55s
CI/CD Pipeline / PR Build Web Image (push) Failing after 665h8m37s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 56s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 2m36s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 2m45s
CI/CD Pipeline / Build Staging API Image (push) Successful in 2m49s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 5m28s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 5m26s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 42s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 46s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1m17s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 7m30s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m1s
CI/CD Pipeline / Unit Tests (push) Successful in 11m42s
CI/CD Pipeline / Integration Tests (push) Successful in 4m12s
CI/CD Pipeline / Production Browser E2E (push) Failing after 664h23m8s
CI/CD Pipeline / Deploy Production (push) Failing after 664h23m9s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 664h23m10s
CI/CD Pipeline / CI Gate (push) Failing after 664h23m10s
CI/CD Pipeline / Build Production API Image (push) Failing after 664h23m10s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 664h34m51s
CI/CD Pipeline / PR Build API Image (push) Failing after 664h34m53s
CI/CD Pipeline / Frontend Lint (push) Failing after 664h34m54s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 664h34m54s
CI/CD Pipeline / Canary Release to Production (push) Failing after 664h56m53s
CI/CD Pipeline / Build Production Web Image (push) Failing after 664h56m55s
CI/CD Pipeline / PR Build Web Image (push) Failing after 665h8m37s
- 先尝试 offset+8+78(标准 VisualSampleEntry 结构) - 未找到则 fallback 到 offset+8(兼容非标准 MP4) - 添加调试日志追踪搜索过程
This commit is contained in:
@@ -42,12 +42,24 @@ function findCodecConfigRecursive(
|
||||
return buffer.slice(offset + 8, offset + size)
|
||||
}
|
||||
|
||||
// VisualSampleEntry (avc1/avc3/hvc1/hev1) 前 78 字节是固定字段,子 box 在 78 字节之后
|
||||
// 普通容器 box (moov/trak/mdia/minf/stbl/stsd) 从 offset+8 开始递归
|
||||
const visualSampleEntryTypes = ["avc1", "avc3", "hvc1", "hev1"]
|
||||
const childStart = visualSampleEntryTypes.includes(type) ? offset + 8 + 78 : offset + 8
|
||||
const childResult = findCodecConfigRecursive(buffer, childStart, offset + size)
|
||||
if (childResult) return childResult
|
||||
const isVisualSampleEntry = visualSampleEntryTypes.includes(type)
|
||||
|
||||
if (isVisualSampleEntry) {
|
||||
// VisualSampleEntry: 前 78 字节是固定字段,子 box 在 78 字节之后
|
||||
// 先尝试 offset+8+78,如果没找到再尝试 offset+8(兼容不同 MP4 结构)
|
||||
console.log("[findCodecConfig] VisualSampleEntry:", type, "at", offset, "size", size, "trying offset+8+78")
|
||||
const childResult1 = findCodecConfigRecursive(buffer, offset + 8 + 78, offset + size)
|
||||
if (childResult1) return childResult1
|
||||
|
||||
console.log("[findCodecConfig] VisualSampleEntry:", type, "at", offset, "trying offset+8 (fallback)")
|
||||
const childResult2 = findCodecConfigRecursive(buffer, offset + 8, offset + size)
|
||||
if (childResult2) return childResult2
|
||||
} else {
|
||||
// 普通容器 box,从 offset+8 开始递归
|
||||
const childResult = findCodecConfigRecursive(buffer, offset + 8, offset + size)
|
||||
if (childResult) return childResult
|
||||
}
|
||||
|
||||
offset += size
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user