精华内容
参与话题
问答
  • MP4box

    2020-11-27 05:36:51
    -execdir MP4Box -lang ger {} \; Error opening file Naruto Shippuden s01e31.mp4: Invalid IsoMedia File [iso file] Incomplete MDAT while file is not read-only </code></pre> <p>can anyone help me out? ...
  • mp4box

    2016-07-03 16:46:19
    mp4box来hint文件的操作很简单 hint: mp4box filename -hint 反hint则是: mp4box filename -unhint 查看track: mp4box filename -info 强制同步所有track: mp4box.exe filename -hint -ocr ...

     用mp4box来hint文件的操作很简单

    hint:
    mp4box filename -hint

    反hint则是:
    mp4box filename -unhint

    查看track:

    mp4box filename -info


    强制同步所有track:

    mp4box.exe filename -hint -ocr

    察看文件track等信息

    mp4box.exe filename -info

     

    展开全文
  • MP4Box

    千次阅读 2006-12-29 17:00:00
    Content Authoring with MP4Box This page is dedicated to MP4Box, the GPAC c
    Content Authoring with MP4Box
     

    This page is dedicated to MP4Box, the GPAC command line swiss army knife. You will find here a detailed documentation on major switches of MP4Box. Not all tools are documented, so do not hesitate to look at the MP4Box usage by typing MP4Box -h.

    General Considerations


    This document may refer to IsoMedia files. IsoMedia is a generic name for all formats based on the MPEG-4 Part 12 specification: MP4, 3GP and MJ2K files. Support for MJ2K files has not be tested in GPAC yet.

    As of version 0.2.4, MP4Box performs in-place rewrite of IsoMedia files (the input file is overwritten). You can change this behaviour by using the -out Filename option.
    For older versions, when MP4Box is used to modify an existing IsoMedia file, the original file (for example AFILE.mp4) is NOT overwritten, the resulting file is stored in out_AFILE.mp4. To specify another name for the resulting file, use the -out Filename option.

    As of version 0.2.4, MP4Box always stores the file with 0.5 second interleaving and meta-data at the begining, making it suitable for HTTP streaming.

    MP4Box usually generates a temporary file when creating a new IsoMedia file. The location of this temporary file is OS-dependent, and it may happen that the drive/partition the temporary file is created on has not enough space. In such an event, you may specify the temporary file location with the -tmp path_to_dir option.

    MP4Box does NOT perform audio/video/image transcoding (re-encoding media tracks to a different coded format). If you need to transcode content, you will need other tools.

    As of version 0.2.2, you don't need to follow any specific option ordering at prompt.

    Please be aware that this page documents the latest version of MP4Box and may therefore give details on options available only on GPAC CVS. If your version of MP4Box does not support an option please upgrade.

    File conversion

    MP4Box can convert the following files into compliant IsoMedia files: RAW Formats and extensions: MPEG-4 Video (.cmp .m4v) MPEG-4 Audio ADTS-AAC (.aac) - ADIF or RAW formats not supported MPEG-1/2 Audio (.mp3) JPEG and PNG Images (.jpg .jpeg .m4v) H263 Video (.263 .h263) AVC/H264 Video (.264 .h264, .26l .h26l) AMR and AMR-WideBand Speech (.amr .awb) EVRC Speech (.evc) SMV Speech (.smv) NHNT (.media .info .nhnt) AV Containers and extensions: AVI (.avi) - Only MPEG-4 video and MP3 audio supported at the current time. MPEG-PS (.mpg .mpeg .vob) - Only MPEG-1/2 video and MPEG-1/2 audio supported at the current time. QCP (.qcp) XIPH OGG (.ogg) - EXPERIMENTAL and not relevant to any IsoMedia-based standards. Only Vorbis audio and Theora video supported. IsoMedia files (no extension checking) Text formats and extensions: SRT Subtitles (.srt) SUB Subtitles (.sub) QuickTime TeXML (.xml) - cf QT documentation GPAC Timed Text (.ttxt)

    The conversion syntax is MP4Box -add inputFile destinationFile. This option is used to import media from several sources. You can specify up to 20 -add to MP4Box. This process will create the destination file if not existing, and add the track(s) to it. If you wish to erase the destination file, just add the -new option
    Note: You can also use this option to merge tracks from different IsoMedia files.

    Input file track selection
    To select a desired media track, the following syntax is used:
    -add inputFile#video: adds the first video track in inputFile. DOES NOT WORK for IsoMedia files.
    -add inputFile#audio: adds the first audio track in inputFile. DOES NOT WORK for IsoMedia files.
    -add inputFile#trackID=ID or -add inputFile#ID: adds the specified track. For IsoMedia files, ID is the track ID. For other media files, ID is the value indicated by MP4Box -info inputFile.

    MP4Box can import a desired amount of the input file rather than the whole file. To do this, use the syntax -add inputFile%N, where N is the number of seconds you wish to import from input. MP4Box cannot start importing from a random point in the input, it always import from the begining.

    When using -add option, MP4Box will automatically create default BIFS and OD tracks to make the resulting file compliant with the ISMA 1.0 standard if possible. If the destination file extension is .3gp or .3g2, MP4Box will automatically make the file 3GP(2) compliant. This means that MP4Box will always remove any systems tracks when using -add, you may prevent this by using the -keepsys option.

    Note on text import : When importing SRT or SUB files, MP4Box will choose default layout options to make the subtitle appear at the bottom of the video. You SHOULD NOT import such files before any video track is added to the destination file, otherwise the results will be likelly not be usefull (default SRT/SUB importing uses default serif font, fontSize 18 and display size 400x60). For more details on 3GPP timed text, please go here.

    Import Options
    There are several media-specific options which can be used when importing media. To know which options are supported for non-IsoMedia files, use the -info option for the desired media track, for example MP4Box -info 2 file.mpg.

    -sbr : forces importing the AAC-ADTS file as AAC SBR (aka HE-AAC, aka aacPlus) with backward compatible signaling (eg non SBR aware decoders should play the file).
    -sbrx : forces importing the AAC-ADTS file as AAC SBR (aka HE-AAC, aka aacPlus) with non-backward compatible signaling (eg non SBR aware decoders should NOT play the file).
    Note : MP4Box CANNOT detect whether AAC input is regular or SBR AAC, so you must use one fo these options if you want to import AAC SBR files.

    -dref : MP4Box can import media data without copying it, this is called data referencing. The resulting file only contains the meta-data of the presentation (frame sizes, timing, etc...) and references media data in the original file. This is extremely usefull when developping content, since importing and storage of the MP4 file is much faster and the resulting file much smaller. Use the -dref option to enable data referencing.
    NOTE : Data referencing may fail on some files because it requires the framed data (eg an IsoMedia sample) to be continuous in the original file, which is not always the case depending on the original interleaving or bitstream format.

    -nodrop : Some AVI files may have non-coded frames (n-VOPs) introduced by the encoder. By default, MP4Box will discard these frames, hence producing a variable frame-rate visual stream. You can force MP4Box to keep constant frame-rate by specifying -nodrop while importing the AVI file.

    -packed: When importing raw MPEG-4 Video, forces considering the bitstream as the dump of an AVI Packed Bitstream (removes all n-vops and import as constant FPS).

    -fps FrameRate : If possible, will override the original video frame rate. This option is also used when importing SUB text files to specify the SUB framerate. Framerate is a double-precision number.

    -mpeg4 : This option forces MPEG-4 stream descriptions for formats having several description syntax available - only possible for QCELP, EVRC and SMV audio.

    -agg N : Aggregates N audio frames in an IsoMedia sample. This option is only valid for some 3GP(2) audio formats (AMR, QCELP, EVRC and SMV audio). The maximum acceptable value is 15.

    When importing several tracks/sources, all options will be applied if relevant to each source.

    Note on OGG Support : MP4Box can import OGG files containing either Vorbis audio or Theora video. This feature is experimental and support for these media formats in IsoMedia files is NOT STANDARDIZED anywhere. This should only be used for development and R&D purposes, and you must be aware that files created this way may be unusable, even with future versions of GPAC.

    File Splitting and Concatenation

    MP4Box can split IsoMedia files by size, duration or extract a given part of the file to new IsoMedia file(s). This process requires that at most one track in the input file has non random-access points (typically one video track at most). This process will also ignore all MPEG-4 Systems tracks and hint tracks, but will attempt to split private media tracks.
    Note : The input file must have enough random access points in order to be splitted. This may not be the case with some video files where only the very first sample of the video track is a key frame (many 3GP files with H263 video are recorded that way). In order to split such files you will have to use a real video editor and re-encode the content.

    -split time_in_seconds : splits the input file in a sequence of files lasting at most the specified time. Depending on random access distribution in the file (sync samples), the duration of the resulting files may be less than specified.

    -splits size_in_kb : splits the input file in a sequence of files of maximum specified size. Depending on random access distribution in the file (sync samples), the size of the resulting files may be less than specified.

    -splitx StartTime:EndTime : extracts a subfile from the input file. StartTime and EndTime are specified in seconds. Depending on random access distribution in the file (sync samples), the startTime will be adjusted to the previous random access time in the file.

    -cat a_file : concatenates a_file to input file (samples are added to existing tracks rather than added to new tracks). The usage is the same as -add, you may use non IsoMedia input files (for example, AVIs or MPEGs) and concatenates them directly into a new IsoMedia file. This process will remove all MPEG-4 systems tracks from the final file and make it compliant to ISMA or 3GP just like the -add process. You can instruct MP4Box not to remove MPEG-4 systems tracks by specifying -keepsys.

    General File operations

    MP4Box can rewrite IsoMedia files for distribution purposes - these options may also be used while converting files.
    -isma: converts file to ISMA 1.0 specification. This is extremely usefull since most MPEG-4 players only understand ISMA-like content. All systems information and tracks numbering are rewritten to comply to the specification. WARNING: some media tracks may be removed.

    -3gp : converts to 3GPP specification. This will remove all MPEG-4 Systems information, leaving only the audio/video/text media tracks supported by 3GPP. WARNING: some media tracks may be removed.

    -nosys : removes all MPEG-4 systems tracks and keeps an empty InitialObjectDescriptor will be left in the file for MPEG-4 Level@Profile indications.

    -inter Duration : interleaves media data in chunks of desired duration (in seconds). This is usefull to optimize the file for HTTP/FTP streaming. All meta data are placed first in the file, allowing a player to start playback while downloading the content. By default MP4Box always stores files with half a second interleaving. Specifying a 0 interleaving time will result in the file being stored without interleaving, with all meta-data placed at beginning of the file.

    -flat : forces flat storage of the file: media data placed at the begining of the file without interleaving, and meta-data at the end of the file. When used with -add to create a new file, no temporary file is created (faster storage).

    -rem trackID : removes given track from file.

    -cprt string : adds copyright to file.

    -chap chap_file : adds chapter information located in chap_file to the destination file. Chapter extensions have been introduced by Nero and are NOT standard extensions of IsoMedia file format, don't be surprised if some players don't understand them.
    The following syntaxes are supported in the chapter text file, with one chapter entry per line:
    ZoomPlayer chapter files : AddChapter(nb_frames,chapter name), AddChapterBySeconds(nb_sec,chapter name) and AddChapterByTime(h,m,s,chapter name). One chapter entry per line.
    Time codes : h:m:s name, h:m:s:ms name and h:m:s.ms name. One chapter entry per line.
    SMPTE codes : h:m:s;nb_f/fps name and h:m:s;nb_f name with nb_f the number of frames and fps the framerate. One chapter entry per line.
    Common syntax : CHAPTERX=h:m:s[:ms or .ms] on one line and CHAPTERXNAME=name on the other - the order is not important but chapter lines MUST be declared sequencially (same X value expected for 2 consecutive lines).

    Some existing MP4 files may use MPEG-4 Visual tracks with B-Frames in an improper way. There is currently no automatic cleaning of such files in MP4Box, but reimporting the track will solve the problem. To do this: MP4Box -avi trackID file.mp4: exports track to avi (raw MPEG-4 video also possible). MP4Box -import file.avi dest.mp4: converts avi into MP4 and handles B-Frame correct import (packed bitstreams, n-Vops).

    File hinting

    IsoMedia File Hinting consists in creating special tracks in the file that contain transport protocol specific information and optionally multiplexing information. These tracks are then used by the server to create the actual packets being sent over the network, in other words they provide the server 'hints' regarding packet building, hence their names: Hint Tracks.
    MP4Box can generate these hint tracks for the RTP protocol (the most widely used protocol for multimedia streaming). The resulting file can then be streamed to clients with any streaming server understanding the IsoMedia file format and hint tracks, such as Apple's QTSS/DSS servers.

    -hint : hints the given file for RTP/RTSP -mtu : specifies the desired maximum packet size, or MTU (Maximum Transmission Unit). This must be choosen carefully: specifying too large packets will result in undesired packet fragmentation at lower transport layers. The default size when hinting is 1500 bytes (Ethernet MTU). -multi [maxptime] : enables sample concatenation in a single RTP packet for payload formats supporting it. maxptime is an optional integer specifying the maximum packet duration in milliseconds, used for some audio payloads. Its default value is 100 ms. -copy : forces hinted data to be copied to the hint track. This speeds up packet building at server side but takes much more space on disk. -tight : performs sample-based interleaving of media tracks and hint tracks. This should reduce disk seeks at server side (depending on server implementation) but results in a bigger file. -mpeg4 : forces usage of MPEG-4 Generic Payload whenever possible. -ocr : forces all media tracks in the file to be served synchronized. This is needed because most streaming servers don't support desynchronized tracks in a single file. Be extremelly carefull when designing MPEG-4 interactive presentations for streaming since you will have to take care of the streaming server capabilities... MP4Box generates warnings when the file timeline can be ambiguously interpreted by the server. -iod : prevents ISMA-like IOD generation in SDP. MP4Box automatically detects ambiguous (ISMA/non-ISMA) files but nobody's perfect. This shouldn't be used with -isma option. -sdp_ex string : adds the given text to the movie SDP information (-sdp_ex "a=x-test: an sdp test") or to a track (-sdp_ex "N:a=x-test", where N is the hint track or its base track ID). This will take care of SDP line ordering. WARNING: You cannot add anything to SDP, please refer to RFC2327 for more info. -unhint : removes all hint tracks and SDP information from file. This can be usefull since MP4Box doesn't remove any existing hint tracks when hinting the file.

    MP4Box always detects the best payload possible and when not found gets back to MPEG-4 Generic payload. The configuration of the MPEG-4 Generic payload is quite complex, so MP4Box always computes the most suitable configuration for you. However there are more hinting options available to configure the MPEG-4 Generic RTP payload (type -h hint for help) in case you need to transport MPEG-4 specific informations.

    Examples: Prepare any mp4 for ISMA streaming: MP4Box -isma -hint myfile.mp4 Prepare an mp4 optimized for server: MP4Box -hint -copy -tight myfile.mp4 Prepare a complex mp4 with BIFS for streaming: MP4Box -ocr -iod -hint myfile.mp4 Prepare any 3GP/MP4 for safe streaming: MP4Box -nosys -hint myfile.3gp

     

    Q&As: Can I stream MP4 files created with MPEG4IP's mp4creator to GPAC?
    It depends. mp4creator hints mp3 audio with MPA or MPA-robust payload formats, specific to mp3 streams. MPA-robust is not supported in GPAC and is not on the list of priorities, we strongly prefer working with RFC3640 payload for MPEG-4 streams. However if no MPA-robust payload is used, both players and hinters should interoperate. Can I stream MP4 files created with MP4Box to MPEG4IP player?
    It depends. MPEG4IP works with ISMA / plain AV files, therefore you should first convert your file to ISMA before hinting.
    Can I stream complex MPEG-4 presentations created with MP4Box to any player ???
    Yes and no. GPAC uses RFC3640 to stream MPEG-4 systems information, and most players don't accept that (they usually use their own format). Moreover RTSP servers as known today only understand simple synchronized presentations, and most MPEG-4 presentations have too complex timing for servers to handle. If you need to know more about that join us in our forum.

     

    File Dumping and information

    MP4Box has many dump functionalities, from simple track listing to more complete reporting of special tracks -info : prints some file information. File can be an IsoMedia file or any file supported by MP4Box for import. -info TrackID : prints extended track information for IsoMedia files, and supported import flags for other files. -diso : creates XML image of the file structure. -drtp : creates XML image of all hint tracks samples of a hinted mp4 file. -sdp : creates SDP file associated with a hinted mp4 file. -ttxt : converts input subtitle (SRT, SUB) to GPAC TTXT format. -ttxt TrackID : dumps text track to TTXT XML format. -srt : converts input subtitle (TTXT, SUB) to SRT format. -srt TrackID : dumps text track to SRT format. -std : dumps to stdout instead of file.

     

    Media track Extraction

    MP4Box can extract media tracks in a variety of formats: -raw TrackID : extracts track to its native format. -raws TrackID : extracts each track sample to a file. To extract a single sample, use -raws TrackID:N -avi TrackID : extracts visual track in avi format (MPEG-4 Visual and AVC/H264 supported). -nhnt TrackID : extracts track in NHNT format. -qcp TrackID : same as -raw but defaults to QCP file for EVRC/SMV. -aviraw track : extracts avi track to its native format. track can be one of video, audio, audioN N being the number of the audio track. -single TrackID : extracts track in a new MP4 with a single track.

    MPEG-4 Systems, VRML and X3D Handling

    MP4Box can be used to encode and decode MPEG-4 Scene Description. It may also be used to convert to and from the various textual format: BT, XMT-A, WRL (VRML97) and X3D in XML or VRML format. These conversions will not always work since these standards do not use the same set of nodes. -mp4 : specifies input file is to be encoded. Supports .bt (BT), .xmt (XMT-A) , .wrl (VRML97) and .swf (Flash) input. For more details on flash input, try MP4Box -h swf. For more details on BT/XMT-A, go here. -def : encodes DEF/USE nodes and routes names as strings. This is usefull when developping content otherwise the decoded scene becomes quickly messy. -ms : specifies the media source to check for track importing. This is needed when no MuxInfo is present in the BT file, although this is not recommended. By default, MP4Box looks for tracks in MYFILE.mp4 when encoding MYFILE.bt -bt : dumps scene in a BT file. -xmt : dumps scene in an XMT-A file. -wrl : dumps scene into VRML97 format - unknown/incompatible nodes are removed. -x3d : dumps scene into X3D/XML format - unknown/incompatible nodes are removed. -x3dv : dumps scene into X3D/text format - - unknown/incompatible nodes are removed.

    ISMA Encryption and description

    MP4Box supports ISMA E&A specification, better known as ISMACryp. -crypt drm_file : encrypts IsoMedia file according to rules specified drm_file. More info on this is available here. -decrypt drm_file : decrypts IsoMedia file. drm_file is optional if the keys are stored within the file. More info on this is available here.

    Misc

    -nodes : prints list of MPEG-4 nodes supported in this MP4Box build. -node NodeName : prints MPEG-4 node syntax: fields, their type, event type, default value and quantization info if any. Note this works only for nodes supported in the current built. -xnodes : prints list of X3D nodes supported in this MP4Box build. -node NodeName : prints X3D node syntax: fields, their type, event type and default value. Note this works only for nodes supported in the current built.
     
    展开全文
  • mp4 box

    千次阅读 2016-04-22 17:28:26
    1:MP4box有很多,见过的70多个吧,这里一共写了必须的10多个,剩下的可以扩展,有:fpyt,free,mdat,moov,mvhd,trak,  tkhd,mdia,mdhd,hdlr,minf,vmhd,smhd,dinf,stbl,stsd,stts,stsc,stsz,stco,stss,ctts(可选),...

    1:MP4的box有很多,见过的70多个吧,这里一共写了必须的10多个,剩下的可以扩展,有:fpyt,free,mdat,moov,mvhd,trak,
      tkhd,mdia,mdhd,hdlr,minf,vmhd,smhd,dinf,stbl,stsd,stts,stsc,stsz,stco,stss,ctts(可选),avc1,accC,mp4a,esds。

     

    2:time scale 和 duration的关系
       time scale 是单位 以秒为单位 duration 是时常,可以以毫秒为单位也可以不是,只要算出来那个值就行了:例如:
       time scale = 600, duration = 42000 算出来 duration/timescale = 70.00 , time scale = 1000 , duration = 70000,算出来 duration/timescale = 70.00 相同的值,道理就是这样。本程序需要三个这样的值,一个是文件总的时常,二是音频的时常,三个是视频的时常,存储在不同的box中,这些数值,具体看官方文档。

     

    3:本程序有一个简便的方法,MP4中引用了很多chunk和sampel的关系如下图:

    但问程序为了简便,将chunk和sample 一一对应,也就是说一个chunk中只有一个sample,这里要注意。


    4:stts:TimeToSampleBox
       结构如下:


       如果多个sample有相同的duration,可以只用一项描述所有这些samples,数量字段说明sample的个数。例如,如果一个视     频媒体的帧率保持不变,整个表可以只有一项,数量就是全部的帧数。
       例1: 视频
       entry_count:1
       sample_count:37   //上面已经有duration时间了,duration指整个mdat中video的时长,这里37却为chunks数目
       sample_delta:1001 //1001 * 37=37037 sample_delta*sample_count=duration

       例2: 音频
       sentry_count:1
       sample_count:67   //音频分了67个chunks
       sample_delta:1024 //同上

     

    5:stsz:SampleSizeBox
       结构如下:


       就是表示每一个sample的大小,视频的时候,这里一定要注意 这个长度是 4个字节的长度前缀加上数据的长度,要不然播放不出来。

     

    6: stsd:SampleDescriptionBox
       结构如下:


       这个box中包含的音频的采样率,声道,样本,视频的sps,pps等信息,这些信息的结构可以看官方文档
       如图:


    视频:AVC sequence header就是AVCDecoderConfigurationRecord结构,该结构在标准文档“ISO-14496-15 AVC file format”中有详细说明。
    视频和flv的相同。avcc结构。
    音频:有两种:
    1):
    AAC sequence header存放的是AudioSpecificConfig结构,该结构则在“ISO-14496-3 Audio”中描述。AudioSpecificConfig结构的描述非常复杂,这里我做一下简化,事先设定要将要编码的音频格式,其中,选择"AAC-LC"为音频编码,音频采样率为44100,于是AudioSpecificConfig简化为下表:

    这种的和flv的相同里面存放了采样率,声道等信息。
    2):mp4a(box)->esds(box)
    这种的信息请看条目11。

    这里还有一点要注意:MP4中所有的项都是box,stsd下面有几种box,视频:stsd->
    avc1(box)->avcC(box),
    音频:stsd->mp4a(box)->esds(box),是box就有box头,一定要注意。

     

    7:stss:SyncSampleBox
       结构如下:


    stss: syn Sample box
       例1: 视频
       entry_count:1
       sample_number:1
       但音频里没有这个box,
       这个Box非常重要, 决定了整个mp4文件是否可以拖拉, 如果这个box只有一个entry,则拖拉时将cpu达到100%, 如果这个box不存在, 可以拖拉, 也不会达到   100%, 但是会略等一会, 通常做法可以搞100条.
    “stss”确定media中的关键帧。对于压缩媒体数据,关键帧是一系列压缩序列的开始帧,其解压缩时不依赖以前的帧,而后续帧的解压缩将依赖于这个关键帧。“stss”可以非常紧凑的标记媒体内的随机存取点,它包含一个sample序号表,表内的每一项严格按照sample的序号排列,说明了媒体中的哪一个sample是关键帧。如果此表不存在,说明每一个sample都是一个关键帧,是一个随机存取点。
    这里没有chunk的概念,entry_count:一共有多少个关键帧,sample_number:关键帧sample的标号。

    8:stco:ChunkOffsetBox
       结构如下:

     “stco”定义了每个chunk在媒体流中的位置。位置有两种可能,32位的和64位的,后者对非常大的电影很有用。在一个表中只会有一种可能,这个位置是在整个文件中的,而不是在任何box中的,这样做就可以直接在文件中找到媒体数据,而不用解释box。需要注意的是一旦前面的box有了任何改变,这张表都要重新建立,因为位置信息已经改变了。


    9: stsc:SampleToChunkBox
       结构如下:



    First chunk Samples per chunk Sample description ID
    1           4                        1
    4           3                        1
    5           4                        1
    8           3                        1
    可以看出chunk1、chunk2、chunk3都有4个sample,chunk4有3个sample,chunk5、chunk6、chunk7有4个sample……
    就是这个意思。

    用chunk组织sample可以方便优化数据获取,一个thunk包含一个或多个sample。“stsc”中用一个表描述了sample与chunk的映射关系,查看这张表就可以找到包含指定sample的thunk,从而找到这个sample。


    10:
    avc1(box)->avcC(box)

    acc1 box size //32
    avc1 boxheader: //32
    const unsigned int(8)[6] reserved = 0;
    unsigned int(16) data_reference_index;
    unsigned int(16) pre_defined = 0;
    const unsigned int(16) reserved = 0;
    unsigned int(32)[3] pre_defined = 0;
    unsigned int(16) width;
    unsigned int(16) height;
    template unsigned int(32) horizresolution = 0x00480000; // 72 dpi
    template unsigned int(32) vertresolution = 0x00480000; // 72 dpi
    const unsigned int(32) reserved = 0;
    template unsigned int(16) frame_count = 1;
    string[32] compressorname;
    template unsigned int(16) depth = 0x0018;
    int(16) pre_defined = -1;

    accC box size //32
    avcC boxheader: //32
    unsigned char configurationVersion;  //8;= 0x01
    unsigned char AVCProfileIndication;  //sps即sps的第2字节,所谓的AVCProfileIndication
    unsigned char profile_compatibility; //sps即sps的第3字节,所谓的profile_compatibility
    unsigned char AVCLevelIndication;    //sps即sps的第4字节,所谓的AVCLevelIndication
    unsigned char reserved_1;            //‘111111’b;
    unsigned char lengthSizeMinusOne;    //NALUnitLength 的长度 -1 一般为0x03
    unsigned char reserved_2;            //‘111’b;
    unsigned char numOfSequenceParameterSets;  //一般都是一个
    unsigned int sequenceParameterSetLength;   //sps长度
    unsigned char * sequenceParameterSetNALUnit; //sps数据
    unsigned char numOfPictureParameterSets;   //一般都是一个
    unsigned int  pictureParameterSetLength;   //pps长度
    unsigned char * pictureParameterSetNALUnit;//pps数据
    这样结构就完成了。最简便的方式。

     

    11: mp4a(box)->AudioSpecificConfig(这里用的是esds的名称)

    mp4a box size //32
    mp4a boxheader: //32
    const unsigned int(8)[6] reserved = 0;
    unsigned int(16) data_reference_index;
    const unsigned int(32)[2] reserved = 0;
    template unsigned int(16) channelcount = 2;
    template unsigned int(16) samplesize = 16;
    unsigned int(16) pre_defined = 0;
    const unsigned int(16) reserved = 0 ;
    template unsigned int(32) samplerate = {timescale of media}<<16;

    esdsbox size //32
    esds boxheader: //32
    version,flag //32
    unsigned char audioObjectType;              //5;编解码类型:AAC-LC = 0x02
    unsigned char samplingFrequencyIndex;       //4;采样率 44100 = 0x04
    unsigned char channelConfiguration;         //4;声道 = 2
    unsigned char framelengthFlag;              //1;标志位,位于表明IMDCT窗口长度 = 0
    unsigned char dependsOnCoreCoder;           //1;标志位,表明是否依赖于corecoder = 0
    unsigned char extensionFlag;                //1;选择了AAC-LC = 0
    按照这个结构写填写vlc也能正常播放,估计是vlc 比较强大。

     

    12:mp4a(box)->esds(box)

    mp4a box size //32
    mp4a boxheader: //32
    const unsigned int(8)[6] reserved = 0;
    unsigned int(16) data_reference_index;
    const unsigned int(32)[2] reserved = 0;
    template unsigned int(16) channelcount = 2;
    template unsigned int(16) samplesize = 16;
    unsigned int(16) pre_defined = 0;
    const unsigned int(16) reserved = 0 ;
    template unsigned int(32) samplerate = {timescale of media}<<16;

    esdsbox size //32
    esds boxheader: //32
    version,flag //32
    unsigned char tag; //8
    unsigned char Length_Field; //8   Length Field:25
    unsigned int  ES_ID;  //bit(16)   ES_ID: 是0
    unsigned char streamDependenceFlag; //bit(1)  steamDependenceFlag,如果为1,则有16bits的
    unsigned char URL_Flag;    //bit(1)  :URL_Flag,如果为1,后边则有8bits URLlength, 和相应的URLstring(URLlength)
    unsigned char OCRstreamFlag; //bit(1) 如果为1,有16bits OCR_ES_id;
    unsigned char streamPriority; //bit(5)
    unsigned char DecoderConfigDescriptor_tag; //8  = 0x04
    unsigned char Length_Field_1;      //8 = 0x11
    unsigned char objectTypeIndication; //8 = 0x40  14496-1 Table8, 0x40是Audio ISO/IEC 14496-3
    unsigned char streamType ; //6   5是Audio Stream, 14496-1 Table9
    unsigned char upStream;    //1
    unsigned char reserved;    //1
    unsigned int  bufferSizeDB;//24         //这里是调节比特率的   
    unsigned int  maxBitrate;  //32 
    unsigned int  avgBitrate; //32
    unsigned char DecSpecificInfotag; //8 = 0x05
    unsigned char Length_Field_2; //8  = 0x02
    unsigned char audioObjectType_2_GASpecificConfig; //5         //编解码类型:AAC-LC = 0x02
    unsigned char samplingFrequencyIndex; //4                     //采样率 44100 = 0x04      
    unsigned char channelConfiguration; //4                       //声道 = 2
    unsigned char cpConfig; //2                                  
    unsigned char directMapping;// 1
    unsigned char SLConfigDescrTag;//8  = 0x06
    unsigned char Length_Field_3;//8    = 0x01
    unsigned char predefined;//8  predefined 0x02 Reserved for use in MP4 files
    这个box的信息是从:http://blog.csdn.net/coreavs163/article/details/8603026 这位网友的分享中看到的,一直没找到官方文档的信息,
    不过有这些已经够了,将采样率,声道都填入到了这个box里面。
    如果用上面的AudioSpecificConfig,文件夹中的小图标是不能显示mp4的图像的

    展开全文
  • mp4box.js, GPAC工具的MP4Box版本 MP4Box.js JavaScript库,在浏览器( 在NodeJS中) 中处理MP4文件,支持渐进解析。 灵感来自于来自的 MP4Box 工具。 它可以用于:获得关于MP4文件的信息,一个MP4文件,用于与
  • MP4 box解析

    2017-07-20 16:29:31
    解析MP4box,附带采用lua解析MP4 box的格式.lua脚本暂时只写了几个.
  • MP4Box教程大全

    2020-02-15 09:27:07
    MP4Box,在GPAC中可使用的多媒体打包器被称为MP4Box。它可以被用来对诸如AVI, MPG, TS, 但更多地是对于ISO媒体文件(如MP4, 3GP)进行操作。简单地说MP4Box可以被用来: 对诸如MP4, 3GP之类的ISO文件进行操作,如:...
  • <div><p>mp4box -raw 1 test.mp4 mp4box -add 2_track1.h264 test1.mp4 mp4box -raw 1 test1.mp4 repeat each time <em>.h264 has a different size for </em>.aac this problem is not present MP4Box - GPAC ...
  • mp4box crashes

    2020-11-27 02:43:13
    I want to use mp4box inside cut assistant. cut assistant works fine with AVI-files so far. For mp4-files, I had to install ffdshow and "Haali Media Splitter" as well as mp4box. The path mp4box...
  • <div><p>If QuickTime <em>.mov contains timecode track mp4box produces </em>.mp4 which can not be shown in QuickLook. MP4Box - GPAC version 0.7.2-DEV-rev626-g76781df5-master macOS High Sierra. <p>MP4...
  • MP4Box完整版

    2014-10-07 14:57:40
    MP4Box 完整版可以将mp4转化为其它格式 使用Mp4box 从mp4文件 提取原始h264流 MP4Box.exe x.mp4 -out x.h264 -raw 1
  • MP4Box切割mp4视频文件

    千次阅读 2019-04-28 23:41:13
    MP4Box切割mp4视频文件 工具准备: yum install gpac 本文介绍的切割mp4视频文件的工具叫MP4Box,它存在于以上安装的多媒体处理工具包。 1、将test.mp4文件切成一系列时长为50秒的文件:MP4Box -split 50 test.mp4 ...

    MP4Box切割mp4视频文件

    工具准备:

    yum install gpac
    

    本文介绍的切割mp4视频文件的工具叫MP4Box,它存在于以上安装的多媒体处理工具包。

    • 1、将test.mp4文件切成一系列时长为50秒的文件:
      MP4Box -split 50 test.mp4
      
    • 2、将test.mp4文件切成一系列大小为50MBytes的文件:
      MP4Box -split-size 50000 test.mp4
      
    展开全文
  • Mp4Box 常用指令

    2020-02-10 19:04:10
    1、 查看mp4box中的所有帮助信息 mp4box -h 2、查看mp4box中的通用帮助信息 mp4box -h general 3、查看test.mp4文件是否有问题 mp4box -info test.mp4 4、修复test.mp4文件格式不标准的问题,并把新文件...
  • MP4Box-0.4.6

    2015-06-07 11:43:11
    MP4Box-0.4.6-rev2698 ,普通视频转换成darwin流媒体服务器可以播放的格式 命令:mp4box duola1.mp4 -hint
  • 操作系统:Ubuntu 16.04 参考: ubuntu下安装MP4Box 下载安装: git clone ...cd gpac git pull sudo ./configure --static-mp4box --prefix=/usr/local/MP4Box sudo make -j4 sudo make ...
  • <div><p>MP4Box -add test.mov test.mp4 MP4Box -add test.aac test.h264 test1.mp4 QT7 cannot open/view mp4 ...
  • MP4box Alternate Groups

    2020-11-27 05:34:52
    <p>When I try to move audio track 3 to the same group as track 2, I assume I need to do something like: ../MP4Box -group-add -refTrack=2:trackID=3 video.m4v However, this gives: 'Error: ...
  • MP4Box.exe

    热门讨论 2013-03-29 12:47:34
    MP4Box格式转换,DSS中需要用到.
  • MP4Box常用命令

    千次阅读 2019-04-12 10:47:34
    MP4Box常用命令
  • MP4Box Compilation error

    2020-12-29 18:22:31
    <div><p>MP4Box Compilation error https://0x0.st/mcv.zip</p><p>该提问来源于开源项目:m-ab-s/media-autobuild_suite</p></div>
  • MP4Box Merge MP4 Files

    2016-09-13 17:48:24
    1. Configure and Compile git clone https://github.com/gpac/gpac.git cd gpac ./configure --static-mp4box --use-zlib=no make -j4 sudo make install 2. Run #!/bin/sh MP4Box -c
  • mp4box hint large file error

    2020-12-06 04:33:50
    <div><p>Hi, i am using mp4box + darwin streaming server as rtsp server, they runs ok before. But a day ago, mp4box hint a large mp4 file report a error: <pre><code> Hinting file with Path-MTU 1450...
  • Question 2: When creating with MP4Box -dash MPD with fragmented mp4, is it possible/how to create an m3u8 pointing to the existing fragmented mp4 files previously created with MP4Box -dash <p>Using ...
  • Mp4box aac muxing broken

    2020-11-27 02:37:57
    MP4Box - GPAC version 1.0.0-rev188-g2aa266dfa-ab-suite (c) 2000-2020 Telecom Paris distributed under LGPL v2.1+ - http://gpac.io </code></pre> <p>And the following calls: 1. extract audio: <pre>...
  • MP4BOx hint等常用命令

    2020-09-28 22:52:59
    MP4BOx hint等常用命令 souldepth 下载地址 GPAC下载地址:http://gpac.wp.mines-telecom.fr/downloads/ 参考文档:MP4Box使用命令大全 如何查看帮助 mp4box -h 查看mp4box中的所有帮助信息 ...
  • mp4box安装方法

    2013-09-17 16:47:36
    mp4box安装方法,很详细的安装说明。值得下载
  • MP4Box命令行工具

    2013-06-17 23:05:55
    mp4box命令行工具,用于封装MP4,内部包含了完整的dll,可直接放置到工程内使用
  • <p>Here is a zip file containing the <code>TechTalk_CC_music.m4a</code> track that I used for testing and in the example: <a href="https://github.com/gpac/gpac/files/68442/Mp4Box.Test.zip">Mp4Box Test...

空空如也

1 2 3 4 5 ... 20
收藏数 1,458
精华内容 583
关键字:

mp4box