如何用vlc或其他东西播放mp4文件的随机部分?

发布于 2024-12-03 14:18:33 字数 272 浏览 0 评论 0原文

我有 mp4 文件的随机部分(99.9% 位于中间)。问题是它不在任何容器或任何东西中,只是随机偏移的文件的二进制部分并发送给我......它会继续增长,但需要一段时间,我需要立即播放内容。

在开始接收这些二进制数据之前,我可以从其他来源获取该文件的所有必要元数据信息,但是:

  1. 如何做到这一点?我的意思是我需要什么标头以及如何获取它们? 以及
  2. 稍后如何告诉 vlc (或其他播放器)该 moov 原子(或其他一些数据)应该用于文件的这一部分并开始播放?

I have random part (99,9% somewhere in the middle) of the mp4 file. Problem is that it's not in any container or anything just a binary piece of the file in random offset and send to me... it will keep growing but it'll take a while and I need to play content right away.

I can get all necessary metadata information for that file from other source before I even start receiving those binary data, but:

  1. How to do this? I mean what headers do I need and how to get them?
    and
  2. How to later tell vlc (or maybe some other player) that this moov atom (or some other data) that it should use for this part of the file and start playing it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只是偏爱你 2024-12-10 14:18:33

好的,我已经这样解决了(肮脏的解决方法):
从原始文件中复制 moov 部分(只是寻找这个原子),并创建原始大小的文件,并用零和元数据部分填充。我只是简单地运行播放器并跳到已经下载的部分。
(仍然存在如何根据二进制偏移量找到跳转位置的问题,但文件的比例似乎可以很好地工作,但是关键帧经常丢失,并且伪影会持续很长一段时间,而且颜色也会关闭几秒钟)

但我仍然对更优雅的解决方案感兴趣。

OK, I've solved it like this (dirty workaround):
Coppied the moov part (just looking for this atom) from oryginal file and created the file of the oryginal size filling with zeros and the metadata parts. Than I'm simply running player and jump with it to part that is already downloaded.
(still having problems how to find where to jump based on binary offset, but proportions of files seems to work quite ok with it, however the keyframe is often lost and artefacts are for quite some time, also the color is off for few seconds)

But I'm still interested with more elegant solutions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文