TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The skater punk’s guide to MediaRecorder

40 点作者 davekiss大约 3 年前

1 comment

j1elo大约 3 年前
The MiniDV analogy is a really good one for explaining how <i>MediaRecorder</i> works, but also a good one to explain why it is a poorly designed API.<p>The video needs to be stored for its consumption, like any video, in a container format (like MP4 or Matroska) and these formats more often than not, require to <i>revise</i> what was initially written and rewrite some chunks when the recording has finished up. (I&#x27;m talking here about e.g. metadata that goes at the beginning of the file but the actual values cannot be known until the file is complete)<p>I wonder how you guys at Mux handle this limitation of the API; do you store the recorded videos at all on file?<p>You would think an API meant to generate some type of video, would be ready to <i>properly</i> do it, right? Or as someone put in a way that made me laugh (from the Chrome bug report, linked below at [1]),<p>&gt; <i>I don&#x27;t think any developer out here would ever mark a broken piece of code as &quot;won&#x27;t fix&quot;</i><p>The reality is that everybody looks away. Chrome produces broken files [1] that are not seekable, and when asked about it they shrug and say that the spec itself is meant to be that way, and that you should use an external tool to fix the files (which is also broken for that use case! so not really a solution at all [2]). Firefox has the same problem but doesn&#x27;t look like they progressed much either [3].<p>Meanwhile, yeah the spec is as it is and the issue as of today seems to be open [4].<p>So be aware of this flaw if you&#x27;ll be intending to use <i>MediaRecorder</i> to actually store your videos into file (which seems quite reasonable that anyone would do)<p>[1] <a href="https:&#x2F;&#x2F;bugs.chromium.org&#x2F;p&#x2F;chromium&#x2F;issues&#x2F;detail?id=642012" rel="nofollow">https:&#x2F;&#x2F;bugs.chromium.org&#x2F;p&#x2F;chromium&#x2F;issues&#x2F;detail?id=642012</a><p>[2] <a href="https:&#x2F;&#x2F;trac.ffmpeg.org&#x2F;ticket&#x2F;6386" rel="nofollow">https:&#x2F;&#x2F;trac.ffmpeg.org&#x2F;ticket&#x2F;6386</a><p>[3] <a href="https:&#x2F;&#x2F;bugzilla.mozilla.org&#x2F;show_bug.cgi?id=1283464" rel="nofollow">https:&#x2F;&#x2F;bugzilla.mozilla.org&#x2F;show_bug.cgi?id=1283464</a><p>[4] <a href="https:&#x2F;&#x2F;github.com&#x2F;w3c&#x2F;mediacapture-record&#x2F;issues&#x2F;119" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;w3c&#x2F;mediacapture-record&#x2F;issues&#x2F;119</a>
评论 #31007024 未加载