$ mp4box -version MP4Box - GPAC version 0.4.1-DEV GPAC Copyright: (c) Jean Le Feuvre 2000-2005 (c) ENST 2005-200X
$ mp4box -h general
interleaves file data (track chunks of time_in_ms)
stores file with all media data first, non-interleaved
fragments file (track fragments of time_in_ms)
specifies output file name
specifies directory for temporary file creation
removes all MPEG-4 Systems info except IOD (profiles)
rewrites the file as an ISMA 1.0 AV file
same as '-isma' and removes all clock references
rewrites as 3GPP(2) file (no more MPEG-4 Systems Info)
sets major brand of file
adds given brand to file's alternate brand list
removes given brand from file's alternate brand list
adds copyright string to movie
adds chapter information contained in file
removes track from file
forces creation of a new destination file
新規ファイルへの書き出しを強制
トラックの言語指定。"LAN"はISO 639-2 コードで指定 (eng, und)
トラックのスタートディレイ指定。単位ミリセカンド(ms)。
splits in files of time_sec max duration
splits in files of max filesize kB.
extracts a new file from start to end (in seconds)
$ mp4box -h hint
hints the file for RTP/RTSP
specifies MTU size in bytes. Default size is 1500
copies media data to hint track rather than reference
performs tight interleaving (sample based) of hinted file
-multi [maxptime]: enables frame concatenation in RTP packets if possible maxptime: max packet duration in ms (optional, default 100ms)
specifies rtp rate in Hz when no default for payload
forces MPEG-4 generic payload whenever possible
forces MPG4-LATM transport for AAC streams
enables static RTP payload IDs whenever possible
forces all streams to be synchronized
signals random access points in RTP packets
signals AU Time Stamps in RTP packets
signals AU size in RTP packets
signals AU sequence numbers in RTP packets
prevents systems tracks embedding in IOD
adds sdp string to (hint) track ("-sdp_ex tkID:string") or movie. This will take care of SDP lines ordering
removes all hinting information.
$ mp4box -h import
add file tracks to (new) output file
(新規の)出力ファイルにファイルトラックを追加
concatenates file samples to (new) output file
* Note: creates tracks if needed
ファイルサンプルを結合して(新規の)出力ファイルに書き出す。
* Note:必要な場合は新しくトラックを追加する。
keeps all MPEG-4 Systems info when using '-add' / 'cat'
'-add' / 'cat'を使った時に、MPEG-4 Systems infoを全部キープする。
トラック毎に指定する場合、書式は
:opt
または、
:opt=val
keeps media data in original file
forces constant FPS when importing AVI video
AVIからvideoをインポートする際に固定FPSを強制する。
forces packed bitstream when importing raw ASP
raw ASPをインポートする際にpacked bitstreamを強制する。
※:packed bitstreamはAVIでBフレームを使う為のハッキングの一つ。複数フレームを1枚と偽ってデコーダバッファに進入させるもの。
backward compatible signaling of AAC-SBR
non-backward compatible signaling of AAC-SBR
映像と字幕(sub)インポート時にフレームレートを強制。
デフォルトは
■参考
24000/1001fps
-fps 23.976025
30000/1001fps
-fps 29.970030
※float型での指定がより正確。手許(MEncoderで吐いたraw x264のmux)では、23.976指定は23.975fpsとなり一時間程度の実写で地味に口と台詞がずれる。本来は-fps 24000:1001でも良いようだが、24000:1001は24000fps(超はやおくり)になる。詳細はこちら参照。
forces MPEG-4 sample descriptions when possible (3GPP2)
aggregates N audio frames in 1 sample (3GP media only)
$ mp4box -h encode
specify input file is for encoding.
encode DEF names
forces BIFS sync sample generation every time_in_ms
* Note: cannot be used with -shadow
forces BIFS sync shadow sample generation every time_ms.
* Note: cannot be used with -sync
generates BIFS encoder log file
specifies file for track importing
specifies initial context (MP4/BT/XMT)
* Note: input file must be a commands-only file
specifies storage of updated context (MP4/BT/XMT)
$ mp4box -h meta
sets given meta type - syntax: "ABCD[:tk=ID]"
* ABCD: four char meta type (NULL or 0 to remove meta)
* [:tk=ID]: if not set use root (file) meta
if ID is 0 use moov meta
if ID is not 0 use track meta
adds resource to meta
* syntax: file_path + options (':' separated):
tk=ID: meta adressing (file, moov, track)
name=str: item name
mime=mtype: item mime type
encoding=enctype: item content-encoding type* file_path "this" or "self": item is the file itself
removes resource from meta - syntax: item_ID[:tk=ID]
sets item as primary for meta - syntax: item_ID[:tk=ID]
sets meta XML data
* syntax: xml_file_path[:tk=ID][:binary]
removes meta XML data
dumps meta XML to file - syntax file_path[:tk=ID]
dumps item to file - syntax item_ID[:tk=ID][:path=fileName]
$ mp4box -h extract
extracts track in raw format when supported
extract each track sample to a file
* Note: "TrackID:N" extracts Nth sample
extracts track in nhnt format
extracts track to a new mp4 file
extracts visual track to an avi file
same as '-raw' but defaults to QCP file for EVRC/SMV
extracts AVI track in raw format $TK can be one of "video" "audio" "audioN"
参考
x264+aac.aviを以下のようにすると、
$ mp4box -aviraw video /Volumes/XXX/XXX.avi
h264 raw videoだけ抽出できた。
Extracting AVI video (format h264) to /Volumes/XXX/XXX_video.h264
以下はXXX_audio.rawを抽出するが、これはmp4boxでmuxできなかった。
$ mp4box -aviraw audio /Volumes/XXX/XXX.avi
$ mp4box -h dump
dumps to stdout instead of file
prints movie info / track info if trackID specified
* Note: for non IsoMedia files, gets import options
scene to bt format - removes unknown MPEG4 nodes
scene to XMT-A format - removes unknown MPEG4 nodes
scene VRML format - removes unknown VRML nodes
scene to X3D/XML format - removes unknown X3D nodes
scene to X3D/VRML format - removes unknown X3D nodes
scene IsoMedia file boxes in XML output
rtp hint samples structure to XML output
prints sample timing to text output
dumps SDP description of hinted file
ISMACryp samples structure to XML output
Converts input subtitle to GPAC TTXT format
Dumps Text track to GPAC TTXT format
Converts input subtitle to SRT format
Dumps Text track to SRT format
generates node/field statistics for scene
generates node/field statistics per MPEG-4 Access Unit
generates node/field statistics for scene after each AU
$ mp4box -h swf
MP4Box can import simple Macromedia Flash files (".SWF")
You can specify a SWF input file with '-bt', 'xmt' and '-mp4' options
all SWF defines are placed in first scene replace
* Note: By default SWF defines are sent when needed
uses a dedicated stream for movie control
* Note: Forces '-static'
removes all SWF text
removes all embedded SWF Fonts (terminal fonts used)
removes all lines from SWF shapes
removes all gradients from swf shapes
uses quadratic bezier curves instead of cubic ones
support for lines transparency and scalability
complementary angle below which 2 lines are merged
* Note: angle '0' means no flattening
$ mp4box -h crypt
crypts a specific track using ISMA AES CTR 128
decrypts a specific track using ISMA AES CTR 128
* Note: drm_file can be omitted if keys are in file
changes KMS location for all tracks or a given one.
* to adress a track, use 'tkID=kms_uri'
File is XML and shall start with xml header
File is a list of "ISMACrypTrack" elements (all at root)
TrackID: ID of track to en/decrypt
key: AES-128 key formatted (hex string '0x'+32 chars)
salt: CTR IV salt key (64 bits) (hex string '0x'+16 chars)
Scheme_URI: URI of scheme used
KMS_URI: URI of key management system
* Note: 'self' writes key and salt in the file
selectiveType: selective encryption type - understood values are:"None": all samples encrypted (default)
"RAP": only encrypts random access units
"Non-RAP": only encrypts non-random access units
"Rand": random selection is performed
"X": Encrypts every first sample out of X (uint)
"RandX": Encrypts one random sample out of X (uint)
ipmpType: IPMP Signaling Type: None, IPMP, IPMPX
ipmpDescriptorID: IPMP_Descriptor ID to use if IPMP(X) is used
* If not set MP4Box will generate one for you
mp4box -h format
NHNT | .media .nhnt .info |
MPEG Audio | .mp3 |
ADTS-AAC | .aac |
MPEG-4 Visual | .cmp .m4v |
H263 Video | .263 .h263 |
AVC/H264 Video | .h264 .h26L .264 .26L |
JPEG Images | .jpg .jpeg |
PNG Images | .png |
AMR(WB) Audio | .amr .awb |
EVRC Audio | .evc |
SMV Audio | .smv |
※.m4vはraw formatsとして扱う事に注意。Appleが使うコンテナフォーマットとしての.m4vはオープンソース的には混乱を招いた。ISO/IEC規格外の可能性大。参考
AVI | .avi |
MPEG-PS | .mpg .mpeg .vob .vcd .svcd |
QCP | .qcp |
OGG | .ogg |
ISO-Media files | no extension checking |
SRT Subtitles | .srt |
SUB Subtitles | .sub |
GPAC Timed Text | .ttxt |
QuickTime TeXML Text | .xml (cf QT documentation) |
MPEG-4 XMT-A | .xmt .xmta .xmt.gz .xmta.gz |
MPEG-4 BT | .bt .bt.gz |
VRML | .wrl .wrl.gz |
X3D-XML | .x3d .x3d.gz |
X3D-VRML | .x3dv .x3dv.gz |
MacroMedia Flash | .swf (very limitted import support only) |