如何用vlc或其他东西播放mp4文件的随机部分?
我有 mp4 文件的随机部分(99.9% 位于中间)。问题是它不在任何容器或任何东西中,只是随机偏移的文件的二进制部分并发送给我......它会继续增长,但需要一段时间,我需要立即播放内容。
在开始接收这些二进制数据之前,我可以从其他来源获取该文件的所有必要元数据信息,但是:
- 如何做到这一点?我的意思是我需要什么标头以及如何获取它们? 以及
- 稍后如何告诉 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:
- How to do this? I mean what headers do I need and how to get them?
and - 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我已经这样解决了(肮脏的解决方法):
从原始文件中复制 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.