如何在mp4视频文件中添加MOOV原子 [英] How to add a MOOV atom in a mp4 video file

查看:1808
本文介绍了如何在mp4视频文件中添加MOOV原子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用android中的实时设备到服务器流。我可以在服务器上以字节为单位发送数据,但是当我在服务器 VLC 上录制期间播放该文件时,表示未找到 MOOV 原子。经过大量的解决方法后,我发现mp4文件的 MOOV 原子最终生成了。但我必须在服务器上播放该文件,而录制意味着直播。我浏览了 SPYDROID SIPDROID 的源代码,但是没有它们正在运行。我尝试使用 FFMPEG 在服务器端添加move atom,但没有取得任何成功。任何人都知道如何实现这一目标。提前完成。

I am working on live device to server streaming in android. I am able to send data in bytes on server but when i play that file during recording on server VLC say that MOOV atom not found. After a lot of workaround i found that MOOV atom of a mp4 file generates in the end. But i have to play that file on server while recording means live. I go through the source code of SPYDROID and SIPDROID but non of them is working. I tried to add move atom on serverside using FFMPEG but didn't get any success. Any one have any idea how can i achieve this. Thanx in advance.

推荐答案

你遇到了问题。 'moov'框是一种目录。如果不是所有内容都存在,则无法获得完整的目录。哎哟!

You got a problem. The 'moov' box is a kind of table of contents. If not all content is there you can't have a complete table of contents. Ouch!

如果你想坚持使用MP4,如果你自己编写文件,你可以把文件写成所谓的碎片MP4文件。碎片化的MP4文件包含多个独立的小视频片段 - 每个片段都有自己的目录。它将使您能够在完成录制完成之前播放文件。

If you want to stick with MP4 and if you are writing the file by yourself you could write the file as so called fragmented MP4 file. A fragmented MP4 file contains multiple self-contained small pieces of the video - each with its own table of contents. It would enable you to play the file before the complete recording has finished.

如果您不需要坚持使用MP4,则可以选择编写原始h264流到服务器。那你没有那种内容表。 VLC可以播放原始h264流。

If you don't need to stick with MP4 an option would be to write the raw h264 stream to the server. Then you don't have that kind of table of content. VLC can play raw h264 streams.

这篇关于如何在mp4视频文件中添加MOOV原子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆