VideoDecoder output guarantees
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 领域
- api, audio-video-rtc
调研方向
首先阅读 VideoDecoder 规范中涵盖 output、flush 和 optimizeForLatency 的章节。将它们的预期行为与 issue 650、698 和 206 中链接的讨论进行比较,包括 hardware acceleration 问题。完成的标准是:该 issue 记录调用方是否能够知道何时需要更多数据包、延迟优化如何影响输出,以及有哪些相关的性能权衡。
由索引模型根据 Issue 内容生成。
描述
My use case requires me to decode multiple video streams at the same time. The source files can be of extremely high bitrate, 4K videos, so I would like to be mindful of how I use the GPU.
My root issue is that I cannot find any guarantee of when I might receive a frame or when I need to send more data to the decoder. If I investigate the packets and check the P or B frames, I see no reason why a packet would not be sent to the output. When I call flush I receive frames in the output perfectly.
Based on that experience, I thought I could decode GOPs, then call flush. In terms of decoding the bare minimum it's far from optimal, but at least it gives me some guarantee of when I can receive a frame. However, this is not trivial to do either since I work with libav under the hood, what I consider a keyframe might not be accepted by WebCodecs. Same issue as described here. The idea of flush without invalidating whatever inner state it has seemed like a good idea to me.
The answer to my question could be the optimizeForLatency, as in the specification it seems to do exactly what I want. However, as I read the threads here, I am now confused on what it does and what it doesn't. As @dalecurtis mentioned here, in Chromium, this flag does not affect flush directly, just omits using threading which can hold back frames. According to another thread though, I got the impression this only applies to software decoders, not hardware-accelerated ones. Does this have an effect in hw-accelerated decoding? If so, what are the performance drawbacks to consider?
Very different in nature but what I love about FFmpeg/libav is that this is very trivial to do:
int ret = avcodec_receive_frame(decoder->codec_ctx, decoder->frame);
if (ret == AVERROR(EAGAIN)) {
// I know the decoder needs more frames before it can give me something
}
To summarize, my question is how can I have a guarantee that I passed enough packets (or how can I know for sure that I didn't ) to the VideoDecoder to surely have an output? Ideally, I want to decode the smallest amount possible for a guaranteed output.
- 主要语言
- HTML
- 星标
- 1.3k
- 派生
- 192
- 平均合并
- 14 小时 40 分钟
- 30 天内合并 PR
- 8
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
w3c/webcodecs 的其他 Issue
-
privacy-needs-resolution
难度 1/5 1 小时以内 新手友好度 65/100
维护者通常 1 天内回复
-
editorial
难度 1/5 1 小时以内 新手友好度 68/100
维护者通常 1 天内回复
-
TPAC2026
难度 5/5 一周以上 新手友好度 8/100
维护者通常 1 天内回复
-
VideoFrame.copyTo is manipulating JS objects in a background queue可能已有人在做 @Djuffin 于 5 天前认领。 未关闭CR Blocking PR exists
难度 5/5 一周以上 新手友好度 30/100
w3c/webcodecs#955 · 8 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
ColorSpace override is not well defined可能已有人在做 @dalecurtis 于 38 天前认领。 未关闭agenda CR Blocking PR exists
w3c/webcodecs#940 · 25 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
Yeachan-Heo/gajae-code#6611 · 1 条评论 ·
维护者通常 1 天内回复
-
llm translation
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
area: storage maintenance priority: low status: accepted
难度 2/5 1-3 小时 新手友好度 86/100
amatya-aditya/obsidian-rss-dashboard#1019 ·
维护者通常 1 天内回复