在二进制中编辑MP4标头信息 [英] Edit MP4 Header Information In Binary

查看:227
本文介绍了在二进制中编辑MP4标头信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个持续时间为10秒,小于1MB的小型MP4文件。我可以在HexEdit中打开文件来查看其二进制源。但是我无法弄清楚它的头信息在这个二进制文件中的位置。

我基本上想要做的是将这个MP4的持续时间改为20秒。我知道它是一个只读属性,这就是我试图编辑其二进制数据以更新持续时间的原因。
任何帮助都将非常感谢。谢谢.. !!



查看HexEdit截图中的二进制源代码 [ ^ ]



查看ffprobe输出 [ ^ ]

I have a small MP4 file of duration 10 seconds, less than 1MB. I am able to open the file in HexEdit to view its binary source. But I am not able to figure out where does its header information is in this binary file.
What I basically want to do is change the duration of this MP4 to say like 20 seconds. I know its a read only attribute and thats the reason why I am trying to edit its binary data to update the duration.
Any help would be greatly appreciated. Thanks..!!

See binary source in HexEdit screenshot[^]

See ffprobe output[^]

推荐答案

请参阅我对该问题的评论,其中我已经试着向你解释事物的本质。由于问题的复杂性,我当然不能给你整个解决方案;我只能告诉你从什么开始:你必须先找出你正在处理的事情。 MP4并没有说明它是什么。



但这一步很简单。找到的最佳工具是FFmpeg或libavcodec实用程序。更确切地说,这是提供的实用程序之一:ffProbe.exe。有基于libav构建的类似实用程序。请参阅:

http://en.wikipedia.org/wiki/Ffmpeg [< a href =http://en.wikipedia.org/wiki/Ffmpegtarget =_ blanktitle =New Window> ^ ],

http://ffmpeg.org/ [ ^ ],

http://en.wikipedia.org/wiki/Libavcodec [ ^ ],

http://libav.org/ [ ^ ]。



媒体播放器经典版(对于Windows,在我看来是必备播放器)也很好地应对了这个问题:

http://en.wikipedia.org/wiki/Media_Player_Classic [ ^ ],

http://mpc-hc.org/ [ ^ ]。



在找到它之后,您需要找到相应容器的文件格式的文档,然后找到有关所用流的文档,以及多路复用。只有这样你才能考虑自己解决问题。它的难度取决于它是什么。



参见:

http://en.wikipedia.org/wiki/Digital_container_format [ ^ ],

http://en.wikipedia.org / wiki / Codec [ ^ ],
http://en.wikipedia.org/wiki/MPEG-4 [ ^ ],

http://en.wikipedia.org/wiki/Demultiplexer_%28media_file%29 [ ^ ]。







By顺便说一下,由于FFMpeg和libav在源代码中可用,您可以阅读代码并了解如何使用几乎所有格式和标准。这种方法可以解决这些标题的任何问题,就像你的标题一样。但是,我不能说这很容易。



-SA
Please see my comment to the question, where I already tried to explain to you the essence of things. Due to the complicated character of the problem, I certainly cannot give you the whole solution; I only can tell you what to start with: you have to start with finding out what you are dealing with. "MP4" does not tell anything certain on what it is.

But this step is pretty easy. The best tool to find is FFmpeg or libavcodec utility. More exactly, this is one of the provided utilities: ffProbe.exe. There is analogous utility based on libav build. Please see:
http://en.wikipedia.org/wiki/Ffmpeg[^],
http://ffmpeg.org/[^],
http://en.wikipedia.org/wiki/Libavcodec[^],
http://libav.org/[^].

Media Player Classic (for Windows, a must-have player, in my opinion) also copes with this problem pretty well:
http://en.wikipedia.org/wiki/Media_Player_Classic[^],
http://mpc-hc.org/[^].

After you find out what is it, you will need to find out the documentation of the file format of the respective container, and then the documentation on the streams used, as well as and muxing. And only then you can consider solving your problem itself. The difficulty of it depends on what it is.

See also:
http://en.wikipedia.org/wiki/Digital_container_format[^],
http://en.wikipedia.org/wiki/Codec[^],
http://en.wikipedia.org/wiki/MPEG-4[^],
http://en.wikipedia.org/wiki/Demultiplexer_%28media_file%29[^].



By the way, as FFMpeg and libav are available in source code, you can read the code and find out how to work with nearly all formats and standards. That approach can solve any problems with those headers, like yours. However, I cannot say it will be easy.

—SA


这篇关于在二进制中编辑MP4标头信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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