diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 766d97ea..7e53d4d9 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,11 +1,18 @@ # 变更日志 +## feat: [M027] 迁移LOCAL内部产物扫描登记([PR #232](https://github.com/makewheels/video-2022/pull/232),2026-10-30) + +- #231已按用户授权合并;继续迁移真实LOCAL完成方法的侧车/校验/签名清单/全前缀/分片/Transcode登记前缀,显式内部工厂,不安装半条完成HTTP或提前READY。 +- 69组真实旧内部方法/完整BSON及调用/ID顺序,固定样本重放和相关Java8passed;新增Python85项,不重叠相关回归314passed/0skipped,Ruff/架构/500行通过。完整CI见本批PR当前head;真实OSS/FC/设备未验。 +- 保留原字段/默认值、Long大小、历史/重复分片、有序批插入的部分失败与Java码率;侧车getter补固定Fastjson的HashMap顺序/UTF16兼容,增强原69例并实际对照249组。无新字段/索引/任务或业务重试;已知可选读取错误warn,坏JSON/未知编程错误上抛,SDK媒体对象读取后关闭。 +- 固定90项台账完成数4、剩余86,本批待合并;M028/M019完整完成及可靠副作用仍待做,不继续细拆编号,不据任务数重算上线比例。 + ## feat: [M030-M032] 迁移订阅增删与通知查询/已读状态(2026-10-30) - 新增六个旧HTTP入口的普通能力、现有Mongo适配及三个独立、默认关闭的隔离开关,共用身份/同步日志;生产入口、业务模型和客户端用法不变。 - 86组真实旧HTTP/完整BSON,实际Java16项通过并再次重放固定样本;新增Python102项,相关回归及补验分批跑通,最终通知/HLS/架构121passed/0skipped/1既有warning。控制字符/NBSP旧样本修复前实际失败,改用共用Java trim原样规则后通过。Ruff/架构/500行及文档台账检查通过,完整CI见本批PR当前head,真实FC/实机未跑。 - 保留订阅记录/独立计数的部分失败、Long计数、通知旧可选身份/JSON/null/分页和read窄写;不新增原本未调用的通知生成、鉴权规则、队列或云资源。 -- 剩余工作固定为M001–M090任务台账,列交付物/验收/依赖/状态,不再扩字母子号;本轮三项隔离交付、未合并,基线仍余87项,不据任务数重算工作量百分比。 +- 剩余工作固定为M001–M090任务台账,列交付物/验收/依赖/状态,不再扩字母子号;三项已随[#231](https://github.com/makewheels/video-2022/pull/231)合并,当时基线余87项,不据任务数重算工作量百分比。 ## feat: [S15.b.1] 迁移登录用户的订阅状态与列表读取(2026-10-29) diff --git "a/docs/api/5-\350\275\254\347\240\201\346\216\245\345\217\243.md" "b/docs/api/5-\350\275\254\347\240\201\346\216\245\345\217\243.md" index 352bc876..9b8f89b2 100644 --- "a/docs/api/5-\350\275\254\347\240\201\346\216\245\345\217\243.md" +++ "b/docs/api/5-\350\275\254\347\240\201\346\216\245\345\217\243.md" @@ -73,6 +73,8 @@ Content-Type: application/json 完整流程:`createTranscode` 登记一档分辨率并拿到 OSS 上传凭证 → 客户端用本机 ffmpeg 切 HLS(m3u8 + ts)直传到 `outputDir` → `finishTranscode` 触发服务端扫描 OSS 登记 ts、置视频就绪。封面同理走 `createCover` / `finishCover`。所有接口都需登录态(`token`),且校验视频归属当前用户。 +**Python迁移边界(M027)**:[扫描登记](../requirements/2026-10-14-serverless-backend/upload/local-output-registration.md)仅显式内部装配,没有原独立扫描HTTP,故不新增接口。即使隔离应用开启档位创建,`/transcode/local/finishTranscode`仍404,不能把只有登记而无完成/可靠副作用的链路当成功。下述现有Java接口不变;完整完成接口迁移归M028。 + ### 本地转码-登记一档 ``` @@ -110,7 +112,7 @@ Content-Type: application/json POST /transcode/local/finishTranscode?transcodeId={transcodeId} ``` -客户端把该档的 m3u8 + ts 全部传到 `outputDir` 后调用。服务端先校验完整播放产物,再登记全部分片,最后置为 `FINISHED`;登记复用 `TranscodeCallbackService.onTranscodeFinish` 扫描 OSS 登记 ts、计算码率;当该视频所有分辨率都完成时置 `READY`。 +客户端把该档的 m3u8 + ts 全部传到 `outputDir` 后调用。服务端`TranscodeCallbackService.onLocalTranscodeFinish`先读取/核对可选result.json并校验完整播放产物,再登记清单和全部分片/码率,最后置为`FINISHED`;当该视频所有分辨率都完成时置`READY`。 ### 本地封面-登记 diff --git a/docs/design/serverless-backend.md b/docs/design/serverless-backend.md index 0c824b78..e22b7e27 100644 --- a/docs/design/serverless-backend.md +++ b/docs/design/serverless-backend.md @@ -63,6 +63,12 @@ flowchart LR - 保持旧 Java 读取新写入数据和任务状态的能力。若需要不可逆模型变化,应先修改方案,不能把切回域名当成完整回滚。 - 数据库位置迁移独立于 API 切流;需要备份、增量同步/短维护窗口及单写者方案后另行执行,不在同次灰度双主写入。 +### LOCAL内部扫描登记(M027) + +`LocalOutputRegistration`承接旧LOCAL完成方法中“可选侧车→既有校验→播放列表File→整前缀扫描→TsFile有序插入→Transcode登记保存”的同步前缀,单独显式装配、不安装HTTP。没有独立旧扫描路由,不能为了交付人为新增公开路由,或把不含完成/可靠副作用的半条finish包装为成功。完整完成、视频READY及Webhook仍归M028/M019。 + +数据仅使用既有File/TsFile/Transcode字段;复用原ID、全量映射、Fastjson方言和OutputValidation。对象存储适配区分校验读取、可选侧车、10分钟签名清单下载、元数据与1000条分页列举,不能把不同时间点的读取合并为快照。新分片构造后有序批量插入,保留前序部分写入、既有分片和Java码率;不加业务层重试、事务、索引或后台工作。已知可选对象读取错误warn,坏JSON及未知编程错误上抛;元数据对象读后关闭。真实方法的登记AfterSave边界与完整BSON作为内部契约,后续M028另验完整旧HTTP。 + ## 6. 部署和成本 GitHub Actions 继续承担测试、取密、代码包发布、版本别名和回滚;设计不要求每个请求访问旧服务器/Infisical。新流水线、函数、域名、队列、Mongo/VPC 配置均尚未创建。 diff --git a/docs/requirements/2026-10-14-serverless-backend/overview/remaining-work.md b/docs/requirements/2026-10-14-serverless-backend/overview/remaining-work.md index a2df6e25..0368bc0c 100644 --- a/docs/requirements/2026-10-14-serverless-backend/overview/remaining-work.md +++ b/docs/requirements/2026-10-14-serverless-backend/overview/remaining-work.md @@ -6,12 +6,12 @@ - **基线为90项剩余工作,固定编号M001–M090**,不是90个新增需求或90个承诺的PR。已合并成果不再列成待办;S00–S24和历史字母编号只保留为归属、PR及证据索引。 - 不再产生字母或嵌套子编号。任务内部可以有实现步骤;发现真正漏项时,只在末尾追加新编号,在变更记录说明源码依据、原因及对总数的影响,不重编号、不暗改分母。 -- 每行是一个交付物,验收栏写该交付物的关键边界。实现类任务默认包含**旧Java HTTP/完整BSON证据、普通能力/端口/适配、显式隔离HTTP、相关回归、文档和质量门禁**;不能只交纯函数就标整项已交付。调查任务须交可复核结论,不把提案当运行时。 +- 每行是一个交付物,验收栏写该交付物的关键边界。实现类任务默认包含**旧Java HTTP/完整BSON证据、普通能力/端口/适配、显式隔离HTTP、相关回归、文档和质量门禁**;没有独立旧HTTP的内部步骤须验证真实旧方法/完整BSON与显式内部装配,不人为新增路由或伪造半条完成HTTP。不能只交纯函数就标整项已交付。调查任务须交可复核结论,不把提案当运行时。 - 实现的隔离验收与真实云端/各端验收分行,不能互相代替。`已交付`须有对应验证记录和提交/PR证据;未合并状态另行注明,不能写成主干已交付。PR合并仍由所有者决定。 - 前置栏只列本台账内的实际依赖,`无`表示可利用已合并基线独立推进,不表示可跳过旧行为调查。外部权限、费用、生产变更需要具体授权,任务编号本身不是授权。 - 每项完成后记录实际用时、阻塞等待和复验结果;有了同类任务实测数据再修正工期。**完成项数不是工作量百分比**,本表完成率也不是整个项目的完成率。 -截至本轮隔离交付:**3已交付 / 0进行中 / 1阻塞 / 86待做**,基线剩余87项。M030、M031、M032已在工作分支完成本机验收,尚未合并;完整CI以本批PR当前head为准。这不是生产完成率,其余任务不在本次实现中顺带扩大。 +当前:**4已交付 / 0进行中 / 1阻塞 / 85待做**,基线剩余86项。M030–M032已合并[#231](https://github.com/makewheels/video-2022/pull/231);M027隔离实现/本机验收已交付,当前工作分支未合并,完整CI见本批PR当前head。固定分母不变;这不是生产完成率。 ## 发布、网络及已有能力的剩余验收 @@ -52,7 +52,7 @@ | M024 | S10 | 原片完成接口与可靠受理 | 旧权限/状态、返回和部分写入顺序;请求返回后不依赖本机线程继续工作 | M018、M019 | 待做 | | M025 | S10 | MD5提交、完成与结果登记 | 固定既有哈希函数/文件key及失败恢复;不重复提交或把长处理塞回普通API | M024、M022 | 待做 | | M026 | S10 | AUTO去重与共享原片复用 | 并发重复、已有状态、引用和失败残留对照;不误删共享原片 | M025 | 待做 | -| M027 | S11 | LOCAL目录、媒体文件及侧车扫描登记 | 复用既有产物校验,固定文件/目录/manifest完整BSON和写入顺序 | 无 | 待做 | +| M027 | S11 | LOCAL目录、媒体文件及侧车扫描登记 | [真实旧内部方法/完整BSON与内部装配](../upload/local-output-registration.md),复用产物校验;不安装半条finish HTTP | 无 | 已交付 | | M028 | S11 | LOCAL完成回调和重复完成 | 复用就绪窄写;部分失败、重复登记、READY保护及既有必要副作用可恢复 | M027、M019 | 待做 | | M029 | S10/S11 | 各端AUTO/LOCAL完整上传验收 | 真实STS直传、原片完成、去重、侧车和各端原用法;收费媒体调用单独授权 | M009、M026、M028、M038 | 待做 | @@ -170,10 +170,11 @@ ## 执行与进度记录 -今日M030–M032的隔离实现/本机验收已交付,[契约与回退](../user/subscription-notifications.md)、[实际验证](../verification.md)和[接续记录](../progress.md)有具体证据,合并/CI状态另行注明。后续优先处理M016/M017的可靠任务证据及M027的LOCAL扫描,M001/M005云端门槛同步保留;独立任务不因云权限受阻而停下。 +M030–M032已随#231合并;继续交付[M027内部LOCAL扫描](../upload/local-output-registration.md),69组真实旧方法/完整BSON及本机314项Python、8项Java通过,新PR未合并。证据见[实际验证](../verification.md)和[接续记录](../progress.md)。后续优先M016/M017的可靠任务证据;M028完整完成还依赖M019,不拿扫描完成冒充整条上传可用。M001/M005云端门槛保留,独立任务不因云权限受阻而停下。 任务不绑定任意时长的PR:一个任务可以分实现提交和收尾提交,但不因此增加任务编号;一项业务的实现/契约/文档可同PR交付。提交/PR使用`[M030]`或明确范围,正文保留S阶段归属和已验/未验。必要CI通过后仍不自行扩大合并或生产授权。 ### 基线变更记录 +- 2026-10-30(M027):源码确认扫描没有独立旧HTTP,验收明确为真实旧方法/完整BSON和显式内部装配,不发明半条完成HTTP。编号/分母不变,M028/M029边界及前置不变;不是新增需求或继续细拆。 - 2026-10-30:从原“进入各域前初始拆分”整理为90项剩余任务;保留历史阶段/PR证据,不重算已完成工作。纠正订阅/通知HTTP对S12的过宽依赖;明确未迁视频管理、OSS元数据、App版本及异常查询入口,避免全被藏在“其余运维”中。没有新增业务规则、通知生产者、云资源或上线授权。 diff --git a/docs/requirements/2026-10-14-serverless-backend/overview/status.md b/docs/requirements/2026-10-14-serverless-backend/overview/status.md index 908334ba..2897a46c 100644 --- a/docs/requirements/2026-10-14-serverless-backend/overview/status.md +++ b/docs/requirements/2026-10-14-serverless-backend/overview/status.md @@ -1,8 +1,8 @@ # 总体进度与剩余清单 -更新:2026-10-30。远端master为`1b4eeb20`,[PR #229](https://github.com/makewheels/video-2022/pull/229)赞踩和[PR #230](https://github.com/makewheels/video-2022/pull/230)订阅读取均已合并;master CI40846984693及既有Java部署40846984740实际success。Python真实FC发布仍无成功验收记录,不能把Java部署成功当Python上线。 +更新:2026-10-30。远端master为`dec7a776`,[PR #231](https://github.com/makewheels/video-2022/pull/231)订阅写入/通知已按用户授权合并;该PR终版CI40990924783成功,Python1531passed、Java783passed,API/浏览器E2E跳过。合并后的部署另验,不能把既有Java部署或原型CI当Python真实FC上线。 -剩余执行改用[固定任务台账](remaining-work.md):基线90项,M001–M090,不再扩展字母子编号。今日M030订阅增删、M031通知查询、M032已读状态的隔离实现/本机验收已交付,工作分支未合并、完整CI见本批PR;剩余87项。历史S阶段和PR编号保留,不重算已交付成果。 +剩余执行改用[固定任务台账](remaining-work.md):基线90项,M001–M090,不再扩展字母子编号。M030–M032已合并,M027内部LOCAL扫描登记隔离交付、工作分支未合并;剩余86项,完整CI以新PR当前head为准。历史S阶段和PR编号保留,不重算已交付成果。 ## 两个工程分别看 @@ -15,12 +15,12 @@ ## 一眼看懂当前位置 -- 后端迁移总计 **25个大阶段**,编号S00–S24;S15订阅读取已合并,**M030–M032已交隔离实现/本机验收,待本批PR合并**。S10上传、S11 LOCAL、S12可靠任务和真实FC/各端验收仍未完成,不表示此前阶段全部完成。 +- 后端迁移总计 **25个大阶段**,编号S00–S24;**M030–M032已合并,M027隔离交付待合并**。S10上传、S11 LOCAL、S12可靠任务和真实FC/各端验收仍未完成,不表示此前阶段全部完成。 - 应用户2026-10-16要求给出沟通用百分比:**整体开发工作量粗估约25%,剩余约75%**。这是基于已完成/部分阶段的人工估算,误差较大,不是实测或生产验收完成率;生产尚未切换。 - **3已交付 / 2阻塞或未验 / 10部分完成 / 10主体未迁移**。S10/S11/S12/S14/S15均有隔离能力,但仍缺各自剩余业务或真实环境验收;不能按PR数量或已写模块数换算上线百分比。 - S09固定拆为 **14个子任务:13已合并、1待验**;m.1–m.3隔离装配/入口/编码矩阵已合并,n真实环境仍未验。S10.a.1已合并#216、a.2/b.1普通创建#217、c.1凭证/文件完成#218;b.2状态轮询已合并#219;原片可靠受理/MD5等仍缺。 - [剩余执行清单](remaining-work.md)已细化后续业务批次、验收和依赖;S09.a–m已合并、n真实环境待验,后续按依赖推进,不因云权限阻塞停下独立开发。 -- PR标题统一`type: [Sxx.y] 具体成果`;已有#200–#207已补编号。PR是交付批次,不是项目总任务数。 +- 新PR标题统一`type: [M027] 具体成果`或明确任务范围;旧S阶段编号保留为历史证据。PR是交付批次,不是项目总任务数。 - 25是里程碑总数,90是2026-10-30基线的剩余交付物数;两者都不是PR总数或等权工作量。发现漏项只在任务台账末尾追加并记录原因,不扩字母层级;目前仍没有逐任务实测工时。 ## 当前S09:14个子任务 @@ -59,11 +59,11 @@ | 09/25 | S08 播放/清单/文件 | 部分实现 | 观看信息/主子清单已合并;文件重定向#196已合并,完整下载/计费/端到端仍缺 | | 10/25 | S09 心跳/进度/会话/历史 | 隔离能力已合并,真实环境待验 | a–m共13子项与统一装配/HTTP/日志/编码已合并;n真实FC与各端验收仍依赖S03/S04 | | 11/25 | S10 上传/MD5/AUTO去重 | 部分实现 | #216–#219创建、凭证/文件确认和状态轮询已合并;原片完成、MD5/AUTO及可靠受理待做 | -| 12/25 | S11 LOCAL登记 | 部分实现 | #221–#224迁移封面登记、LOCAL转码登记、产物校验与视频就绪窄写;扫描/回调/完整登记链路和真实文件云端仍待做 | +| 12/25 | S11 LOCAL登记 | 部分实现 | #221–#224迁移封面/档位登记、校验和就绪窄写;M027内部扫描已隔离交付待合并,M028完成/可靠副作用和M029真实云端/各端链路仍待做 | | 13/25 | S12 可靠任务/恢复 | 故障实验已交付,方案/运行时待做 | #220进程终止模型确认写库/投递与未知受理间隙;真实托管唤醒、deadline和恢复协议仍未解决 | | 14/25 | S13 云任务/回调/MPS | 主体未迁移 | 把既有Java任务/回调/恢复迁入Python,不能重复计费或双所有者 | | 15/25 | S14 评论回复 | 隔离读写能力已交付 | #225读取、#227创建/回复/级联删除/点赞切换;尚未接生产入口,真实FC和各端验收仍待做 | -| 16/25 | S15 赞踩/订阅/通知 | 隔离HTTP能力已交,真实验收未齐 | 赞踩#229、订阅读取#230已合并;M030–M032订阅写入/通知HTTP完成本机验收、待本批PR合并;真实FC/各端归M040,不新增原本未调用的通知生成业务 | +| 16/25 | S15 赞踩/订阅/通知 | 隔离HTTP能力已合并,真实验收未齐 | 赞踩#229、订阅读取#230、M030–M032订阅写入/通知#231已合并;真实FC/各端归M040,不新增原本未调用的通知生成业务 | | 17/25 | S16 播放列表/分享 | 未开始迁移 | CRUD/排序/恢复/跳转统计 | | 18/25 | S17 开发者/JWT/OAuth/OpenAPI | 未开始迁移 | 旧凭据、scope、刷新撤销与两套路径 | | 19/25 | S18 限流/Webhook | 未开始迁移 | 跨实例额度、签名字节与可靠重试 | @@ -76,6 +76,8 @@ ## 当前检查点与历史交付 +2026-10-30合并后接续:#231已合并`dec7a776`;M027扫描登记新增69组真实旧内部方法/完整BSON,不新增独立HTTP或置READY。本机Java8passed,Python新增85项且不重叠相关回归共314passed,Ruff/架构/500行通过;新PR未合并,当前head CI另验。固定台账4交付/1阻塞/85待做、剩余86项,不因此提高人工百分比或宣布Python上线。 + 2026-10-30:M030–M032实际旧Java16passed/0skipped,含86组新HTTP/完整BSON且生成后再次固定文件重放;新增Python102项,初轮相关309项分批验证,补真实Java trim/NBSP样本修正兼容边界后通知/HLS/架构最终121passed,非本机全量。Ruff/架构/500行通过,工作分支未合并、CI当前head见本批PR。通知路由旧可选身份、primitive null错误和Java字符串空白规则均按实测保留,没有迁库/切流/云资源变更。 2026-10-29接续:#229已合并`162c6d37`且master CI40843192645成功;S15.b.1隔离订阅读取完成真实Java2项/26组样本、Python相关域108passed/0skipped/1warning及本机门禁。仍约25%的人工开发估算,不表示生产完成度。未自行合并本批或切生产;当前head CI和未验范围记录于本批PR。 diff --git a/docs/requirements/2026-10-14-serverless-backend/plan.md b/docs/requirements/2026-10-14-serverless-backend/plan.md index 77d41306..b30aa755 100644 --- a/docs/requirements/2026-10-14-serverless-backend/plan.md +++ b/docs/requirements/2026-10-14-serverless-backend/plan.md @@ -47,6 +47,8 @@ S12 可以提前调查,但依赖可靠任务的写业务不能在它未通过 总计划25个里程碑S00–S24保留,S09历史a–n及原PR证据不重编号。**2026-10-30起,剩余执行统一使用[固定任务台账](overview/remaining-work.md)的M001–M090**;每项列交付物、验收、依赖和状态,不再扩展字母层级。新PR标题用`[M030]`或明确任务范围,正文记录S阶段归属、已验/未验与回退点;总体状态仍见[总表](overview/status.md)。 +M027内部LOCAL扫描没有独立旧HTTP,以真实旧方法/完整BSON、普通能力/适配与显式内部工厂交付,不新增半条完成HTTP。69组旧样本、本机Java8项/Python相关314项已实际通过;新PR/完整CI另记,M028/M019完成及可靠副作用不顺带标完,不为内部步骤加新编号。 + ## 每个 PR 的交付要求 1. 阶段 ID、单一问题与实际成果;规划不冒充实现。 diff --git a/docs/requirements/2026-10-14-serverless-backend/progress.md b/docs/requirements/2026-10-14-serverless-backend/progress.md index cb51c941..f81ed26b 100644 --- a/docs/requirements/2026-10-14-serverless-backend/progress.md +++ b/docs/requirements/2026-10-14-serverless-backend/progress.md @@ -1,5 +1,15 @@ # 接续记录 +## 2026-10-30 合并#231并继续M027 + +- 用户明确要求“merge继续做”。现场复核#231原head `73422dde`未变化、12项CI成功/2项E2E跳过,按仓库普通merge方式合并为`dec7a776b8d2678ed08b6ea02538244a26f68dd6`,本地master已干净快进。此前CI全量Python1531passed/Java783passed;不将旧head结果冒充后续master部署。 +- 新建`feat-m027-local-output-20261030`,仅推进M027;先记录[内部扫描登记设计](upload/local-output-registration.md)。源码确认无独立扫描HTTP,真实AfterSave登记边界作契约,完整finish/可靠副作用仍留M028,不新增假成功入口。 +- M027实现及本机验收已交付:真实Java69组完整前后BSON/调用顺序(含真实Mongo拒绝及部分插入),不带生成参数重放通过;最终Java相关8passed,Python新增85项,终版十文件一次合跑314passed/0skipped/3条既有依赖warning。Ruff/架构/500行/空白通过,完整CI与新PR结果后记。 +- 终审真实Fastjson1.2.83探针抓住嵌套对象HashMap顺序及UTF16差异,仅修侧车getter;249组实际对照通过,既有69例内强化乱序/32个同哈希键/代理对后重生成重放。独立进程停用顺序修正,固定完整BSON契约1failed(预期);正常实现的终版8/314均已另行实际跑通,不把首轮通过当补验。 +- 已推送独立[PR #232](https://github.com/makewheels/video-2022/pull/232),实现提交`e4127493f5bcd1b113e2514fcd00642f11fa66e6`;收尾只补文档链接,完整CI按最终head核验并追加PR正文,不沿用实现head或#231结果。新PR不自动合并。 +- 没有生产/收费云调用、新字段/索引或切流;只对已知对象读取错误保留可选侧车warn回退,坏JSON/未知编程错误上抛。固定台账降至剩余86项,不拆新编号;M028/M019仍待做。 +- 本轮10:37起现场调查,11:13只是首轮门禁;终审修正及相关Java最终重放至11:39:43,约63分钟墙钟(含依赖、构建、探针与等待),不是持续有效工时。后续文档/PR/CI等待另计,不能据单项外推90项工期。 + ## 2026-10-30 固定任务台账及今日三项 - 用户要求把剩余工作一次细化,不再不断追加字母层级,并授权今天先实现几项。既有remaining-work.md改为固定M001–M090:交付物、验收、实际依赖和状态;历史S阶段/PR证据不改号。 diff --git a/docs/requirements/2026-10-14-serverless-backend/upload/README.md b/docs/requirements/2026-10-14-serverless-backend/upload/README.md index 2a8d91de..3071e59f 100644 --- a/docs/requirements/2026-10-14-serverless-backend/upload/README.md +++ b/docs/requirements/2026-10-14-serverless-backend/upload/README.md @@ -10,4 +10,5 @@ - [S11.a.2 / S11.c.2 LOCAL档位创建](local-transcodes.md):两档预建、源媒体信息保留、旧HTTP/完整BSON;完成扫描/就绪链路另做。 - [S11.b.1 只读产物校验](output-validation.md):TS/fMP4/init、manifest/对象对照与SDK流关闭;尚未装配完成写入。 - [S11.d.1 全档就绪状态](video-readiness.md):所有提供方/状态、缺失引用与READY保护、Mongo状态窄写;尚未装配完成副作用。 +- [M027 LOCAL产物扫描登记](local-output-registration.md):隔离交付待合并;69组真实旧方法/BSON与本机验收,内部侧车/清单/整前缀/分片登记,不安装半条完成HTTP,完整回调留M028。 - 没有实际FC或完整客户端上传验收,不能把普通创建能力称作整体上传迁移完成。 diff --git a/docs/requirements/2026-10-14-serverless-backend/upload/local-output-registration.md b/docs/requirements/2026-10-14-serverless-backend/upload/local-output-registration.md new file mode 100644 index 00000000..87c17891 --- /dev/null +++ b/docs/requirements/2026-10-14-serverless-backend/upload/local-output-registration.md @@ -0,0 +1,34 @@ +# M027 LOCAL产物扫描登记 + +[固定台账](../overview/remaining-work.md) · [档位创建](local-transcodes.md) · [产物校验](output-validation.md) · [全档就绪](video-readiness.md) + +状态:隔离实现及本机验收已交付,[PR #232](https://github.com/makewheels/video-2022/pull/232)未合并。2026-10-30用户授权合并#231后继续;基线master `dec7a776`,功能分支`feat-m027-local-output-20261030`。本轮只交M027,不扩大到M028完成回调、Webhook可靠派发或视频READY副作用;终版head完整CI的实际核验记录以PR正文为准。 + +## 真实边界与设计 + +扫描登记不是独立旧HTTP。旧`TranscodeCallbackService.onLocalTranscodeFinish`依次读取可选result.json、核对旧元数据、调用现有OutputValidator、读取视频、保存播放列表、扫描/保存TsFile、保存登记后的Transcode,之后才调用finishTranscode。M027止于登记保存,不新增只做半条链路却返回成功的HTTP;原`/transcode/local/finishTranscode`仍404,生产入口不变。 + +实现普通`LocalOutputRegistration`、端口、现有Mongo及显式OSS适配和独立惰性工厂;复用既有OutputValidation、ID能力、File/Transcode映射和Fastjson输入方言。对象key是协议路径,不是本机文件路径。没有新业务字段、集合、索引、队列或后台线程。 + +## 必须保留 + +- 可选侧车读取在校验之前;已知对象读取失败沿旧语义记录warning后按缺侧车继续,坏JSON或元数据/codec不匹配不吞。Java getter的缺失/null及转换顺序按旧样本固定;容器转字符串保留HashMap桶序、扩容/树桶链和UTF16代理对,不当作DTO绑定或改成字典序,不新增媒体规则。 +- 校验后再次读签名播放列表(10分钟),不能把前一次校验读取当同一份快照;先查播放列表File,未登记才生成ID/读取元数据/保存。保留File构造默认值和BSON Long大小。 +- 列举整个输出前缀的全部分页对象,包含非媒体文件;按旧basename建表,重复basename不能悄悄覆盖。按旧原始EXTINF行解析时长,不能“修好”CRLF/带空格行后改变原码率。 +- fMP4 init使用tsIndex=-1且不算媒体码率;分片按原播放顺序、transcodeId+index查重,已有记录不重写。先构造全部新分片,再一次有序insert;不增加旧代码未写的timeLength/provider/审计字段。 +- 插入后查询全部历史及新分片,保存全量tsFileIds;平均值仅在有媒体大小及视频时长时计算,最大值忽略null。保留Java long溢出、HALF_UP与int结果范围。缺时长按旧warning,不伪造0。 +- 保存/列表/下载/解析/计算任何阶段失败均保留已完成的前序写入,不重试、不回滚为成功。不改变完成状态、finishTime、视频或Webhook。 + +## 实际验证与限制 + +真实Java方法与独享回环Mongo生成**69组**完整BSON/对象调用/ID前缀样本;测试在真实AfterSave事件边界停止LOCAL方法,截取登记已持久化、但尚未进入finishTranscode的状态,而不是伪造HTTP成功。异常场景截取真实部分写入;重复basename错误只去掉含随机对象地址的JDK诊断后缀。撤掉生成参数重放固定文件,连同LOCAL创建/校验共**Java8passed/0skipped**,Checkstyle通过。 + +Python新增**85项**。首轮191+123项不重叠回归后,终审修正getter,并在增强固定语料上十文件一次复跑,最终**314passed/0skipped/3warnings**(既有Starlette/httpx弃用、OSS SDK两处非法转义)。同一合成对象/独享Mongo逐项对照,含已登记历史、真实Mongo拒绝及有序插入中途失败;另验第二次登记、1000条分页续令牌、资源关闭、惰性工厂和不重放。默认完成HTTP仍404;Ruff/架构/500行/空白门禁通过,固定台账/链接与完整CI另记。 + +终审确实发现原单键样本漏掉的Fastjson1.2.83嵌套对象顺序和UTF16差异,修正前探针失败;私有侧车适配补兼容后,249组Java/Python实际getter对照通过,不新增运行依赖。固定69例内强化普通乱序键、32个同哈希键和代理对,重新生成并完成上述Java重放;独立进程停用顺序修正时,固定完整BSON契约1failed(预期),正常实现的314项已实际跑通。临时对照不是新增249项持久测试,也不把首轮通过冒充终版覆盖。 + +旧实现对任何读取异常都warn并当缺侧车;本实现只对明确的OSError/OSS SDK错误保留该回退,JSON/业务错误与未知编程异常上抛,避免把坏代码伪装成兼容成功。元数据读取主动关闭SDK对象且不缓冲媒体。没有新增业务规则;同源字段按Java Integer/Long映射(含BSON小数截断)固定,而不是新增正数校验。 + +无生产/收费云调用,真实OSS/FC/网络/设备未验,不把固定样本或现有Java部署当上线验证。M027普通能力不自行认领并发完成或派发恢复任务,这些仍归M028/M019。 + +回退本PR代码即可;M027没有新任务所有者或调度,不恢复旧库备份覆盖业务数据。M028需补完整完成/重复/可靠副作用后才允许安装原完成HTTP。 diff --git a/docs/requirements/2026-10-14-serverless-backend/verification.md b/docs/requirements/2026-10-14-serverless-backend/verification.md index 7d176358..7f9113fd 100644 --- a/docs/requirements/2026-10-14-serverless-backend/verification.md +++ b/docs/requirements/2026-10-14-serverless-backend/verification.md @@ -2,6 +2,20 @@ 日期:2026-10-14。状态:用户已确认开始,P1 隔离原型开发和本地验证;尚未部署 FC 原型、修改生产配置或切换业务流量。 +## M027 LOCAL内部扫描登记验收(2026-10-30) + +#231已按用户授权合并为`dec7a776`后继续,Windows CPython3.12.12/JDK21.0.10/Mongo8.3.7。依赖确实缺少pytest后,按uv.lock恢复到系统临时目录;独享Mongo只绑定`127.0.0.1:13904`,显式覆盖Java全部`spring.mongodb.uri/host/port/database`,Python随机测试库,不接生产或已有27017。 + +- Java从`server`根运行`mvn -o -B -ntp -pl video -am test "-Dtest=LocalOutputRegistrationContractTest,LocalTranscodeHttpContractTest,LocalTranscodeServiceTest,OutputValidationContractTest" "-Dsurefire.failIfNoSpecifiedTests=false"`及上述独享库属性:实际**8passed/0skipped**,Checkstyle通过。新增1个契约测试内含**69组**真实`onLocalTranscodeFinish`前缀:AfterSave同步异常边界确认登记已存但不进入finish/READY/Webhook;生成后撤掉参数重放固定JSON,完整前后BSON、对象调用和ID前缀一致。重复map键异常只去随机对象地址后缀,不改业务错误。 +- Python新增**85项**。首轮新能力/LOCAL/校验/架构191passed,加File/HLS/就绪123passed,两组文件不重叠。终审getter修正并增强固定语料后,上述十个文件**一次合跑314passed/0skipped/3warnings**,不称本机全量。依赖提醒为既有Starlette/httpx弃用与固定OSS SDK两处非法转义;未改依赖掩盖warning。 +- 终审用真实固定Fastjson1.2.83证实`JSONObject.getString`的嵌套对象不是输入序/字典序:首个乱序探针断言失败,后续又发现UTF16代理对差异。仅在侧车getter适配内补Java HashMap桶序、扩容/树桶链及字符串代理对,不改共用DTO绑定或运行时调用Java。249组实际Java/Python对照通过;既有69例中的字符串转换样本增强为普通乱序键、32个同哈希键及代理对后重新生成,无生成参数的最终Java相关**8passed/0skipped**。独立进程只停用对象顺序修正,固定完整BSON契约实际**1failed(预期变异失败)**,证明不是只测常量或自身实现。 +- 覆盖侧车Fastjson方言/整数及字符串getter、元数据清空/错位、旧无侧车、TS/fMP4 init、全前缀及重复basename、两次清单快照、CRLF/原始EXTINF怪异规则、BSON Integer/Long与小数截断、long回绕/HALF_UP/int溢出、缺时长、全历史引用顺序、重复登记和完整失败部分写入。真实Mongo validator证明文件拒绝无新增、批插入第二片拒绝保留第一片、最终Transcode拒绝保留File/分片。 +- 另验1000条分页/续令牌、第二页失败非成功局部列表、媒体不缓冲/读取关闭、未知编程异常不装作缺侧车、工厂惰性和既有完成HTTP仍404。新能力止于内部登记;M028完整回调及M019可靠副作用未交付,没有新增字段/集合/索引/状态/重试。 +- 初次SDK测试14passed/3failed,原因是测试构造`OssError`漏details参数,另Ruff发现一处超长行;修正夹具/换行后纳入上述完整定向批次通过,没有改业务绕过失败。原有源代码未改Java运行时,新测试始终mock所有外部服务。 +- 全serverless Ruff、架构、仓库500行门禁、`git diff --check`通过;固定90项编号唯一、4交付/1阻塞/85待做与汇总一致、依赖存在且无环,12份修改文档的137个本地链接存在、代码围栏配对。当前head完整CI在PR收尾核实。真实OSS/FC/网络/冷热/设备、生产部署切流均未跑;本机通过不作为这些验收的替身。 + +细节与回退见[LOCAL产物扫描登记](upload/local-output-registration.md)。本批新增PR不随“合并#231”自动合并;回退代码即可,不覆盖业务数据库。 + ## M030–M032 订阅与通知隔离验收(2026-10-30) 基线`1b4eeb20`,Windows CPython3.12.12/JDK21.0.10;临时目录独享Mongo8.3.7,仅绑定`127.0.0.1:13903`,Java专用隔离库与Python随机测试库不接生产。环境/缓存/查询脚本位于系统临时目录,无云调用、迁库或生产配置变更。 diff --git "a/docs/\344\270\232\345\212\241/2-\350\247\206\351\242\221\350\275\254\347\240\201.md" "b/docs/\344\270\232\345\212\241/2-\350\247\206\351\242\221\350\275\254\347\240\201.md" index a65d9afc..9edd2b58 100644 --- "a/docs/\344\270\232\345\212\241/2-\350\247\206\351\242\221\350\275\254\347\240\201.md" +++ "b/docs/\344\270\232\345\212\241/2-\350\247\206\351\242\221\350\275\254\347\240\201.md" @@ -6,6 +6,8 @@ 2026-10 新增独立 [GPU Worker 原型](../../transcode-worker/README.md),尚未接入下述后端分流和回调;现有 MPS/CPU/LOCAL 行为保持不变。实施门槛见 [需求入口](../requirements/2026-10-07-gpu-cloudfunction-transcode/README.md)。 +Python后端迁移[M027](../requirements/2026-10-14-serverless-backend/upload/local-output-registration.md)已隔离实现LOCAL产物登记内部前缀:保留可选侧车、既有校验、独立签名清单读取、全前缀分页、历史分片/码率和部分写入。它不置完成/READY、不发Webhook,不新增独立扫描HTTP;完整完成及可靠副作用仍由M028/M019补齐,既有Java流程不变。 + --- ## 1. 视频状态机 diff --git "a/docs/\346\265\213\350\257\225/7-\345\260\201\351\235\242\344\270\216\350\275\254\347\240\201\346\265\213\350\257\225.md" "b/docs/\346\265\213\350\257\225/7-\345\260\201\351\235\242\344\270\216\350\275\254\347\240\201\346\265\213\350\257\225.md" index 05b17f09..e3a8aef3 100644 --- "a/docs/\346\265\213\350\257\225/7-\345\260\201\351\235\242\344\270\216\350\275\254\347\240\201\346\265\213\350\257\225.md" +++ "b/docs/\346\265\213\350\257\225/7-\345\260\201\351\235\242\344\270\216\350\275\254\347\240\201\346\265\213\350\257\225.md" @@ -108,3 +108,9 @@ export $(grep -v '^#' .env | grep -v '^$' | xargs) && mvn test -pl video -Psprin - MpsFallbackRecoveryTest:59.94fps 原片与精确流字段通过,不使用截成 59 的汇总值;流字段真正降到 30fps 仍拒绝。 MPS 单音轨兜底先核查实际 AAC 音轨数/声道,再以 HLS muxed AUDIO group 保留原语言。WatchServiceTest 覆盖语言/声道声明、未知语言不猜、属性注入拒绝与链接源归属;MpsFallbackRecoveryTest 覆盖声道改变不登记。单声道 eng 真实 MPS 产物的主列表声明经 ffprobe 恢复 language=eng,编码字节保持原样。 + +## 2026-10-30 M027内部扫描登记 + +新增`LocalOutputRegistrationContractTest`:真实调用LOCAL方法,Mongo同步AfterSave边界在登记已经持久化后停止,不造公开半条完成接口,也不进入READY/Webhook。69组固定样本包括完整BSON/对象及ID调用顺序、TS/fMP4、侧车、历史分片、原始EXTINF/Java码率,以及真实Mongo拒绝的有序部分插入。随机对象地址的错误后缀单独归一;生成参数撤掉后的全文重放通过。 + +**已有覆盖**包括页首四类历史概要及后续回归;不把旧37项当成本次实跑。**本次实际**新增契约及LOCAL创建/校验共Java8passed;新增Python85项,两个不重叠相关批次191+123=314passed/0skipped,Ruff/架构/500行通过。真实OSS/FC/全端设备未跑,完整当前head CI见新PR;详情及安全的独享回环数据库命令见[验证记录](../requirements/2026-10-14-serverless-backend/verification.md)。 diff --git a/server/video/src/test/java/com/github/makewheels/video2022/transcode/LocalOutputRegistrationContractTest.java b/server/video/src/test/java/com/github/makewheels/video2022/transcode/LocalOutputRegistrationContractTest.java new file mode 100644 index 00000000..80695d01 --- /dev/null +++ b/server/video/src/test/java/com/github/makewheels/video2022/transcode/LocalOutputRegistrationContractTest.java @@ -0,0 +1,380 @@ +package com.github.makewheels.video2022.transcode; + +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.aliyun.oss.OSSException; +import com.aliyun.oss.model.OSSObject; +import com.aliyun.oss.model.OSSObjectSummary; +import com.aliyun.oss.model.ObjectMetadata; +import com.github.makewheels.video2022.BaseIntegrationTest; +import com.github.makewheels.video2022.openapi.webhook.WebhookEventPublisher; +import com.github.makewheels.video2022.transcode.bean.Transcode; +import com.github.makewheels.video2022.utils.IdService; +import com.github.makewheels.video2022.video.service.VideoReadyService; +import org.bson.Document; +import org.bson.types.ObjectId; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.ApplicationEvent; +import org.springframework.context.ApplicationListener; +import org.springframework.context.event.ApplicationEventMulticaster; +import org.springframework.data.mongodb.core.mapping.event.AfterSaveEvent; +import org.springframework.test.context.bean.override.mockito.MockitoBean; + +import java.io.ByteArrayInputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; + +/** Execute the real LOCAL method through registration, without inventing a partial finish HTTP. */ +class LocalOutputRegistrationContractTest extends BaseIntegrationTest { + private static final String FOLDER = "fixture/local/"; + private static final String KEY = FOLDER + "playlist.m3u8"; + private static final String PLAYLIST = "#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n" + + "#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n"; + @Autowired private TranscodeCallbackService callbacks; + @Autowired private TranscodeRepository transcodes; + @Autowired @Qualifier("applicationEventMulticaster") private ApplicationEventMulticaster events; + @MockitoBean private IdService ids; + @MockitoBean private WebhookEventPublisher webhooks; + @MockitoBean private VideoReadyService ready; + + private static class RegistrationComplete extends RuntimeException { } + + private JSONObject fixture(String scenario) { + JSONObject input = new JSONObject(true); + input.put("key", KEY); input.put("playlist", PLAYLIST); input.put("signedPlaylist", PLAYLIST); + input.put("sidecar", "{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\"," + + "\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720," + + "\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}"); + input.put("failedKey", null); input.put("failedCall", 1); + input.put("signedFailure", false); input.put("listFailure", false); input.put("metadataNull", false); + Map sizes = new LinkedHashMap<>(); + sizes.put(KEY, (long) PLAYLIST.length()); sizes.put(FOLDER + "a.ts", 100L); sizes.put(FOLDER + "b.ts", 150L); + switch (scenario) { + case "legacy-ts" -> input.put("sidecar", null); + case "fmp4" -> { + input.put("playlist", PLAYLIST.replace("a.ts", "a.m4s").replace("b.ts", "b.m4s") + .replace("#EXT-X-VERSION:3", "#EXT-X-VERSION:7\n#EXT-X-MAP:URI=\"init.mp4\"")); + sizes.remove(FOLDER + "a.ts"); sizes.remove(FOLDER + "b.ts"); + sizes.put(FOLDER + "a.m4s", 100L); sizes.put(FOLDER + "b.m4s", 150L); + sizes.put(FOLDER + "init.mp4", 40L); + } + case "repeated-name" -> input.put("playlist", PLAYLIST.replace("#EXTINF:2.0,\nb.ts", "#EXTINF:3.0,\na.ts")); + case "missing-segment" -> sizes.remove(FOLDER + "a.ts"); + case "sidecar-read-failure" -> input.put("failedKey", FOLDER + "result.json"); + case "sidecar-null" -> input.put("sidecar", "null"); + case "sidecar-empty" -> input.put("sidecar", ""); + case "sidecar-malformed" -> input.put("sidecar", "{"); + case "sidecar-lenient" -> input.put("sidecar", "{,,/* old */schemaVersion:1,transcodeId:'fixture-transcode'," + + "playlistFilename:'playlist.m3u8',width:1280,height:720,frameRate:'30/1',,}"); + case "sidecar-schema-string" -> metadata(input, "schemaVersion", "1"); + case "sidecar-schema-decimal" -> metadata(input, "schemaVersion", 1.99); + case "sidecar-schema-wrap" -> metadata(input, "schemaVersion", 4294967297L); + case "sidecar-schema-null" -> metadata(input, "schemaVersion", null); + case "sidecar-schema-missing" -> { + JSONObject sidecar = JSON.parseObject(input.getString("sidecar")); + sidecar.remove("schemaVersion"); input.put("sidecar", sidecar.toJSONString()); + } + case "sidecar-schema-spaces" -> metadata(input, "schemaVersion", " 1 "); + case "sidecar-width-string" -> metadata(input, "width", "1280"); + case "sidecar-width-decimal" -> metadata(input, "width", 1280.75); + case "sidecar-width-null" -> metadata(input, "width", null); + case "sidecar-width-array" -> metadata(input, "width", List.of(1280)); + case "sidecar-wrong-width" -> metadata(input, "width", 1278); + case "sidecar-wrong-id" -> metadata(input, "transcodeId", "other-transcode"); + case "sidecar-wrong-playlist" -> metadata(input, "playlistFilename", "other.m3u8"); + case "sidecar-clear" -> { + JSONObject sidecar = JSON.parseObject(input.getString("sidecar")); + for (String name : List.of("frameRate", "dynamicRange", "hlsCodecs")) sidecar.remove(name); + input.put("sidecar", sidecar.toJSONString()); + } + case "sidecar-string-coercion" -> { + metadata(input, "frameRate", List.of(30, 1)); + input.put("sidecar", input.getString("sidecar").replace("\"dynamicRange\":\"SDR\"", + "\"dynamicRange\":" + getterObject())); + } + case "sidecar-invalid-codec" -> metadata(input, "hlsCodecs", "avc1.64001f\n"); + case "sidecar-empty-codec" -> metadata(input, "hlsCodecs", ""); + case "crlf" -> input.put("playlist", PLAYLIST.replace("\n", "\r\n")); + case "extinf-spaces" -> input.put("playlist", PLAYLIST.replace("#EXTINF:", " #EXTINF:")); + case "filename-spaces" -> input.put("playlist", PLAYLIST.replace("a.ts\n", "a.ts \n") + .replace("b.ts\n", "\tb.ts\n")); + case "invalid-extinf" -> input.put("playlist", PLAYLIST.replace("#EXTINF:2.0,", "#EXTINF:NaN,")); + case "missing-extinf-comma" -> input.put("playlist", PLAYLIST.replace("#EXTINF:2.0,", "#EXTINF:2.0")); + case "trailing-extinf" -> input.put("playlist", PLAYLIST + "#EXTINF:2.0,"); + case "short-playlist" -> input.put("playlist", "#EXTM3U\na.ts\n#EXT-X-ENDLIST"); + case "half-up", "negative-half-up" -> { + input.put("playlist", PLAYLIST.replace("#EXTINF:2.0,", "#EXTINF:16,")); + sizes.put(FOLDER + "a.ts", 1L); sizes.put(FOLDER + "b.ts", 1L); + } + case "long-overflow" -> { + sizes.put(FOLDER + "a.ts", Long.MAX_VALUE); sizes.put(FOLDER + "b.ts", Long.MAX_VALUE); + } + case "int-overflow" -> sizes.put(FOLDER + "a.ts", (long) Integer.MAX_VALUE); + case "average-overflow" -> { + input.put("playlist", PLAYLIST.replace("#EXTINF:2.0,", "#EXTINF:1000000,")); + sizes.put(FOLDER + "a.ts", 2000000000L); sizes.put(FOLDER + "b.ts", 2000000000L); + } + case "signed-changed" -> input.put("signedPlaylist", PLAYLIST.replace("#EXTINF:2.0,\nb.ts\n", "")); + case "signed-empty" -> input.put("signedPlaylist", ""); + case "signed-failure" -> input.put("signedFailure", true); + case "listing-failure" -> input.put("listFailure", true); + case "metadata-null" -> input.put("metadataNull", true); + case "metadata-failure" -> { input.put("failedKey", KEY); input.put("failedCall", 2); } + default -> { } + } + if (!List.of("signed-changed", "signed-empty").contains(scenario)) { + input.put("signedPlaylist", input.get("playlist")); + } + JSONArray summaries = new JSONArray(); + sizes.forEach((key, size) -> summaries.add(new JSONObject(new LinkedHashMap<>(Map.of( + "key", key, "size", scenario.equals("negative-half-up") && key.endsWith(".ts") ? -1L : size, + "etag", "fixture-etag", "storageClass", "Standard", "uploadTime", 2000))))); + if (scenario.equals("missing-summary")) summaries.removeIf(item -> ((JSONObject) item).getString("key").endsWith("a.ts")); + if (scenario.equals("late-missing-summary")) summaries.removeIf(item -> ((JSONObject) item).getString("key").endsWith("b.ts")); + if (scenario.equals("duplicate-basename")) { + for (String folder : List.of("extra-one/", "extra-two/")) { + summaries.add(new JSONObject(Map.of("key", FOLDER + folder + "ignored.txt", "size", 1L, + "etag", "ignored", "storageClass", "Standard", "uploadTime", 2000))); + } + } + input.put("sizes", sizes); input.put("summaries", summaries); + return input; + } + + private void metadata(JSONObject input, String field, Object value) { + JSONObject sidecar = JSON.parseObject(input.getString("sidecar")); + sidecar.put(field, value); + input.put("sidecar", JSON.toJSONString(sidecar, SerializerFeature.WriteMapNullValue)); + } + + private String getterObject() { + StringBuilder object = new StringBuilder( + "{\"z\":7,\"a\":1,\"p\":2,\"emoji\":\"\\ud83d\\ude00\",\"tree\":{"); + for (int index = 0; index < 32; index++) { + if (index > 0) object.append(','); + StringBuilder key = new StringBuilder(); + for (int bit = 0; bit < 5; bit++) key.append((index & (1 << bit)) == 0 ? "Aa" : "BB"); + object.append('"').append(key).append("\":").append(index); + } + return object.append("}}").toString(); + } + + private void validator(String collection, Document rule) { + if (!mongoTemplate.collectionExists(collection)) mongoTemplate.createCollection(collection); + mongoTemplate.getDb().runCommand(new Document("collMod", collection).append("validator", rule)); + } + + private void seed(String scenario) { + cleanDatabase(); + Document video = new Document("_id", "fixture-video").append("uploaderId", "fixture-uploader") + .append("videoType", "USER_UPLOAD").append("status", "TRANSCODING") + .append("mediaInfo", new Document("duration", 4000L)).append("untouched", "keep"); + if (scenario.equals("missing-media")) video.put("mediaInfo", null); + if (scenario.equals("missing-duration")) video.put("mediaInfo", new Document("duration", null)); + if (scenario.equals("zero-duration")) video.put("mediaInfo", new Document("duration", 0L)); + if (scenario.equals("negative-duration")) video.put("mediaInfo", new Document("duration", -4000L)); + if (scenario.equals("string-duration")) video.put("mediaInfo", new Document("duration", "4000")); + if (scenario.equals("decimal-duration")) video.put("mediaInfo", new Document("duration", 4000.75)); + if (List.of("half-up", "negative-half-up").contains(scenario)) { + video.put("mediaInfo", new Document("duration", 32000L)); + } + if (scenario.equals("average-overflow")) video.put("mediaInfo", new Document("duration", 1L)); + if (!scenario.equals("missing-video")) mongoTemplate.getCollection("video").insertOne(video); + Document transcode = new Document("_id", "fixture-transcode").append("videoId", "fixture-video") + .append("provider", "LOCAL").append("resolution", "720p").append("status", "TRANSCODING") + .append("actualWidth", 1280).append("actualHeight", 720).append("createTime", new Date(1000)) + .append("actualFrameRate", "24/1").append("actualDynamicRange", "old").append("actualCodecs", "old") + .append("averageBitrate", 77).append("maxBitrate", 99).append("m3u8Key", KEY) + .append("untouched", "drop-only-on-save"); + if (scenario.equals("null-task-width")) transcode.put("actualWidth", null); + if (scenario.equals("decimal-task-width")) transcode.put("actualWidth", 1280.75); + if (scenario.equals("missing-create-time")) transcode.remove("createTime"); + mongoTemplate.getCollection("transcode").insertOne(transcode); + if (List.of("existing-playlist", "repeated-prefix", "existing-object-id").contains(scenario)) { + Object id = scenario.equals("existing-object-id") ? new ObjectId("0123456789abcdef01234567") : "existing-playlist"; + mongoTemplate.getCollection("file").insertOne(new Document("_id", id).append("key", KEY) + .append("fileStatus", "OLD").append("untouched", "keep")); + } + if (List.of("existing-first", "repeated-prefix", "no-bitrates").contains(scenario)) { + mongoTemplate.getCollection("tsFile").insertOne(segment("existing-first", 0, 100L, 123)); + } + if (List.of("repeated-prefix", "no-bitrates").contains(scenario)) { + mongoTemplate.getCollection("tsFile").insertOne(segment("existing-second", 1, 150L, 456)); + } + if (scenario.equals("no-bitrates")) mongoTemplate.getCollection("tsFile") + .updateMany(new Document(), new Document("$set", new Document("bitrate", null))); + if (scenario.equals("history")) mongoTemplate.getCollection("tsFile") + .insertOne(segment("z-historical", 9, 250L, 1000)); + if (scenario.equals("null-index-history")) mongoTemplate.getCollection("tsFile") + .insertOne(segment("z-historical", null, 250L, 1000)); + if (scenario.equals("null-size-history")) mongoTemplate.getCollection("tsFile") + .insertOne(segment("z-historical", 9, null, 1000)); + if (scenario.equals("file-write-failure")) validator("file", new Document("fileStatus", "REJECT")); + if (scenario.equals("batch-write-failure")) validator("tsFile", new Document("tsIndex", new Document("$ne", 1))); + if (scenario.equals("transcode-write-failure")) { + validator("transcode", new Document("m3u8Content", new Document("$exists", false))); + } + } + + private Document segment(String id, Integer index, Long size, Integer bitrate) { + return new Document("_id", id).append("transcodeId", "fixture-transcode").append("tsIndex", index) + .append("size", size).append("bitrate", bitrate).append("untouched", "keep"); + } + + private Object normalize(Object value) { + if (value instanceof Date date) return date.getTime() < 10000 ? date.getTime() : ""; + if (value instanceof ObjectId id) return Map.of("$oid", id.toHexString()); + if (value instanceof List list) return list.stream().map(this::normalize).toList(); + if (value instanceof Map map) { + Map result = new LinkedHashMap<>(); + map.forEach((name, item) -> result.put(name.toString(), normalize(item))); + return result; + } + return value; + } + + private JSONObject state() { + JSONObject state = new JSONObject(true); + for (String collection : List.of("video", "file", "tsFile", "transcode")) { + state.put(collection, normalize(mongoTemplate.getCollection(collection).find() + .sort(new Document("_id", 1)).into(new ArrayList<>()))); + } + return state; + } + + private JSONObject record(String scenario) { + seed(scenario); + reset(ossVideoService, ids, webhooks, ready); + JSONObject input = fixture(scenario), row = new JSONObject(true); + List calls = new ArrayList<>(), prefixes = new ArrayList<>(); + AtomicInteger sequence = new AtomicInteger(); + when(ids.getFileId()).thenAnswer(invocation -> { prefixes.add("f_"); return "f_fixture_created"; }); + when(ids.getTsFileId()).thenAnswer(invocation -> { + prefixes.add("f_ts_"); return "f_ts_fixture_created_" + sequence.getAndIncrement(); + }); + when(ossVideoService.getObject(anyString())).thenAnswer(invocation -> { + String key = invocation.getArgument(0); + calls.add("get:" + key); + long count = calls.stream().filter(item -> item.equals("get:" + key)).count(); + if (key.equals(input.getString("failedKey")) && count == input.getIntValue("failedCall")) { + throw new OSSException("synthetic object failure"); + } + if (key.equals(KEY) && count == 2 && input.getBooleanValue("metadataNull")) return null; + String content = key.endsWith("result.json") ? input.getString("sidecar") + : key.equals(KEY) ? input.getString("playlist") : "x"; + if (content == null || (!key.endsWith("result.json") && !input.getJSONObject("sizes").containsKey(key))) return null; + OSSObject object = new OSSObject(); + object.setKey(key); object.setObjectContent(new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8))); + ObjectMetadata metadata = new ObjectMetadata(); + metadata.setContentLength(key.endsWith("result.json") ? content.length() : input.getJSONObject("sizes").getLongValue(key)); + metadata.setHeader("ETag", "fixture-etag"); metadata.setLastModified(new Date(2000)); + object.setObjectMetadata(metadata); + return object; + }); + when(ossVideoService.generatePresignedUrl(anyString(), any(Duration.class))).thenAnswer(invocation -> { + calls.add("sign:" + invocation.getArgument(0) + ":" + ((Duration) invocation.getArgument(1)).toSeconds()); + return "https://example.invalid/fixture-playlist"; + }); + when(ossVideoService.listAllObjects(anyString())).thenAnswer(invocation -> { + calls.add("list:" + invocation.getArgument(0)); + if (input.getBooleanValue("listFailure")) throw new IllegalStateException("synthetic listing failure"); + List result = new ArrayList<>(); + for (Object value : input.getJSONArray("summaries")) { + JSONObject item = (JSONObject) value; + OSSObjectSummary summary = new OSSObjectSummary(); + summary.setKey(item.getString("key")); summary.setSize(item.getLongValue("size")); + summary.setETag(item.getString("etag")); summary.setStorageClass(item.getString("storageClass")); + summary.setLastModified(new Date(item.getLongValue("uploadTime"))); result.add(summary); + } + return result; + }); + ApplicationListener boundary = event -> { + // Mongo has committed this save; stop before the original method's finishTranscode call. + if (event instanceof AfterSaveEvent saved && saved.getSource() instanceof Transcode value + && "fixture-transcode".equals(value.getId())) { + throw new RegistrationComplete(); + } + }; + row.put("scenario", scenario); row.put("input", input); row.put("before", state()); + events.addApplicationListener(boundary); + try (var http = mockStatic(HttpUtil.class)) { + http.when(() -> HttpUtil.get("https://example.invalid/fixture-playlist")).thenAnswer(invocation -> { + calls.add("download:https://example.invalid/fixture-playlist"); + if (input.getBooleanValue("signedFailure")) throw new IllegalStateException("synthetic signed failure"); + return input.getString("signedPlaylist"); + }); + RuntimeException failure = assertThrows(RuntimeException.class, + () -> callbacks.onLocalTranscodeFinish(transcodes.getById("fixture-transcode"))); + row.put("registered", failure instanceof RegistrationComplete); + String message = failure instanceof IllegalStateException ? failure.getMessage() : null; + // JDK's duplicate-map diagnostic suffix contains random OSSObjectSummary identities. + if (message != null && message.startsWith("Duplicate key ")) { + message = message.substring(0, message.indexOf(" (attempted merging values ")); + } + row.put("error", message); + } finally { + events.removeApplicationListener(boundary); + } + row.put("after", state()); row.put("calls", calls); row.put("idPrefixes", prefixes); + assertEquals("TRANSCODING", mongoTemplate.getCollection("transcode").find().first().getString("status")); + verifyNoInteractions(webhooks, ready, aliyunMpsService, cloudFunctionTranscodeService, md5CfService, youtubeService); + for (Document document : mongoTemplate.getCollection("tsFile").find(new Document("fileStatus", "READY"))) { + assertInstanceOf(Long.class, document.get("size")); + assertFalse(document.containsKey("timeLength")); + assertFalse(document.containsKey("createTime")); + } + return row; + } + + @Test + void realLocalRegistrationPrefixAndPartialWritesMatchFixedCompleteBson() throws Exception { + JSONArray cases = new JSONArray(); + try { + for (String scenario : List.of("legacy-ts", "sidecar-ts", "fmp4", "repeated-prefix", "existing-playlist", + "existing-object-id", "existing-first", "history", "null-index-history", "null-size-history", + "no-bitrates", "repeated-name", "missing-summary", "late-missing-summary", "duplicate-basename", + "missing-segment", "sidecar-read-failure", "sidecar-null", "sidecar-empty", "sidecar-malformed", + "sidecar-lenient", "sidecar-schema-string", "sidecar-schema-decimal", "sidecar-schema-wrap", + "sidecar-schema-null", "sidecar-schema-missing", "sidecar-schema-spaces", "sidecar-width-string", + "sidecar-width-decimal", "sidecar-width-null", "sidecar-width-array", "sidecar-wrong-width", + "sidecar-wrong-id", "sidecar-wrong-playlist", "sidecar-clear", "sidecar-string-coercion", + "sidecar-invalid-codec", "sidecar-empty-codec", "null-task-width", "missing-media", "missing-duration", + "zero-duration", "negative-duration", "string-duration", "decimal-duration", "decimal-task-width", + "half-up", "negative-half-up", "long-overflow", "int-overflow", + "average-overflow", "crlf", "extinf-spaces", "filename-spaces", "invalid-extinf", + "missing-extinf-comma", "trailing-extinf", "short-playlist", "signed-changed", "signed-empty", + "signed-failure", "listing-failure", "metadata-null", "metadata-failure", "file-write-failure", + "batch-write-failure", "transcode-write-failure", "missing-create-time", "missing-video")) { + cases.add(record(scenario)); + } + assertTrue(cases.getJSONObject(0).getBooleanValue("registered"), "Real AfterSave boundary must be reached"); + String serialized = JSON.toJSONString(cases, SerializerFeature.WriteMapNullValue, SerializerFeature.PrettyFormat); + String output = System.getProperty("contract.local-output.output.dir"); + if (output != null) { + Files.createDirectories(Path.of(output)); Files.writeString(Path.of(output, "cases.json"), serialized); + } else { + assertEquals(JSON.parseArray(Files.readString(Path.of("../../serverless/contracts/local-output-registration/cases.json"))), + JSON.parseArray(serialized)); + } + } finally { + cleanDatabase(); + } + } +} diff --git a/serverless/contracts/local-output-registration/cases.json b/serverless/contracts/local-output-registration/cases.json new file mode 100644 index 00000000..cb8eb6f7 --- /dev/null +++ b/serverless/contracts/local-output-registration/cases.json @@ -0,0 +1,11344 @@ +[ + { + "scenario":"legacy-ts", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":null, + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"sidecar-ts", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"fmp4", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:7\n#EXT-X-MAP:URI=\"init.mp4\"\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.m4s\n#EXTINF:2.0,\nb.m4s\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:7\n#EXT-X-MAP:URI=\"init.mp4\"\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.m4s\n#EXTINF:2.0,\nb.m4s\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.m4s":100, + "fixture/local/b.m4s":150, + "fixture/local/init.mp4":40 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.m4s", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.m4s", + "size":150 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/init.mp4", + "size":40 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":-1, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"init.mp4", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/init.mp4", + "extension":"mp4", + "size":40, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.m4s", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.m4s", + "extension":"m4s", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_2", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.m4s", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.m4s", + "extension":"m4s", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:7\n#EXT-X-MAP:URI=\"init.mp4\"\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.m4s\n#EXTINF:2.0,\nb.m4s\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1", + "f_ts_fixture_created_2" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.m4s", + "get:fixture/local/b.m4s", + "get:fixture/local/init.mp4", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"repeated-prefix", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"existing-playlist", + "key":"fixture/local/playlist.m3u8", + "fileStatus":"OLD", + "untouched":"keep" + } + ], + "tsFile":[ + { + "_id":"existing-first", + "transcodeId":"fixture-transcode", + "tsIndex":0, + "size":100, + "bitrate":123, + "untouched":"keep" + }, + { + "_id":"existing-second", + "transcodeId":"fixture-transcode", + "tsIndex":1, + "size":150, + "bitrate":456, + "untouched":"keep" + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"existing-playlist", + "key":"fixture/local/playlist.m3u8", + "fileStatus":"OLD", + "untouched":"keep" + } + ], + "tsFile":[ + { + "_id":"existing-first", + "transcodeId":"fixture-transcode", + "tsIndex":0, + "size":100, + "bitrate":123, + "untouched":"keep" + }, + { + "_id":"existing-second", + "transcodeId":"fixture-transcode", + "tsIndex":1, + "size":150, + "bitrate":456, + "untouched":"keep" + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":456, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "existing-first", + "existing-second" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "list:fixture/local/" + ], + "idPrefixes":[] + }, + { + "scenario":"existing-playlist", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"existing-playlist", + "key":"fixture/local/playlist.m3u8", + "fileStatus":"OLD", + "untouched":"keep" + } + ], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"existing-playlist", + "key":"fixture/local/playlist.m3u8", + "fileStatus":"OLD", + "untouched":"keep" + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"existing-object-id", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":{ + "$oid":"0123456789abcdef01234567" + }, + "key":"fixture/local/playlist.m3u8", + "fileStatus":"OLD", + "untouched":"keep" + } + ], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":{ + "$oid":"0123456789abcdef01234567" + }, + "key":"fixture/local/playlist.m3u8", + "fileStatus":"OLD", + "untouched":"keep" + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"existing-first", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[ + { + "_id":"existing-first", + "transcodeId":"fixture-transcode", + "tsIndex":0, + "size":100, + "bitrate":123, + "untouched":"keep" + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"existing-first", + "transcodeId":"fixture-transcode", + "tsIndex":0, + "size":100, + "bitrate":123, + "untouched":"keep" + }, + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "existing-first", + "f_ts_fixture_created_0" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_" + ] + }, + { + "scenario":"history", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[ + { + "_id":"z-historical", + "transcodeId":"fixture-transcode", + "tsIndex":9, + "size":250, + "bitrate":1000, + "untouched":"keep" + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"z-historical", + "transcodeId":"fixture-transcode", + "tsIndex":9, + "size":250, + "bitrate":1000, + "untouched":"keep" + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":1000, + "maxBitrate":1000, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "z-historical", + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"null-index-history", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[ + { + "_id":"z-historical", + "transcodeId":"fixture-transcode", + "tsIndex":null, + "size":250, + "bitrate":1000, + "untouched":"keep" + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"z-historical", + "transcodeId":"fixture-transcode", + "tsIndex":null, + "size":250, + "bitrate":1000, + "untouched":"keep" + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "z-historical", + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"null-size-history", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[ + { + "_id":"z-historical", + "transcodeId":"fixture-transcode", + "tsIndex":9, + "size":null, + "bitrate":1000, + "untouched":"keep" + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"z-historical", + "transcodeId":"fixture-transcode", + "tsIndex":9, + "size":null, + "bitrate":1000, + "untouched":"keep" + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "z-historical", + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"no-bitrates", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[ + { + "_id":"existing-first", + "transcodeId":"fixture-transcode", + "tsIndex":0, + "size":100, + "bitrate":null, + "untouched":"keep" + }, + { + "_id":"existing-second", + "transcodeId":"fixture-transcode", + "tsIndex":1, + "size":150, + "bitrate":null, + "untouched":"keep" + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"existing-first", + "transcodeId":"fixture-transcode", + "tsIndex":0, + "size":100, + "bitrate":null, + "untouched":"keep" + }, + { + "_id":"existing-second", + "transcodeId":"fixture-transcode", + "tsIndex":1, + "size":150, + "bitrate":null, + "untouched":"keep" + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "existing-first", + "existing-second" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_" + ] + }, + { + "scenario":"repeated-name", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:3.0,\na.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:3.0,\na.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":267, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":267, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":400, + "maxBitrate":267, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:3.0,\na.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/a.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"missing-summary", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":"OSS 分片登记不完整,index=0", + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_" + ] + }, + { + "scenario":"late-missing-summary", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":"OSS 分片登记不完整,index=1", + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_" + ] + }, + { + "scenario":"duplicate-basename", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + }, + { + "uploadTime":2000, + "etag":"ignored", + "storageClass":"Standard", + "key":"fixture/local/extra-one/ignored.txt", + "size":1 + }, + { + "uploadTime":2000, + "etag":"ignored", + "storageClass":"Standard", + "key":"fixture/local/extra-two/ignored.txt", + "size":1 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":"Duplicate key ignored.txt", + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_" + ] + }, + { + "scenario":"missing-segment", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":"分片缺失: a.ts", + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts" + ], + "idPrefixes":[] + }, + { + "scenario":"sidecar-read-failure", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":"fixture/local/result.json", + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"sidecar-null", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"null", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json" + ], + "idPrefixes":[] + }, + { + "scenario":"sidecar-empty", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json" + ], + "idPrefixes":[] + }, + { + "scenario":"sidecar-malformed", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json" + ], + "idPrefixes":[] + }, + { + "scenario":"sidecar-lenient", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{,,/* old */schemaVersion:1,transcodeId:'fixture-transcode',playlistFilename:'playlist.m3u8',width:1280,height:720,frameRate:'30/1',,}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30/1" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"sidecar-schema-string", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"frameRate\":\"30000/1001\",\"schemaVersion\":\"1\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\",\"dynamicRange\":\"SDR\",\"width\":1280,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"sidecar-schema-decimal", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"frameRate\":\"30000/1001\",\"schemaVersion\":1.99,\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\",\"dynamicRange\":\"SDR\",\"width\":1280,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"sidecar-schema-wrap", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"frameRate\":\"30000/1001\",\"schemaVersion\":4294967297,\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\",\"dynamicRange\":\"SDR\",\"width\":1280,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"sidecar-schema-null", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"frameRate\":\"30000/1001\",\"schemaVersion\":null,\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\",\"dynamicRange\":\"SDR\",\"width\":1280,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":"本地输出媒体参数与任务不符", + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json" + ], + "idPrefixes":[] + }, + { + "scenario":"sidecar-schema-missing", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"frameRate\":\"30000/1001\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\",\"dynamicRange\":\"SDR\",\"width\":1280,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":"本地输出媒体参数与任务不符", + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json" + ], + "idPrefixes":[] + }, + { + "scenario":"sidecar-schema-spaces", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"frameRate\":\"30000/1001\",\"schemaVersion\":\" 1 \",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\",\"dynamicRange\":\"SDR\",\"width\":1280,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json" + ], + "idPrefixes":[] + }, + { + "scenario":"sidecar-width-string", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"frameRate\":\"30000/1001\",\"schemaVersion\":1,\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\",\"dynamicRange\":\"SDR\",\"width\":\"1280\",\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"sidecar-width-decimal", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"frameRate\":\"30000/1001\",\"schemaVersion\":1,\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\",\"dynamicRange\":\"SDR\",\"width\":1280.75,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"sidecar-width-null", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"frameRate\":\"30000/1001\",\"schemaVersion\":1,\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\",\"dynamicRange\":\"SDR\",\"width\":null,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":"本地输出媒体参数与任务不符", + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json" + ], + "idPrefixes":[] + }, + { + "scenario":"sidecar-width-array", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"frameRate\":\"30000/1001\",\"schemaVersion\":1,\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\",\"dynamicRange\":\"SDR\",\"width\":[1280],\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json" + ], + "idPrefixes":[] + }, + { + "scenario":"sidecar-wrong-width", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"frameRate\":\"30000/1001\",\"schemaVersion\":1,\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\",\"dynamicRange\":\"SDR\",\"width\":1278,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":"本地输出媒体参数与任务不符", + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json" + ], + "idPrefixes":[] + }, + { + "scenario":"sidecar-wrong-id", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"frameRate\":\"30000/1001\",\"schemaVersion\":1,\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\",\"dynamicRange\":\"SDR\",\"width\":1280,\"transcodeId\":\"other-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":"本地输出媒体参数与任务不符", + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json" + ], + "idPrefixes":[] + }, + { + "scenario":"sidecar-wrong-playlist", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"frameRate\":\"30000/1001\",\"schemaVersion\":1,\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\",\"dynamicRange\":\"SDR\",\"width\":1280,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"other.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":"本地输出媒体参数与任务不符", + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json" + ], + "idPrefixes":[] + }, + { + "scenario":"sidecar-clear", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"width\":1280,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720 + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"sidecar-string-coercion", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"frameRate\":[30,1],\"schemaVersion\":1,\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\",\"dynamicRange\":{\"z\":7,\"a\":1,\"p\":2,\"emoji\":\"\\ud83d\\ude00\",\"tree\":{\"AaAaAaAaAa\":0,\"BBAaAaAaAa\":1,\"AaBBAaAaAa\":2,\"BBBBAaAaAa\":3,\"AaAaBBAaAa\":4,\"BBAaBBAaAa\":5,\"AaBBBBAaAa\":6,\"BBBBBBAaAa\":7,\"AaAaAaBBAa\":8,\"BBAaAaBBAa\":9,\"AaBBAaBBAa\":10,\"BBBBAaBBAa\":11,\"AaAaBBBBAa\":12,\"BBAaBBBBAa\":13,\"AaBBBBBBAa\":14,\"BBBBBBBBAa\":15,\"AaAaAaAaBB\":16,\"BBAaAaAaBB\":17,\"AaBBAaAaBB\":18,\"BBBBAaAaBB\":19,\"AaAaBBAaBB\":20,\"BBAaBBAaBB\":21,\"AaBBBBAaBB\":22,\"BBBBBBAaBB\":23,\"AaAaAaBBBB\":24,\"BBAaAaBBBB\":25,\"AaBBAaBBBB\":26,\"BBBBAaBBBB\":27,\"AaAaBBBBBB\":28,\"BBAaBBBBBB\":29,\"AaBBBBBBBB\":30,\"BBBBBBBBBB\":31}},\"width\":1280,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"[30,1]", + "actualDynamicRange":"{\"p\":2,\"a\":1,\"emoji\":\"😀\",\"tree\":{\"BBAaAaAaAa\":1,\"AaAaAaAaAa\":0,\"AaAaAaAaBB\":16,\"AaBBAaAaAa\":2,\"BBBBAaAaAa\":3,\"BBBBAaAaBB\":19,\"BBAaBBBBAa\":13,\"BBAaBBBBBB\":29,\"BBAaBBAaBB\":21,\"AaAaBBAaAa\":4,\"AaAaAaBBBB\":24,\"AaAaBBBBAa\":12,\"AaAaBBBBBB\":28,\"AaAaBBAaBB\":20,\"BBAaBBAaAa\":5,\"AaBBBBAaAa\":6,\"AaBBBBBBAa\":14,\"AaBBBBBBBB\":30,\"AaBBBBAaBB\":22,\"BBBBBBAaAa\":7,\"BBBBAaBBBB\":27,\"BBBBBBBBAa\":15,\"BBBBBBBBBB\":31,\"BBBBBBAaBB\":23,\"BBBBAaBBAa\":11,\"AaAaAaBBAa\":8,\"BBAaAaBBAa\":9,\"BBAaAaBBBB\":25,\"BBAaAaAaBB\":17,\"AaBBAaBBAa\":10,\"AaBBAaBBBB\":26,\"AaBBAaAaBB\":18},\"z\":7}", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"sidecar-invalid-codec", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"frameRate\":\"30000/1001\",\"schemaVersion\":1,\"hlsCodecs\":\"avc1.64001f\\n\",\"dynamicRange\":\"SDR\",\"width\":1280,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":"播放 codec 参数格式非法", + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json" + ], + "idPrefixes":[] + }, + { + "scenario":"sidecar-empty-codec", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"frameRate\":\"30000/1001\",\"schemaVersion\":1,\"hlsCodecs\":\"\",\"dynamicRange\":\"SDR\",\"width\":1280,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"height\":720}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":"播放 codec 参数格式非法", + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json" + ], + "idPrefixes":[] + }, + { + "scenario":"null-task-width", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":null, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":null, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json" + ], + "idPrefixes":[] + }, + { + "scenario":"missing-media", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":null, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":null, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"missing-duration", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":null + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":null + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"zero-duration", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":0 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":0 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"negative-duration", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":-4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":-4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":-500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"string-duration", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":"4000" + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":"4000" + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"decimal-duration", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000.75 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000.75 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"decimal-task-width", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280.75, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"half-up", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:16,\na.ts\n#EXTINF:16,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:16,\na.ts\n#EXTINF:16,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":1, + "fixture/local/b.ts":1 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":1 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":1 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":32000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":32000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":1, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":1, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":1, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":1, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":1, + "maxBitrate":1, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:16,\na.ts\n#EXTINF:16,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"negative-half-up", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:16,\na.ts\n#EXTINF:16,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:16,\na.ts\n#EXTINF:16,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":1, + "fixture/local/b.ts":1 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":-1 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":-1 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":32000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":32000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":-1, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":-1, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":-1, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":-1, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":-1, + "maxBitrate":-1, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:16,\na.ts\n#EXTINF:16,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"long-overflow", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":9223372036854775807, + "fixture/local/b.ts":9223372036854775807 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":9223372036854775807 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":9223372036854775807 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":-4, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":9223372036854775807, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":-4, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":9223372036854775807, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":-4, + "maxBitrate":-4, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"int-overflow", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":2147483647, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":2147483647 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_" + ] + }, + { + "scenario":"average-overflow", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:1000000,\na.ts\n#EXTINF:1000000,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:1000000,\na.ts\n#EXTINF:1000000,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":2000000000, + "fixture/local/b.ts":2000000000 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":2000000000 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":2000000000 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":1 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":1 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":16000, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":2000000000, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":16000, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":2000000000, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"crlf", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\r\n#EXT-X-VERSION:3\r\n#EXT-X-TARGETDURATION:4\r\n#EXTINF:2.0,\r\na.ts\r\n#EXTINF:2.0,\r\nb.ts\r\n#EXT-X-ENDLIST\r\n", + "signedPlaylist":"#EXTM3U\r\n#EXT-X-VERSION:3\r\n#EXT-X-TARGETDURATION:4\r\n#EXTINF:2.0,\r\na.ts\r\n#EXTINF:2.0,\r\nb.ts\r\n#EXT-X-ENDLIST\r\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\r\n#EXT-X-VERSION:3\r\n#EXT-X-TARGETDURATION:4\r\n#EXTINF:2.0,\r\na.ts\r\n#EXTINF:2.0,\r\nb.ts\r\n#EXT-X-ENDLIST\r\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"extinf-spaces", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n #EXTINF:2.0,\na.ts\n #EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n #EXTINF:2.0,\na.ts\n #EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n #EXTINF:2.0,\na.ts\n #EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"filename-spaces", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts \n#EXTINF:2.0,\n\tb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts \n#EXTINF:2.0,\n\tb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts \n#EXTINF:2.0,\n\tb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"invalid-extinf", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:NaN,\na.ts\n#EXTINF:NaN,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:NaN,\na.ts\n#EXTINF:NaN,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_" + ] + }, + { + "scenario":"missing-extinf-comma", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0\na.ts\n#EXTINF:2.0\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0\na.ts\n#EXTINF:2.0\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_" + ] + }, + { + "scenario":"trailing-extinf", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n#EXTINF:2.0,", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n#EXTINF:2.0,", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_" + ] + }, + { + "scenario":"short-playlist", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\na.ts\n#EXT-X-ENDLIST", + "signedPlaylist":"#EXTM3U\na.ts\n#EXT-X-ENDLIST", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_" + ] + }, + { + "scenario":"signed-changed", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":1000, + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":200, + "maxBitrate":400, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_" + ] + }, + { + "scenario":"signed-empty", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_" + ] + }, + { + "scenario":"signed-failure", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":true, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":"synthetic signed failure", + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist" + ], + "idPrefixes":[] + }, + { + "scenario":"listing-failure", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":true, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":"synthetic listing failure", + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_" + ] + }, + { + "scenario":"metadata-null", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":true, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8" + ], + "idPrefixes":[ + "f_" + ] + }, + { + "scenario":"metadata-failure", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":"fixture/local/playlist.m3u8", + "failedCall":2, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8" + ], + "idPrefixes":[ + "f_" + ] + }, + { + "scenario":"file-write-failure", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8" + ], + "idPrefixes":[ + "f_" + ] + }, + { + "scenario":"batch-write-failure", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"transcode-write-failure", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"missing-create-time", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":true, + "error":null, + "after":{ + "video":[ + { + "_id":"fixture-video", + "uploaderId":"fixture-uploader", + "videoType":"USER_UPLOAD", + "status":"TRANSCODING", + "mediaInfo":{ + "duration":4000 + }, + "untouched":"keep" + } + ], + "file":[ + { + "_id":"f_fixture_created", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "videoType":"USER_UPLOAD", + "fileStatus":"READY", + "hasLink":false, + "filename":"playlist.m3u8", + "fileType":"TRANSCODE_M3U8", + "key":"fixture/local/playlist.m3u8", + "extension":"m3u8", + "size":100, + "etag":"fixture-etag", + "provider":"ALIYUN_OSS", + "storageClass":"Standard", + "uploadTime":2000, + "createTime":"", + "updateTime":"", + "deleted":false + } + ], + "tsFile":[ + { + "_id":"f_ts_fixture_created_0", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":0, + "bitrate":400, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"a.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/a.ts", + "extension":"ts", + "size":100, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + }, + { + "_id":"f_ts_fixture_created_1", + "uploaderId":"fixture-uploader", + "videoId":"fixture-video", + "transcodeId":"fixture-transcode", + "resolution":"720p", + "tsIndex":1, + "bitrate":600, + "fileStatus":"READY", + "videoType":"USER_UPLOAD", + "filename":"b.ts", + "fileType":"TRANSCODE_TS", + "key":"fixture/local/b.ts", + "extension":"ts", + "size":150, + "etag":"fixture-etag", + "storageClass":"Standard", + "uploadTime":2000 + } + ], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "createTime":"", + "status":"TRANSCODING", + "resolution":"720p", + "averageBitrate":500, + "maxBitrate":600, + "m3u8Key":"fixture/local/playlist.m3u8", + "m3u8Content":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "tsFileIds":[ + "f_ts_fixture_created_0", + "f_ts_fixture_created_1" + ], + "actualWidth":1280, + "actualHeight":720, + "actualFrameRate":"30000/1001", + "actualDynamicRange":"SDR", + "actualCodecs":"avc1.64001f,mp4a.40.2" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist", + "get:fixture/local/playlist.m3u8", + "list:fixture/local/" + ], + "idPrefixes":[ + "f_", + "f_ts_", + "f_ts_" + ] + }, + { + "scenario":"missing-video", + "input":{ + "key":"fixture/local/playlist.m3u8", + "playlist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "signedPlaylist":"#EXTM3U\n#EXT-X-VERSION:3\n#EXT-X-TARGETDURATION:4\n#EXTINF:2.0,\na.ts\n#EXTINF:2.0,\nb.ts\n#EXT-X-ENDLIST\n", + "sidecar":"{\"schemaVersion\":1,\"transcodeId\":\"fixture-transcode\",\"playlistFilename\":\"playlist.m3u8\",\"width\":1280,\"height\":720,\"frameRate\":\"30000/1001\",\"dynamicRange\":\"SDR\",\"hlsCodecs\":\"avc1.64001f,mp4a.40.2\"}", + "failedKey":null, + "failedCall":1, + "signedFailure":false, + "listFailure":false, + "metadataNull":false, + "sizes":{ + "fixture/local/playlist.m3u8":100, + "fixture/local/a.ts":100, + "fixture/local/b.ts":150 + }, + "summaries":[ + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/playlist.m3u8", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/a.ts", + "size":100 + }, + { + "uploadTime":2000, + "etag":"fixture-etag", + "storageClass":"Standard", + "key":"fixture/local/b.ts", + "size":150 + } + ] + }, + "before":{ + "video":[], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "registered":false, + "error":null, + "after":{ + "video":[], + "file":[], + "tsFile":[], + "transcode":[ + { + "_id":"fixture-transcode", + "videoId":"fixture-video", + "provider":"LOCAL", + "resolution":"720p", + "status":"TRANSCODING", + "actualWidth":1280, + "actualHeight":720, + "createTime":1000, + "actualFrameRate":"24/1", + "actualDynamicRange":"old", + "actualCodecs":"old", + "averageBitrate":77, + "maxBitrate":99, + "m3u8Key":"fixture/local/playlist.m3u8", + "untouched":"drop-only-on-save" + } + ] + }, + "calls":[ + "get:fixture/local/result.json", + "get:fixture/local/playlist.m3u8", + "get:fixture/local/a.ts", + "get:fixture/local/b.ts", + "sign:fixture/local/playlist.m3u8:600", + "download:https://example.invalid/fixture-playlist" + ], + "idPrefixes":[ + "f_" + ] + } +] \ No newline at end of file diff --git a/serverless/src/video_serverless/adapters/local_output_json.py b/serverless/src/video_serverless/adapters/local_output_json.py new file mode 100644 index 00000000..f80bf6fb --- /dev/null +++ b/serverless/src/video_serverless/adapters/local_output_json.py @@ -0,0 +1,183 @@ +"""Lazy Fastjson getters, including HashMap iteration in stringified JSON objects.""" + +from __future__ import annotations + +import re +from dataclasses import dataclass, field +from decimal import Decimal + +from video_serverless.fastjson_input import decode_exit_object +from video_serverless.playback_json import _fast_string +from video_serverless.profile_json import _Number, _Object + + +@dataclass(eq=False) +class _Node: + name: str + value: object + hashcode: int + units: tuple[int, ...] + parent: _Node | None = None + children: list[_Node | None] = field(default_factory=lambda: [None, None]) + red: bool = True + + +def _node(name, value): + encoded = name.encode("utf-16-be", errors="surrogatepass") + units = tuple((encoded[index] << 8) | encoded[index + 1] for index in range(0, len(encoded), 2)) + hashcode = 0 + for unit in units: + hashcode = (31 * hashcode + unit) & 0xFFFFFFFF + hashcode ^= hashcode >> 16 + if hashcode >= 2**31: + hashcode -= 2**32 + return _Node(encoded.decode("utf-16-be", errors="surrogatepass"), value, hashcode, units) + + +def _rotate(root, node, direction): + pivot = node.children[1 - direction] + assert pivot is not None + node.children[1 - direction] = pivot.children[direction] + child = node.children[1 - direction] + if child is not None: + child.parent = node + pivot.parent = node.parent + if node.parent is None: + root = pivot + else: + node.parent.children[int(node is node.parent.children[1])] = pivot + pivot.children[direction] = node + node.parent = pivot + return root + + +def _insert(root, node): + if root is None: + node.red = False + return node, None + parent = root + while True: + direction = int((node.hashcode, node.units) > (parent.hashcode, parent.units)) + child = parent.children[direction] + if child is None: + parent.children[direction] = node + node.parent = parent + break + parent = child + inserted_parent = parent + while node.parent is not None and node.parent.red: + parent = node.parent + grandparent = parent.parent + assert grandparent is not None + side = int(parent is grandparent.children[1]) + uncle = grandparent.children[1 - side] + if uncle is not None and uncle.red: + parent.red = uncle.red = False + grandparent.red = True + node = grandparent + continue + if node is parent.children[1 - side]: + node = parent + root = _rotate(root, node, side) + parent = node.parent + assert parent is not None and parent.parent is not None + grandparent = parent.parent + parent.red = False + grandparent.red = True + root = _rotate(root, grandparent, 1 - side) + root.red = False + return root, inserted_parent + + +def _front(nodes, root): + nodes.remove(root) + nodes.insert(0, root) + + +def _tree(nodes): + for node in nodes: + node.parent, node.children, node.red = None, [None, None], True + root = None + for node in nodes: + root, _ = _insert(root, node) + if root is not None: + _front(nodes, root) + return root + + +def _resize(table, capacity): + result = {} + for index, (nodes, root) in table.items(): + parts = ([node for node in nodes if not node.hashcode & capacity], + [node for node in nodes if node.hashcode & capacity]) + for offset, part in enumerate(parts): + if not part: + continue + next_root = None + if root is not None and len(part) > 6: + next_root = root if len(part) == len(nodes) else _tree(part) + result[index + offset * capacity] = part, next_root + return result, capacity * 2 + + +def _entries(pairs): + table, seen, capacity = {}, {}, 16 + for name, value in pairs: + node = _node(name, value) + if node.units in seen: + seen[node.units].value = value + continue + seen[node.units] = node + index = node.hashcode & (capacity - 1) + nodes, root = table.get(index, ([], None)) + if root is None: + nodes.append(node) + else: + root, parent = _insert(root, node) + assert parent is not None + # HashMap's tree-bin chain inserts after the tree parent, not at the tail. + nodes.insert(nodes.index(parent) + 1, node) + _front(nodes, root) + table[index] = nodes, root + if root is None and len(nodes) >= 9: + if capacity < 64: + table, capacity = _resize(table, capacity) + else: + table[index] = nodes, _tree(nodes) + if len(seen) > capacity * 3 // 4: + table, capacity = _resize(table, capacity) + return [node for index in sorted(table) for node in table[index][0]] + + +def _getter_value(value): + if isinstance(value, _Object): + # JSONObject.getString uses JSONObject.toString; ordinary DTO string binding is separate. + return _Object((node.name, _getter_value(node.value)) for node in _entries(value)) + if isinstance(value, list): + return [_getter_value(item) for item in value] + if isinstance(value, str) and not isinstance(value, _Number): + return value.encode("utf-16-be", errors="surrogatepass").decode("utf-16-be", errors="surrogatepass") + return value + + +class LocalOutputSidecar: + def __init__(self, content: str): + self._fields = dict(decode_exit_object(content.encode("utf-8"))) + + def integer(self, name: str, *, primitive: bool = False) -> int | None: + value = self._fields.get(name) + if value is None or value in ("", "null", "NULL"): + return 0 if primitive else None + if isinstance(value, bool): + return int(value) + if isinstance(value, _Number): + number = int(Decimal(value)) + return (number + 2**31) % 2**32 - 2**31 + if isinstance(value, str) and re.fullmatch(r"[+-]?[0-9]+", value): + number = int(value) + if -(2**31) <= number < 2**31: + return number + raise ValueError("LOCAL sidecar integer conversion failed") + + def text(self, name: str) -> str | None: + return _fast_string(_getter_value(self._fields.get(name))) diff --git a/serverless/src/video_serverless/adapters/mongo_file_uploads.py b/serverless/src/video_serverless/adapters/mongo_file_uploads.py index f52fa31f..cdf3b285 100644 --- a/serverless/src/video_serverless/adapters/mongo_file_uploads.py +++ b/serverless/src/video_serverless/adapters/mongo_file_uploads.py @@ -27,7 +27,12 @@ def owner(self, file_id): return None if value is None else str(value) def find(self, file_id): - document = self._database_provider().file.find_one({"_id": _id(file_id)}) + return self._mapped(self._database_provider().file.find_one({"_id": _id(file_id)})) + + def find_by_key(self, key): + return self._mapped(self._database_provider().file.find_one({"key": key})) + + def _mapped(self, document): if document is None: return None now = self._clock() diff --git a/serverless/src/video_serverless/adapters/mongo_local_transcodes.py b/serverless/src/video_serverless/adapters/mongo_local_transcodes.py index 432d33ab..348730ca 100644 --- a/serverless/src/video_serverless/adapters/mongo_local_transcodes.py +++ b/serverless/src/video_serverless/adapters/mongo_local_transcodes.py @@ -3,7 +3,7 @@ from bson import Int64 from video_serverless.adapters.mongo_local_covers import MongoLocalCovers, _id -from video_serverless.adapters.mongo_users import _text +from video_serverless.adapters.mongo_users import _long, _text _FIELDS = frozenset("_id userId videoId jobId provider createTime finishTime status resolution width height " "averageBitrate maxBitrate sourceKey m3u8Key result m3u8Content tsFileIds taskId currentProvider " @@ -11,6 +11,14 @@ "actualDynamicRange actualCodecs".split()) _TEXT = frozenset("_id userId videoId jobId provider status resolution sourceKey m3u8Key m3u8Content taskId " "currentProvider errorMessage actualFrameRate actualDynamicRange actualCodecs".split()) +_INTEGERS = frozenset("width height averageBitrate maxBitrate fallbackCount actualWidth actualHeight".split()) + + +def _integer(value): + result = _long(value) + if result is not None and not -(2**31) <= result < 2**31: + raise ValueError("Legacy media integer exceeds signed integer range") + return result class MongoLocalTranscodes(MongoLocalCovers): @@ -23,6 +31,9 @@ def transcode(self, transcode_id): for name in _TEXT: if name in document: document[name] = _text(document[name]) + for name in _INTEGERS: + if name in document: + document[name] = _integer(document[name]) return document def save_transcode(self, document): diff --git a/serverless/src/video_serverless/adapters/mongo_output_registration.py b/serverless/src/video_serverless/adapters/mongo_output_registration.py new file mode 100644 index 00000000..bbb2eb5e --- /dev/null +++ b/serverless/src/video_serverless/adapters/mongo_output_registration.py @@ -0,0 +1,57 @@ +"""Existing File/Transcode mapping plus ordered TsFile inserts; no new schema, index or retries.""" + +from bson import Int64 + +from video_serverless.adapters.mongo_local_covers import _id, _without_nulls +from video_serverless.adapters.mongo_local_transcodes import MongoLocalTranscodes, _integer +from video_serverless.adapters.mongo_users import _long, _text + +_FIELDS = frozenset("_id uploaderId videoId videoType transcodeId resolution tsIndex bitrate timeLength fileStatus " + "filename fileType key extension size etag md5 acl provider storageClass uploadTime deleteTime " + "createTime updateTime deleted".split()) +_TEXT = frozenset("_id uploaderId videoId videoType transcodeId resolution fileStatus filename fileType key " + "extension etag md5 acl provider storageClass".split()) + + +def _mapped(document): + if document is None: + return None + result = {name: value for name, value in document.items() if name in _FIELDS} + for name in _TEXT: + if name in result: + result[name] = _text(result[name]) + for name in ("tsIndex", "bitrate"): + if name in result: + result[name] = _integer(result[name]) + if "size" in result: + result["size"] = _long(result["size"]) + return result + + +class MongoOutputRegistration(MongoLocalTranscodes): + def video(self, video_id): + document = super().video(video_id) + if document is not None and document.get("mediaInfo") is not None: + media = document["mediaInfo"] + if "duration" in media: + document["mediaInfo"] = media | {"duration": _long(media["duration"])} + return document + + def file_by_key(self, key): + return self._files.find_by_key(key) + + def segment(self, transcode_id, index): + return _mapped(self._collection("tsFile").find_one({"transcodeId": transcode_id, "tsIndex": index})) + + def segments(self, transcode_id): + return [_mapped(item) for item in self._collection("tsFile").find({"transcodeId": transcode_id})] + + def insert_segments(self, documents): + saved = [] + for document in documents: + row = _without_nulls({name: value for name, value in document.items() if name in _FIELDS}) + row["_id"] = _id(row["_id"]) + if "size" in row: + row["size"] = Int64(row["size"]) + saved.append(row) + self._collection("tsFile").insert_many(saved, ordered=True) diff --git a/serverless/src/video_serverless/adapters/oss_output_registration.py b/serverless/src/video_serverless/adapters/oss_output_registration.py new file mode 100644 index 00000000..6aebcef3 --- /dev/null +++ b/serverless/src/video_serverless/adapters/oss_output_registration.py @@ -0,0 +1,50 @@ +"""Explicit OSS registration reads; signed HTTP transport is supplied, never created here.""" + +from datetime import UTC, datetime + +from video_serverless.adapters.local_output_json import LocalOutputSidecar +from video_serverless.adapters.oss_output_objects import OssOutputObjects +from video_serverless.ports.local_output_registration import StoredOutput + + +def _date(value): + return None if value is None else datetime.fromtimestamp(value, UTC) + + +class OssOutputRegistration(OssOutputObjects): + def __init__(self, bucket, http_get, warning): + super().__init__(bucket) + self._http_get, self._warning = http_get, warning + + def read_sidecar(self, key): + from oss2.exceptions import OssError + + try: + content = self.read_text(key) + except (OSError, OssError) as error: + self._warning("读取对象失败 key = " + key + ": " + type(error).__name__) + return None + return None if content is None else LocalOutputSidecar(content) + + def signed_playlist(self, key): + return self._http_get(self._bucket.sign_url("GET", key, 600)) + + def metadata(self, key): + result = self._bucket.get_object(key) + if result is None: + return None + try: + return StoredOutput(key, result.content_length, result.etag, + result.headers.get("x-oss-storage-class", "Standard"), _date(result.last_modified)) + finally: + result.close() + + def list_outputs(self, prefix): + outputs, token = [], "" + while True: + page = self._bucket.list_objects_v2(prefix=prefix, continuation_token=token, max_keys=1000) + outputs.extend(StoredOutput(item.key, item.size, item.etag, item.storage_class, _date(item.last_modified)) + for item in page.object_list) + if not page.is_truncated: + return tuple(outputs) + token = page.next_continuation_token diff --git a/serverless/src/video_serverless/business/local_output_registration.py b/serverless/src/video_serverless/business/local_output_registration.py new file mode 100644 index 00000000..07712c21 --- /dev/null +++ b/serverless/src/video_serverless/business/local_output_registration.py @@ -0,0 +1,174 @@ +"""The legacy LOCAL prefix: validate and persist outputs, never finalize a video or dispatch work.""" + +from dataclasses import dataclass +from decimal import Decimal +from typing import Callable + +from video_serverless.business.hls import _lines, _trim, init_segment_uri +from video_serverless.business.output_validation import OutputValidation +from video_serverless.ports.local_covers import CoverClock, CoverIds +from video_serverless.ports.local_output_registration import RegistrationObjects, RegistrationStore, StoredOutput +from video_serverless.ports.output_validation import OutputManifest + + +def _basename(key): + return key[max(key.rfind("/"), key.rfind("\\")) + 1:] + + +def _folder(key): + return key[:max(key.rfind("/"), key.rfind("\\")) + 1] + + +def _long(value): + return (value + 2**63) % 2**64 - 2**63 + + +def _bitrate(size, duration): + # Java wraps the long multiplication, then rounds the exact quotient to scale zero. + numerator, denominator = duration.as_integer_ratio() + if numerator == 0: + raise ZeroDivisionError("Zero media duration") + dividend = _long(size * 8) * denominator + quotient, remainder = divmod(abs(dividend), abs(numerator)) + result = (quotient + (remainder * 2 >= abs(numerator))) * (-1 if (dividend < 0) != (numerator < 0) else 1) + if not -(2**31) <= result < 2**31: + raise OverflowError("Legacy bitrate exceeds signed integer range") + return result + + +def _durations(content): + lines = _lines(content) + # The original preallocates an ArrayList with (lineCount - 5) / 2. + if len(lines) < 4: + raise ValueError("Invalid legacy playlist capacity") + durations = {} + for index, line in enumerate(lines): + if line.startswith("#EXTINF:"): + if "," not in line: + raise ValueError("Missing EXTINF comma") + text = line[len("#EXTINF:"):line.index(",")] + duration = Decimal(text) + if not duration.is_finite() or "_" in text or any(char.isspace() for char in text): + raise ValueError("Invalid EXTINF duration") + durations[lines[index + 1]] = duration + return durations + + +def _object_fields(output: StoredOutput): + name = _basename(output.key) + return {"key": output.key, "filename": name, "extension": name.rsplit(".", 1)[1] if "." in name else "", + "size": output.size, "etag": output.etag, "storageClass": output.storage_class, + "uploadTime": output.upload_time} + + +def _dimension(expected, actual): + if expected is None: + raise ValueError("LOCAL task dimension is null") + return expected == actual + + +@dataclass(frozen=True) +class LocalOutputRegistration: + store: RegistrationStore + objects: RegistrationObjects + ids: CoverIds + clock: CoverClock + warning: Callable[[str], None] + + def register(self, transcode: dict) -> None: + key = transcode["m3u8Key"] + sidecar = self.objects.read_sidecar(_folder(key) + "result.json") + if sidecar is not None: + if (sidecar.integer("schemaVersion", primitive=True) != 1 + or transcode["_id"] != sidecar.text("transcodeId") + or _basename(key) != sidecar.text("playlistFilename") + or not _dimension(transcode.get("actualWidth"), sidecar.integer("width")) + or not _dimension(transcode.get("actualHeight"), sidecar.integer("height"))): + raise RuntimeError("本地输出媒体参数与任务不符") + transcode["actualWidth"] = sidecar.integer("width") + transcode["actualHeight"] = sidecar.integer("height") + transcode["actualFrameRate"] = sidecar.text("frameRate") + transcode["actualDynamicRange"] = sidecar.text("dynamicRange") + codecs = sidecar.text("hlsCodecs") + if codecs is not None and (not codecs or any(char not in + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.," for char in codecs)): + raise RuntimeError("播放 codec 参数格式非法") + transcode["actualCodecs"] = codecs + error = OutputValidation(self.objects).validate(key, OutputManifest(key)) + if error is not None: + raise RuntimeError(error) + video = self.store.video(transcode["videoId"]) + self._playlist(video, transcode) + self._segments(video, transcode) + + def _playlist(self, video, transcode): + key = transcode["m3u8Key"] + transcode["m3u8Content"] = self.objects.signed_playlist(key) + if self.store.file_by_key(key) is not None: + return + now = self.clock() + file_id = self.ids.long_id("f_") + if video is None: + raise ValueError("Video does not exist") + document = {"_id": file_id, "createTime": now, "updateTime": now, "deleted": False, + "fileStatus": "READY", "provider": "ALIYUN_OSS", "hasLink": False, + "key": key, "fileType": "TRANSCODE_M3U8", "videoId": video["_id"], + "videoType": video.get("videoType"), "uploaderId": video.get("uploaderId")} + metadata = self.objects.metadata(key) + if metadata is None: + raise ValueError("Playlist object does not exist") + document.update(_object_fields(metadata)) + if file_id is None: + raise ValueError("m3u8File id is null") + self.store.save_file(document) + + def _segment(self, video, transcode, index, duration, output): + if self.store.segment(transcode["_id"], index) is not None: + return None + if output is None: + raise RuntimeError("OSS 分片登记不完整,index=" + str(index)) + file_id = self.ids.long_id("f_ts_") + if video is None: + raise ValueError("Video does not exist") + document = {"_id": file_id, "fileStatus": "READY", "fileType": "TRANSCODE_TS", + "uploaderId": video.get("uploaderId"), "videoId": video["_id"], "videoType": video.get("videoType"), + "transcodeId": transcode["_id"], "resolution": transcode.get("resolution"), "tsIndex": index} + document.update(_object_fields(output)) + if duration is not None and document.get("size") is not None: + document["bitrate"] = _bitrate(document["size"], duration) + return document + + def _segments(self, video, transcode): + outputs = {} + for output in self.objects.list_outputs(_folder(transcode["m3u8Key"])): + name = _basename(output.key) + if name in outputs: + raise RuntimeError("Duplicate key " + name) + outputs[name] = output + content = transcode["m3u8Content"] + names = [_trim(line) for line in _lines(content) if _trim(line) and not _trim(line).startswith("#")] + durations = _durations(content) + new_files = [] + init = init_segment_uri(content) + if init is not None: + new_files.append(self._segment(video, transcode, -1, None, outputs.get(init))) + for index, name in enumerate(names): + new_files.append(self._segment(video, transcode, index, durations.get(name), outputs.get(name))) + new_files = [item for item in new_files if item is not None and item.get("_id") is not None] + if new_files: + self.store.insert_segments(new_files) + all_files = self.store.segments(transcode["_id"]) + transcode["tsFileIds"] = [item.get("_id") for item in all_files] + segments = [item for item in all_files if item.get("tsIndex") is not None + and item["tsIndex"] >= 0 and item.get("size") is not None] + if segments and video is None: + raise ValueError("Video does not exist") + media = None if video is None else video.get("mediaInfo") + if segments and media is not None and media.get("duration") is not None: + transcode["averageBitrate"] = _bitrate(_long(sum(item["size"] for item in segments)), + Decimal(str(media["duration"]) + "e-3")) + transcode["maxBitrate"] = max((item["bitrate"] for item in segments + if item.get("bitrate") is not None), default=None) + else: + self.warning("缺少时长或分片数据,跳过码率计算 transcodeId = " + transcode["_id"]) + self.store.save_transcode(transcode) diff --git a/serverless/src/video_serverless/local_output_bootstrap.py b/serverless/src/video_serverless/local_output_bootstrap.py new file mode 100644 index 00000000..796283bf --- /dev/null +++ b/serverless/src/video_serverless/local_output_bootstrap.py @@ -0,0 +1,13 @@ +"""Opt-in internal registration only; no HTTP routes, environment reads or cloud-client creation.""" + +import logging + +from video_serverless.adapters.mongo_output_registration import MongoOutputRegistration +from video_serverless.adapters.oss_output_registration import OssOutputRegistration +from video_serverless.business.local_output_registration import LocalOutputRegistration + + +def build_local_output_registration(database_provider, bucket, http_get, ids, clock): + warning = logging.getLogger(__name__).warning + return LocalOutputRegistration(MongoOutputRegistration(database_provider, clock), + OssOutputRegistration(bucket, http_get, warning), ids, clock, warning) diff --git a/serverless/src/video_serverless/ports/local_output_registration.py b/serverless/src/video_serverless/ports/local_output_registration.py new file mode 100644 index 00000000..4bdf481c --- /dev/null +++ b/serverless/src/video_serverless/ports/local_output_registration.py @@ -0,0 +1,38 @@ +"""Ordinary LOCAL registration values and capabilities; completion belongs to its caller.""" + +from dataclasses import dataclass +from datetime import datetime +from typing import Protocol + +from video_serverless.ports.output_validation import OutputObjects + + +@dataclass(frozen=True) +class StoredOutput: + key: str + size: int + etag: str | None + storage_class: str | None + upload_time: datetime | None + + +class OutputSidecar(Protocol): + def integer(self, name: str, *, primitive: bool = False) -> int | None: ... + def text(self, name: str) -> str | None: ... + + +class RegistrationObjects(OutputObjects, Protocol): + def read_sidecar(self, key: str) -> OutputSidecar | None: ... + def signed_playlist(self, key: str) -> str: ... + def metadata(self, key: str) -> StoredOutput | None: ... + def list_outputs(self, prefix: str) -> tuple[StoredOutput, ...]: ... + + +class RegistrationStore(Protocol): + def video(self, video_id: str) -> dict | None: ... + def file_by_key(self, key: str) -> dict | None: ... + def segment(self, transcode_id: str, index: int) -> dict | None: ... + def segments(self, transcode_id: str) -> list[dict]: ... + def save_file(self, document: dict) -> None: ... + def insert_segments(self, documents: list[dict]) -> None: ... + def save_transcode(self, document: dict) -> None: ... diff --git a/serverless/tests/test_local_output_registration.py b/serverless/tests/test_local_output_registration.py new file mode 100644 index 00000000..6c5ad96f --- /dev/null +++ b/serverless/tests/test_local_output_registration.py @@ -0,0 +1,213 @@ +"""Real Java internal-prefix BSON, object ordering, ordered partial writes and isolated assembly.""" + +import json +from pathlib import Path +from types import SimpleNamespace + +import pytest +from bson import Int64 +from test_local_covers import NOW +from test_user_mongo_reads import isolated_database as isolated_database +from test_video_reactions import normalize, restore + +from video_serverless.adapters.mongo_output_registration import MongoOutputRegistration +from video_serverless.business.local_output_registration import LocalOutputRegistration +from video_serverless.local_output_bootstrap import build_local_output_registration + +CASES = json.loads((Path(__file__).parents[1] / "contracts/local-output-registration/cases.json") + .read_text(encoding="utf-8")) +COLLECTIONS = ("video", "file", "tsFile", "transcode") + + +class Ids: + def __init__(self): + self.prefixes, self.index = [], 0 + + def long_id(self, prefix): + self.prefixes.append(prefix) + if prefix == "f_": + return "f_fixture_created" + assert prefix == "f_ts_" + result = "f_ts_fixture_created_" + str(self.index) + self.index += 1 + return result + + +class Bucket: + def __init__(self, case): + self.input, self.calls, self.opened, self.closed, self.reads = case["input"], [], [], [], [] + + def get_object(self, key): + self.calls.append("get:" + key) + count = self.calls.count("get:" + key) + if key == self.input["failedKey"] and count == self.input["failedCall"]: + raise OSError("synthetic object failure") + if key == self.input["key"] and count == 2 and self.input["metadataNull"]: + return None + sidecar = key.endswith("result.json") + content = self.input["sidecar"] if sidecar else self.input["playlist"] if key == self.input["key"] else "x" + if content is None or (not sidecar and key not in self.input["sizes"]): + return None + self.opened.append(key) + bucket = self + + class Result: + content_length = len(content) if sidecar else bucket.input["sizes"][key] + etag, last_modified, headers = "fixture-etag", 2, {"x-oss-storage-class": "Standard"} + + def read(self): + bucket.reads.append(key) + return content.encode() + + def close(self): + bucket.closed.append(key) + + return Result() + + def sign_url(self, method, key, seconds): + assert method == "GET" + self.calls.append("sign:" + key + ":" + str(seconds)) + return "https://example.invalid/fixture-playlist" + + def http_get(self, url): + self.calls.append("download:" + url) + if self.input["signedFailure"]: + raise RuntimeError("synthetic signed failure") + return self.input["signedPlaylist"] + + def list_objects_v2(self, *, prefix, continuation_token, max_keys): + self.calls.append("list:" + prefix) + assert continuation_token == "" and max_keys == 1000 + if self.input["listFailure"]: + raise RuntimeError("synthetic listing failure") + items = [SimpleNamespace(key=item["key"], size=item["size"], etag=item["etag"], + storage_class=item["storageClass"], last_modified=item["uploadTime"] / 1000) + for item in self.input["summaries"]] + return SimpleNamespace(object_list=items, is_truncated=False) + + +@pytest.fixture +def database(isolated_database): + for name in (*COLLECTIONS, "fcTask", "requestLog", "exceptionLog"): + isolated_database.drop_collection(name) + return isolated_database + + +def seed(database, case): + for name, documents in restore(case["before"]).items(): + for document in documents: + if name == "video" and document.get("mediaInfo") is not None: + media = document["mediaInfo"] + if isinstance(media.get("duration"), int): + media["duration"] = Int64(media["duration"]) + if name == "tsFile" and document.get("size") is not None: + document["size"] = Int64(document["size"]) + if documents: + database[name].insert_many(documents) + rules = { + "file-write-failure": ("file", {"fileStatus": "REJECT"}), + "batch-write-failure": ("tsFile", {"tsIndex": {"$ne": 1}}), + "transcode-write-failure": ("transcode", {"m3u8Content": {"$exists": False}}), + } + if case["scenario"] in rules: + collection, rule = rules[case["scenario"]] + if collection not in database.list_collection_names(): + database.create_collection(collection) + database.command({"collMod": collection, "validator": rule}) + + +def state(database): + return {name: list(database[name].find().sort("_id", 1)) for name in COLLECTIONS} + + +@pytest.mark.parametrize("case", CASES, ids=lambda row: row["scenario"]) +def test_real_legacy_prefix_complete_bson_failures_and_object_order(database, case, caplog): + seed(database, case) + assert normalize(state(database), {}) == case["before"] + bucket, ids = Bucket(case), Ids() + registration = build_local_output_registration(lambda: database, bucket, bucket.http_get, ids, lambda: NOW) + transcode = MongoOutputRegistration(lambda: database, lambda: NOW).transcode("fixture-transcode") + if case["registered"]: + registration.register(transcode) + else: + with pytest.raises(Exception) as raised: + registration.register(transcode) + if case["error"] is not None: + assert str(raised.value) == case["error"] + assert normalize(state(database), {}) == case["after"] + assert bucket.calls == case["calls"] + assert ids.prefixes == case["idPrefixes"] + assert bucket.closed == bucket.opened + assert all(key == case["input"]["key"] or key.endswith("result.json") for key in bucket.reads) + for name in ("file", "tsFile"): + for document in database[name].find({"fileStatus": "READY"}): + assert isinstance(document["size"], Int64) + for name in ("fcTask", "requestLog", "exceptionLog"): + assert database[name].count_documents({}) == 0 + if case["scenario"] == "sidecar-read-failure": + assert "读取对象失败" in caplog.text + if case["scenario"] in {"missing-media", "missing-duration"}: + assert "跳过码率计算" in caplog.text + + +@pytest.mark.parametrize("scenario", ["sidecar-ts", "fmp4", "history"]) +def test_sequential_registration_preserves_all_existing_files_and_repository_order(database, scenario): + case = next(row for row in CASES if row["scenario"] == scenario) + seed(database, case) + bucket, ids = Bucket(case), Ids() + registration = build_local_output_registration(lambda: database, bucket, bucket.http_get, ids, lambda: NOW) + store = MongoOutputRegistration(lambda: database, lambda: NOW) + registration.register(store.transcode("fixture-transcode")) + first_state, first_ids = state(database), ids.prefixes.copy() + registration.register(store.transcode("fixture-transcode")) + assert state(database) == first_state + assert ids.prefixes == first_ids + assert bucket.calls.count("get:" + case["input"]["key"]) == 3 + assert sum(call.startswith("download:") for call in bucket.calls) == 2 + assert database.transcode.find_one()["status"] == "TRANSCODING" + assert "finishTime" not in database.transcode.find_one() + if scenario == "history": + assert database.transcode.find_one()["tsFileIds"][0] == "z-historical" + + +@pytest.mark.parametrize("failure", ["save_file", "insert_segments", "save_transcode"]) +def test_storage_failure_is_not_replayed_or_compensated(database, failure): + case = next(row for row in CASES if row["scenario"] == "sidecar-ts") + seed(database, case) + bucket, ids, calls = Bucket(case), Ids(), [] + registration = build_local_output_registration(lambda: database, bucket, bucket.http_get, ids, lambda: NOW) + inner = MongoOutputRegistration(lambda: database, lambda: NOW) + operations = ["save_file", "insert_segments", "save_transcode"] + + class Store: + def __getattr__(self, name): + method = getattr(inner, name) + if name not in operations: + return method + + def write(value): + calls.append(name) + if name == failure: + raise RuntimeError("synthetic registration persistence failure") + return method(value) + return write + + registration = LocalOutputRegistration(Store(), registration.objects, ids, lambda: NOW, + lambda message: pytest.fail(message)) + with pytest.raises(RuntimeError, match="synthetic registration persistence failure"): + registration.register(inner.transcode("fixture-transcode")) + assert calls == operations[:operations.index(failure) + 1] + assert database.file.count_documents({}) == (failure != "save_file") + assert database.tsFile.count_documents({}) == (2 if failure == "save_transcode" else 0) + assert normalize(state(database)["transcode"], {}) == case["before"]["transcode"] + + +def test_internal_factory_constructs_no_clients_and_touches_no_dependency(): + def unexpected(*args, **kwargs): + pytest.fail("Internal factory must be lazy") + + class Unused: + def __getattr__(self, name): + unexpected() + + build_local_output_registration(unexpected, Unused(), unexpected, Unused(), unexpected) diff --git a/serverless/tests/test_oss_output_registration.py b/serverless/tests/test_oss_output_registration.py new file mode 100644 index 00000000..7d02263c --- /dev/null +++ b/serverless/tests/test_oss_output_registration.py @@ -0,0 +1,107 @@ +"""Explicit object SDK boundaries, all pages, closed streams and only recoverable optional reads.""" + +from datetime import UTC, datetime +from types import SimpleNamespace + +import pytest + +from video_serverless.adapters.oss_output_registration import OssOutputRegistration + + +def test_all_1000_key_pages_include_sidecar_and_nonmedia_without_filtering(): + calls = [] + + class Bucket: + def list_objects_v2(self, **parameters): + calls.append(parameters) + first = parameters["continuation_token"] == "" + names = [str(index) + ".ts" for index in range(999)] + ["result.json"] if first else ["notes.txt"] + return SimpleNamespace( + object_list=[SimpleNamespace(key="fixture/" + name, size=1, etag="fixture-etag", + storage_class="Archive", last_modified=2) for name in names], + is_truncated=first, next_continuation_token="second-page", + ) + + outputs = OssOutputRegistration(Bucket(), None, None).list_outputs("fixture/") + assert len(outputs) == 1001 and outputs[-2].key == "fixture/result.json" and outputs[-1].key == "fixture/notes.txt" + assert outputs[-1].storage_class == "Archive" + assert outputs[-1].upload_time == datetime(1970, 1, 1, 0, 0, 2, tzinfo=UTC) + assert calls == [{"prefix": "fixture/", "continuation_token": token, "max_keys": 1000} + for token in ("", "second-page")] + + +def test_later_page_failure_is_not_returned_as_a_successful_partial_listing(): + calls = [] + + class Bucket: + def list_objects_v2(self, **parameters): + calls.append(parameters["continuation_token"]) + if len(calls) == 2: + raise OSError("synthetic second-page failure") + return SimpleNamespace(object_list=[], is_truncated=True, next_continuation_token="second") + + with pytest.raises(OSError, match="synthetic second-page failure"): + OssOutputRegistration(Bucket(), None, None).list_outputs("fixture/") + assert calls == ["", "second"] + + +@pytest.mark.parametrize("failed", [False, True]) +def test_metadata_reads_headers_without_media_body_and_always_closes(failed): + closed = [] + + class Result: + content_length, last_modified, headers = 123, 2, {} + + @property + def etag(self): + if failed: + raise OSError("synthetic metadata failure") + return "fixture-etag" + + def read(self): + pytest.fail("Metadata must not buffer media") + + def close(self): + closed.append(True) + + bucket = SimpleNamespace(get_object=lambda key: Result()) + objects = OssOutputRegistration(bucket, None, None) + if failed: + with pytest.raises(OSError, match="synthetic metadata failure"): + objects.metadata("fixture/playlist.m3u8") + else: + metadata = objects.metadata("fixture/playlist.m3u8") + assert metadata.size == 123 and metadata.storage_class == "Standard" + assert closed == [True] + + +@pytest.mark.parametrize("kind", ["io", "sdk", "programming"]) +def test_optional_sidecar_warns_only_for_known_read_failures_and_surfaces_programming_errors(kind): + from oss2.exceptions import OssError + + warnings = [] + error = {"io": OSError("synthetic read failure"), "sdk": OssError(503, {}, b"synthetic read failure", {}), + "programming": RuntimeError("synthetic programming failure")}[kind] + + class Bucket: + def get_object(self, key): + raise error + + objects = OssOutputRegistration(Bucket(), None, warnings.append) + if kind == "programming": + with pytest.raises(RuntimeError, match="synthetic programming failure"): + objects.read_sidecar("fixture/result.json") + assert not warnings + else: + assert objects.read_sidecar("fixture/result.json") is None + assert len(warnings) == 1 and "读取对象失败" in warnings[0] + + +@pytest.mark.parametrize("text", ["null", "{"]) +def test_sidecar_parse_failure_is_not_treated_as_optional_absence(text): + closed, warnings = [], [] + result = SimpleNamespace(read=lambda: text.encode(), close=lambda: closed.append(True)) + objects = OssOutputRegistration(SimpleNamespace(get_object=lambda key: result), None, warnings.append) + with pytest.raises(ValueError): + objects.read_sidecar("fixture/result.json") + assert closed == [True] and not warnings