fix: VisualSampleEntry 跳过78字节固定字段,修复 hvcC 提取位置
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 1m21s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 2m6s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 2m27s
CI/CD Pipeline / Build Staging API Image (push) Successful in 2m40s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 5m25s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 5m26s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 45s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 44s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 7m26s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 2m16s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m0s
CI/CD Pipeline / Unit Tests (push) Successful in 11m9s
CI/CD Pipeline / Integration Tests (push) Successful in 4m16s
CI/CD Pipeline / CI Gate (push) Failing after 664h36m32s
CI/CD Pipeline / Deploy Production (push) Failing after 664h37m3s
CI/CD Pipeline / Production Browser E2E (push) Failing after 664h37m2s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 664h37m4s
CI/CD Pipeline / PR Build Web Image (push) Failing after 664h46m50s
CI/CD Pipeline / Build Production Web Image (push) Failing after 664h37m4s
CI/CD Pipeline / PR Build API Image (push) Failing after 664h46m52s
CI/CD Pipeline / Build Production API Image (push) Failing after 664h37m5s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 664h48m16s
CI/CD Pipeline / Canary Release to Production (push) Failing after 665h10m48s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 665h20m33s
CI/CD Pipeline / Frontend Lint (push) Failing after 665h21m59s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 1m21s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 2m6s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 2m27s
CI/CD Pipeline / Build Staging API Image (push) Successful in 2m40s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 5m25s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 5m26s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 45s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 44s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 7m26s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 2m16s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m0s
CI/CD Pipeline / Unit Tests (push) Successful in 11m9s
CI/CD Pipeline / Integration Tests (push) Successful in 4m16s
CI/CD Pipeline / CI Gate (push) Failing after 664h36m32s
CI/CD Pipeline / Deploy Production (push) Failing after 664h37m3s
CI/CD Pipeline / Production Browser E2E (push) Failing after 664h37m2s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 664h37m4s
CI/CD Pipeline / PR Build Web Image (push) Failing after 664h46m50s
CI/CD Pipeline / Build Production Web Image (push) Failing after 664h37m4s
CI/CD Pipeline / PR Build API Image (push) Failing after 664h46m52s
CI/CD Pipeline / Build Production API Image (push) Failing after 664h37m5s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 664h48m16s
CI/CD Pipeline / Canary Release to Production (push) Failing after 665h10m48s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 665h20m33s
CI/CD Pipeline / Frontend Lint (push) Failing after 665h21m59s
- findCodecConfigRecursive 区分 VisualSampleEntry 和普通容器 box - avc1/avc3/hvc1/hev1 前 78 字节是固定字段(ISO 14496-12),子 box 从 offset+8+78 开始 - 普通容器 box(moov/trak/mdia/minf/stbl)仍从 offset+8 开始递归 - 修复 HEVC description 提取失败导致的黑屏问题
This commit is contained in:
@@ -14,8 +14,8 @@ import type { Movie, Sample } from "mp4box"
|
||||
* 递归搜索 box 树,找到 hvcC 或 avcC box 并返回其配置数据(不含 8 字节 box header)
|
||||
*
|
||||
* MP4 box 嵌套结构:moov → trak → mdia → minf → stbl → stsd → hev1 → hvcC
|
||||
* 此函数不区分 fullbox / 普通 box,统一从 offset+8 开始递归搜索子 box
|
||||
* 因为所有 container box(moov/trak/mdia/minf/stbl)的 content 都从 offset+8 开始
|
||||
* 普通容器 box 从 offset+8 开始递归;VisualSampleEntry (avc1/avc3/hvc1/hev1) 前 78 字节
|
||||
* 是固定字段(ISO 14496-12),子 box 从 offset+8+78 开始
|
||||
*/
|
||||
function findCodecConfigRecursive(
|
||||
buffer: ArrayBuffer,
|
||||
@@ -42,8 +42,11 @@ function findCodecConfigRecursive(
|
||||
return buffer.slice(offset + 8, offset + size)
|
||||
}
|
||||
|
||||
// 递归搜索子 box(所有 box 的子 box 都从 offset+8 开始)
|
||||
const childResult = findCodecConfigRecursive(buffer, 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
|
||||
|
||||
offset += size
|
||||
|
||||
Reference in New Issue
Block a user