简体   繁体   English

最大MP4 H264标题大小

[英]Max MP4 H264 Header Size

I have a requirement to cut a MP4 container H264 video encoded file into header part and content part. 我需要将MP4容器H264视频编码文件剪切为标题部分和内容部分。

Instead of dwelling into details of the header, I want to split the file with a max MP4 video header limit. 我不想深入探讨标题的详细信息,而是想以最大MP4视频标题限制分割文件。

Is there any such limit exist? 是否存在这样的限制? Does splitting initial 2/4 MB from the file will hold the header completely? 从文件中拆分初始2/4 MB会完全保留标题吗?

The requirement is, if the content part of the file is accessible, the video should not be recreated. 要求是,如果文件的内容部分可访问,则不应重新创建视频。 Is splitting the file into header and content will help? 将文件拆分为标题和内容会有所帮助吗?

According to MP4 File Format Specification , there is virtually no Header Size limit. 根据MP4文件格式规范 ,实际上没有标题大小限制。

Some movie atoms are in variable size, so you can't set a limit. 有些电影原子的大小可变,因此您无法设置限制。
"User Data Atoms" for example can extend the header size. 例如,“用户数据原子”可以扩展标题大小。

The user data atom has an atom type of 'udta'. 用户数据原子的原子类型为“ udta”。 Inside the user data atom is a list of atoms describing each piece of user data. 用户数据原子内部是描述每个用户数据的原子列表。 User data provides a simple way to extend the information stored in a QuickTime movie. 用户数据提供了一种扩展存储在QuickTime电影中的信息的简单方法。 For example, user data atoms can store a movie's window position, playback characteristics, or creation information. 例如,用户数据原子可以存储电影的窗口位置,回放特性或创建信息。

在此处输入图片说明

The structure of atom within atom within atom... also implies there is virtually no limit. 原子内原子内的原子结构……也暗示着实际上没有限制。

在此处输入图片说明

I thought the limit might be 4GB, but... According to the following quote, Atom size can be even larger than 2^32 bytes: 我以为限制可能是4GB,但是...根据以下引用,Atom大小甚至可以大于2 ^ 32字节:

Atom size A 32-bit integer that indicates the size of the atom, including both the atom header and the atom's contents, including any contained atoms. 原子大小一个32位整数,指示原子的大小,包括原子标头和原子的内容(包括任何包含的原子)。 Normally, the size field contains the actual size of the atom, in bytes, expressed as a 32-bit unsigned integer. 通常,大小字段包含原子的实际大小(以字节为单位),表示为32位无符号整数。 However, the size field can contain special values that indicate an alternate method of determining the atom size. 但是,大小字段可以包含特殊值,这些值指示确定原子大小的另一种方法。 (These special values are normally used only for media data ('mdat') atoms.) Two special values are valid for the size field: 0, which is allowed only for a top-level atom, designates the last atom in the file and indicates that the atom extends to the end of the file. (这些特殊值通常仅用于媒体数据('mdat')原子。)两个特殊值对size字段有效:0(仅适用于顶级原子),指定文件中的最后一个原子,以及表示原子延伸到文件的末尾。 1, which means that the actual size is given in the extended size field, an optional 64-bit field that follows the type field. 1,表示实际大小在扩展大小字段中给出,扩展大小字段是类型字段之后的可选64位字段。 This accommodates media data atoms that contain more than 2^32 bytes. 这容纳了包含2 ^ 32字节以上的媒体数据原子。

I think you better extract the elementary stream from MP4 container: 我认为您最好从MP4容器中提取基本流:
Extracting MPEG-4 Elementary Stream from MP4 Container (I am not sure linked example acctualy works). 从MP4容器中提取MPEG-4基本流 (我不确定所链接的示例是否可以正常工作)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM