CVS代替のバージョン・コントロール・システム。ライセンス形態は Apache/BSD-スタイル 、オープンソース。
2007秋時点での最新リリースはSubversion 1.4.5。Mac OSX 10.4.xには入っていない。ffmpeg, MPlayer, x264などが使う。
CVSと大きく違うのは、ディレクトリ、コピー、リネーム、実行権限の変化も管理対象とするので、僅かな変化でもリビジョン(rev)が変化する事。ちゃんと使えばソースコードの「巻き戻し」などがやりやすい模様。
***試訳 ここから***
ずいぶんあいたが我々はまだ生きてます。再び日々の変更をリリースにまとめる時期が来たと考える。
主なソースコードの進化の一つは、いつもながらFFmpegだ。あたらしい映像・オーディオコデックがいくつか追加になり、速度向上 と大量のコードクリンナップも行われている。
MPlayerにはReal RTSP認証と、live555 に代る libnemesi ストリーミングライブラリのサポートが追加された。RTSPストリーム越しのQuickTime再生も、その多くが可能になった。TVストリー民具も大幅 に改善され、Intel Macのサポートもバッチリだ(*support should be complete*)。
MPEG-TSやMPEG-PSに入ったVC-1のサポートにより、多くのHDTVストリームが使えるようになるだろう。Blu-rayとHD- DVDの再生はまだだが、MPlayerはデクリプト済みのEVOファイルは再生できる(* または、それらがデクリプトされた暁には?*)。
MPlayerは正 方ピクセルを前提とするようになった。LCDパネルはみなそうだから。映像が横延びや縦縮みして見えたら、'- monitoraspect 4:3'を使って正しいアスペクト比に直して下さい。
AMR audio サポートの為にパッチを当てる必要はもう無い。AMR libraries for Linux をダウンロードして、リンク先の説明通りにインストールして欲しい。
このリリースは現在の(執筆時点の)Cygwinバージョンではコンパイルできない事に注意してほしい。これはCygwin が llrint を実装していないためだ。現状ではCygwinのgccアップグレードを待つか、CygwinかMPlayerにパッチを当てる必要がある。
既に古いバージョンを使っている場合は、新たにバイナリ・コデック・パッケージをダウンロードする必要は無い。
MPlayer 1.0rc2 は以下からダウンロードできる。できるだけミラーサーバーを使って、私たちのサーバーをいたわってください。
BitTorrentでの入手もできます。
MD5SUM: 7e27e535c2d267637df34898f1b91707
SHA1SUM: e9b496f3527c552004ec6d01d6b43f196b43ce2d
*** 試訳ここまで***
個人的にSAR, PAR, DARなどのARS(アスペクトレシオシグナリング)はインターレース同様無くなったほうが世の中のしあわせ総量が増えると思っているので、スクエアピクセルが前提の挙動は大歓迎です。この点、QuickTime もマンセー。
なお、関係は不詳ですが、手許ではこの直前の10/6日版(SVN-r24712)で、以下のようなトラブルが出ました。
*症状:
MPEGStreamClipが吐いた.mpegのアスペクト情報を認識せず、-vf scale=-10:-1 が効かずに横長画像を吐出する。一律にSAR=1/1を使う模様。ログに
Movie-Aspect is undefined - no prescaling applied.
などと出たので、コマンドに -aspect 4:3(DECODING/FILTERING OPTIONS)を追加したら直った。
*man:-aspect (also see -zoom)
Override movie aspect ratio, in case aspect information is in-
correct or missing in the file being played.
強制的にデコードアスペクトを指定するもののようです。*使用コマンド:
-vf yadif=3,pp=l5,framestep=2,crop=704:480:8:0,scale=-10:-1:::3,hqdn3d=4:3:6,harddup -vfm ffmpeg -sws 9 -aspect 4:3 -ofps 30000/1001 -of rawvideo -o /dev/null
なお、QTPproやVLCはMPEGStreamClipが吐いた.mpegを「正しく」再生します。
たぶんコレ。回避策として以下を使っていたのですが、
-vf yadif=3,pp=l5,framestep=2,crop=...
一旦60fps化して半分捨てるんで激しく遅い。その分地味に奇麗ですがちょー地味。あんまりしあわせを感じない。
i_certify_that_my_video_stream_does_not_use_b_frames の事と思われます。でもMP4直吐きできるようになったのならそう書くハズ。
アナログ放送向けと思しき機能も多いですが、デジタル放送向けと思しき機能も散見されます。
ここにあるやりとりによると“ここ英国では、digital TVはアンテナを経由している。従って私はMPEG-2 transport streamをダンプして、Project XというWindowsソフトを使ってTSをdemuxしている。”との事なので、少なくとも英国ではデジタル放送の録画、エンコードには特に障害が無いようです。
もともと地デジのコピワン / B-CASは日本の独自仕様なのですが、オープンソース・マルチメディアにとってもボトルネックです。
ちょっと呆れてしまって記事にしていないのですがここなどを見ると、JEITAは「ダビテンはアナログコピーもダビテン対応機器間に限るのでいっぱい買ってね!」という意味に読めました。コピワン(を管理するCOGフラグ)に国際規格に無いコピー回数フラグを立て、回数10回もまだ最終決定では無い段階でばんばん洗脳戦始めるてのは、経産(JEITAを所管)VS. 総務(ARIBを所管)の主導権争いか、そこまでメーカーの尻に火がついているかのどっちかです。たぶん両方。
「無料放送」と「ハイビジョン」と「デジタル放送」は混ぜちゃイケナイ洗剤だったと考えています。
A)「無料放送(SD)」+「デジタル放送」 → コピられてもいい番組の放送回路。むしろコピラレ隊。
B)「ハイビジョン」+「デジタル放送」 → コピられては困る番組の放送回路
A)は若手の登竜門、非常時(地震など)の情報回路として機能します。むしろ報道や、特に放送大学はCMバンバン入れてもこちらであるべきです。 B)は有料放送でなくともB-CAS+クレカ決済なら録画の有償化(光学ディスクレスのコンテンツ販売)が可能なはずです。むしろ地アナ停波は早い方が、放送回路をA)B)に分けるテレビ局が出て来るかもしれません。
パソコンがあるのになぜ別の機械をかわなきゃいけないの?というのは自然な話だと思います。次世代光学ディスクもいずれ突破されるでしょう。HD-DVDしか出しませんて著作利権がでてくるのはその方が地味に脆弱性が少ないと考えられるからで、M$陰謀論は「僕のせいぢゃないもん効果」のほうが勝ると思います。子供ぢゃないんだから。
手許ではこれまで光学ディスクについて、デクリプトの具体的手法に言及する事は避けてきました。うっかりはあるかもしれませんが、どこでどう使われるか解らないのはなんだかんだ言って作り手に悪いです。パソコン雑誌などが「個人で買ったディスクを個人で楽しむ範囲なら正当と考える」などとして手法を書いている事がありますが、それならOSやアプリのディスクも同じです。
著作利権で商売するなら、光学ディスク等でお客にデータを渡す事が間違いなのかも知れません。光学ディスクのデクリプトは著作利権の侵害うんぬんよりは、ビジネスモデルの問題だと考えています。フェアユースの「理念」を明記せず、個別具体的な事例を列挙するに留まる国内著作権法が、本質と無関係な議論 ~ YouTubeの視聴がダウンロードに当たるか否かなど~ を生んでいると考えています。
MEncoder dev-SVN-r24712-4.0.1
MPEGStreamClipが吐いた.mpegのアスペクト情報を認識せず、一律にSAR=1/1を使用。
-vf scale=-10:-1
が効かず、横長画像を吐出。
ログに
Movie-Aspect is undefined - no prescaling applied.
などとあったので、コマンドに -aspect 4:3(DECODING/FILTERING OPTIONS)を追加したら直った。強制的にデコードアスペクトを指定するものらしい。
*man
-aspect (also see -zoom)
Override movie aspect ratio, in case aspect information is in-
correct or missing in the file being played.
*使用コマンド
-vf yadif=3,pp=l5,framestep=2,crop=704:480:8:0,scale=-10:-1:::3,hqdn3d=4:3:6,harddup -vfm ffmpeg -sws 9 -aspect 4:3 -ofps 30000/1001 -of rawvideo -o /dev/null
自分の理解では
というものです。
白紙枚数は、B使用で1枚。b_pyramidを使うと2枚。uenoBさんによるとこれは QuickTime系の挙動が正しい(規格適合性が高い)。という事は、mencoderが吐くrawvideo.264がオカシイか、MP4boxの書 き出すコンテナヘッ ダがオカシイかのどっちかなのですが、これまたuenoBさんによるとオカシイのはコンテナヘッダ(EditBoxというものが無い)だそうですから、こ れはMP4boxのバグ(と言うかたぶん仕様)と言うべきでしょう。
解決方法としては以下のようなものがあります。
1.は指定精度がやや粗く、厳密には正確性に疑問があります。2.はMP4コンテナに関する限り無敵のQTでコンテナを書き直すわけですが、1. 同様にファイルを一個一個修正する手間があります。おそらく最も信頼性が高いのは3ですが、手許ではMP4Boxのビルド自体が未成功です。4はら けった版 ffmpeg SVN-r8638uでも可能ですので最も手軽かと思います。
以下では2.と4.の方法を解説します。
2007年秋現在、手許では MEncoder と MP4box で映像のみMP4を作り、QTPproで白紙フレームをカット&aiff貼付け。ここからMP4へ 「映像そのまま」「音声AAC」で書き出しています。以下、ちょっと細かく書きます。
これでQTP, VLCとも問題無く再生でき、MP4box -infoで見ても特に問題なさそうなMP4になります。
気になる点はTrack IDが移動する事。元は映像が1・音声が2の場合、音声が1・映像が2に逆転します。QTPpro(林檎+J)で見てもMP4box -infoで見ても同様で、映音のどっちをどっちに貼付けても一緒です。実用上は問題ないと思いますけど。手許の方法では音声の方が総時間 (duration)が非常に地味に長い事が多いので、QTPproは長い方にTrack 1を割り当てる仕様なのかもしれません。
よもやと思ってここからさらに ffmpegでコンテナを書き直してみたところ(後述)、映像が1・音声が2に戻りました。
MyCometG3|白紙フレームに ある通り、
$ ffmpeg -i Input.mp4 -vcodec copy -acodec copy -f mp4 Output.mp4
これだけです。手許ではら けった版 ffmpeg SVN-r8638uで白紙フレームの除去に成功しました。ただし、中にはVLC, QuickTime Player Pro(+avc1Decorder)ともに再生不能になるケースがありましたので、実用にあたっては充分な慎重さが必要だと思います。
特に失敗する事が多かったファイルは、音声のないmp4(MEncoder x264 rawvideo.264のみをmp4boxでmuxしたもの)です。こうしたものは VLCは映像が出ず、QTPproは落ちました。ファイルサイズは概ね元ファイルと同じものが出来上がるので、各ストリームは存在するがコンテナヘッダ がめろめろな状態と思われます。MP4boxによるとコンテナヘッダが一部壊れてるとか、Levelが0 だとか(元は5.1)言い出します。必ず失敗するとは限らないところが趣き深いところです。
ffmpegはコンテナ書き直しに当たって、元ファイルの映像と音声のスタートコード・映像ストリーム中のB/b_pyramidの有無・映音それぞれの周波数(fpsとHz)、などを「総合的に勘案して」コンテナを作り直しているように思え ます。であれば、UenoBさんのパッチ入りMP4Boxなみの信頼性がありそうです。
ところでいま思いついたのですが、MEncoderで直にx264+aac.AVIを吐いて、ffmpegでMP4に書き直しと言う手が使えるか もしれません。そ れならMEncoderのA/V Sync能力が活きてきます。いっそ音声はlame MP3にしてx264+MP3..mp4にしちゃうとか。FAACだったらLameのほうが「体感音質」が上げ 易いですし「そのまま」.FLVにもしやすそうです。まぁ、FLVがBを受け付けるかどうかはともかく。
とりあえず簡単な方法が見つかったのは嬉しいのですが、少なくともらけった版ffmpegでは直にmpeg2録画からx264+ aac.mp4 を作っても白紙フレームが入る。という疑問が残るます。なぜffmpegで直に白紙抜きMP4を吐けないのか。
もしかして、ffmpeg内部の、ナ
ニカ → libavformat 間のインタフェイスも「フレーム並べ替え」を扱えないのではないでせうか。
つまり mencoder内部の mencoder.c
→ libavformat(-of lavf)と同様。
黄色部分をなんと言うのか知りませんが「符 号化マネージャ(仮)」と呼ぶ事にします。
素材ファイル
↓
demuxer ーーーーー→音声デコーダ
(略)
↓
映像デコーダ:YUV 420などにデコード
↓
┌ーーーーーーーーーーー┐ー
→
「A)ブツと伝票」ー→ コデック:伝票に従って作業(エンコード)
|符号化マネージャ(仮)| ↓
┘
└ーーーーーーーーーーー←
ー
「A')ブツと伝票」ー
ー
ー
ー
ーーーー
ー
ー
ー
ー
ー
ー┘
↓「B)ブツと伝票」を渡す。
↓コンテナ muxer
Aは発注伝票で、A’は仕上がり伝票。Bはコンテナmuxer向けの発注伝票。という事にします。伝票だから定形です。決まった事しか書けませ ん。
A伝の内容では、B伝の記載項目を埋められないのではないか。または、A’にはB伝の記載項目は全て書いてあるのだけど、符号化マネージャ(仮)から見ると「欄外に余計 なメモ書くな!」ってカンジで無視 しちゃうのではないか。
どちらにしてもコンテナmuxerは必要な情報が足りないので、Bがあろうが(bframes<=1)ランダムにBが 入っていようが(b_adapt)、B参照があろうが(b_pyramid)、EditBoxなるものをMP4コンテナに書き込めない。という事ではない か。そのへんはブツのナカミ(rawvideo stream)を見て勝手にやっちまえばいいぢゃんかと思うのですが、それを許すとマネージャの存在意義がなくな る、というか他の部分がぐだぐだになるのでしょう。図では適当ですがdemuxerや各種デコーダもマネージャと伝票をやりとりしてるはずです。
ようするにどっちの マネージャもVfWモデルなのだと思います。フレームは来た順に処理するもので、「フレーム並べ替え」とか 「Presentation Time StampとDecoding Time Stampは違う事がある」とかは「欄外の余計なメモ」。ミヒャエル・ネーデルマイヤーさん (ffmpegの開発者)も「linuxに1-frame-in 1-frame-out原則を突破した動画インフラはまだ無い」とmcdeintの解説で書いてたような記憶があるます。
いずれにせよ符号化 マネージャ(仮)の改訂は、QuickTime やDirectShowを一から作るようなもので、手を出しにくいのではないかと思います。
そのffmpegで白紙入りMP4を直せるという事は、ffmpeg内部のコンテナmuxer (FFmpeg libavformat muxers)は、符号化マネージャの改訂に先行して開発が進んでいる。ということだと思います。もしかしたらlibavutilなるものがナニカのハッ キングを駆使しているのかもしれません。
libavcodec, libavformat, libavutilなどを、既存の符号化マネージャ(仮)と切り 離せるような形で整備していけば、QuickTime やDirectShowに比肩し得る動画インフラの開発負担が減るはずです(だから開発者メーリングリストに "独自のルールに五月蝿い"って評判がたつんジャマイカ)。
実はこれはちょっと根が深いんではないかと思っています。MP4のコンテナ回りに関する限りQT系は最後に疑うべき存在なのですが、白紙フ レームはVfW/AVI にBフレームを突っ込む工夫に端を発しているようで、 Linux / Win由来のものはツールにしてもプレイヤにしても、どこに落とし穴があるか知れません。VfWベースでなくても「VfW/AVIで動画プログラミングに 目覚めたプログラマさん」だったら、作りかたやMP4コンテナの理解度に影響ないとは言えません。いやもちろんオレも解ってやしませんが。
従前、自分は白紙フレームをDelay Frameと呼んでいましたが、実際にはVideoStreamに書き込まれるものではなく、AVI/VfWでBフレームを扱う為のダマしを便宜上そう呼 んでいるだけのようです。11個しか入ってない卵のパックに「12個入り!」と印刷するようなもんですか。それをギョーカイ用語で「Delay Frame」と呼ぶ、みたいな。
LinuxやWinの動画ツールやプレイヤは「それが世の中ってもんでしょ」ってカンジでスルーする(または11個として扱う)みた いですが、QT系は「一個足りねぇ!」と言う。口が無いから代わりに白紙フレームを出す、みたいな。
実際に作 り方によっては末尾フレームが1個欠けている筈ですし(MEncoderとVfW版x264はたぶんそう)、Xvid映像とMP3音声をmuxしてAVI にする際に音声にミリセカンド単位のdelayを掛け るのも、この「AVIにBフレームを突っ込むための工夫」の余波と思われます。ついでに言うとPS3もXBox 360もMPEG-4 ASP(Bフレームを使ったDivx, Xvid, libavcodec mpeg-4)をサポートしていない遠因であるかもしれません。
いずれにせよ白紙フレーム問題は根が深いものがあります。Xvid+MP3.AVIが広く人口に膾炙しただけに、この工夫はどこに潜 んでいるか解りません。様々なプレイヤや作成ツールがこのハッキングを前提に(あるいは意識せずに)作られ、使われているようです。
なお、win上で白紙フレーム問題があまり重用視されていないように見えるのは、再生環境がいろいろだからのようです。→Stage6 VFR_maniac|delayとB-pictures。またXvid+MP3.AVI以来の「音声に遅延 入れる作り方」が一般的な様子なので顕在化しにくいというのもあるかも知れません。
QuickTime アプリケーションに以下の Media Type サポートを追加するコンポーネント:
*Windows Mediaはサポートしない。要 Flip4Mac WMV コンポーネント。
*FFMPEG libavcodec 群の移植。Winにおけるffdshow相当だが、ビジュアライゼーションなどの分析ツールは実装していない(2007秋現在)。
*これでQuickTime Player がほぼVLC / MPlayer相当になる。ちなみにApple TV改造派が真っ先に突っ込んだのはコレ(2007年)。
*FFusion, QuickTime Xvid コンポーネントの開発者が参加(またはコード提供)。
Bits Per Pixel, 1ピクセルあたりのbit数です。
bpp = vbitrate * 1000 / (width * height * fps)静止画の「色深度」に相当するものです。 MPEG-4 ASP(libavcodec mpeg-4やXvid)の初期に画質指標として使われていました(表中のASPの経験則)。MPEG-4 ASPでは 0.2(SDで2000kbps程度)あればだいたい大丈夫とされていましたが、より性能の高いH.264/AVCではもうすこし下げても良い筈です。
例えば、H.264/AVCのプロトタイプ(H.26L)は720x480@1Mbpsで、"素材と見分けがつかない"という評価を出していますが、これをBPPに換算すると0.10~0.13に相当します。
ただしあくまで大雑把な目安です。動画エンコードは静止画と異なり、体感画質に『動き』が大きく影響しますので、BPPと「画質」は必ずしも一致しません。
しかしながら、BPPを揃えてエンコードしてやると、様々なH.264コデックやフロントエンド、また解像度やfpsの違いを超えて、大雑把に主観画質を比較できる可能性があります。例えば、640x272@24fpsの1024kbpsと、720x480@24fpsの2048kbpsは、SSIMを同列に比較できるという事になるハズです。
なお、Apple TVがやけにBPPが高いのは、再生できるビットレート上限をそのまま入れている為です。QuickTime系フロントエンドはシークの追従性を重視して、大量のI/IDRを挿入する傾向(最小GOP間隔が1~5秒)がありますから、厳密な画質比較の際はこれも考慮する必要がありそうです。
MP4Box -h
$ MP4box -h
MP4Box [option] input [option]
-h general: general options help
-h hint: hinting options help
-h import: import options help
-h encode: encode options help
-h meta: meta handling options help
-h extract: extraction options help
-h dump: dump options help
-h swf: Flash (SWF) options help
-h crypt: ISMA E&A options help
-h format: supported formats help
-nodes: lists supported MPEG4 nodes
-node NodeName: gets MPEG4 node syntax and QP info
-xnodes: lists supported X3D nodes
-xnode NodeName: gets X3D node syntax
-snodes: lists supported SVG nodes
-snode NodeName: gets SVG node syntax
-languages: lists supported ISO 639 languages
-quiet: quiet mode
-v: verbose mode
-version: gets build version
MP4Box - GPAC version 0.4.4
GPAC Copyright: (c) Jean Le Feuvre 2000-2005
(c) ENST 2005-200X
MP4Box -h general
$ MP4box -h general
General Options:
-inter time_in_ms interleaves file data (track chunks of time_in_ms)
* Note 1: Interleaving is 0.5s by default
* Note 2: Performs drift checking accross tracks
* Note 3: a value of 0 disables interleaving
-old-inter time same as -inter but doesn't perform drift checking
-tight: performs tight interleaving (sample based) of the file
* Note: reduces disk seek but increases file size
-flat stores file with all media data first, non-interleaved
-frag time_in_ms fragments file (track fragments of time_in_ms)
* Note: Always disables interleaving
-out filename specifies output file name
* Note: By default input (MP4,3GP) file is overwritten
-tmp dirname specifies directory for temporary file creation
* Note: Default temp dir is OS-dependent
-no-sys removes all MPEG-4 Systems info except IOD (profiles)
* Note: Set by default whith '-add' and '-cat'
-no-iod removes InitialObjkectDescriptor from file
-isma rewrites the file as an ISMA 1.0 AV file
-ismax same as '-isma' and removes all clock references
-3gp rewrites as 3GPP(2) file (no more MPEG-4 Systems Info)
* Note 1: some tracks may be removed in the process
* Note 2: always on for *.3gp *.3g2 *.3gpp
-ipod rewrites the file for iPod
-brand ABCD[:v] sets major brand of file, with optional version
-ab ABCD adds given brand to file's alternate brand list
-rb ABCD removes given brand from file's alternate brand list
-cprt string adds copyright string to movie
-chap file adds chapter information contained in file
-rem trackID: removes track from file
-new: forces creation of a new destination file
-rem trackID: removes track from file
-lang [tkID=]LAN: sets track language. LAN is the ISO 639-2 code (eng, und)
-delay tkID=TIME: sets track start delay in ms.
-par tkID=PAR: sets visual track pixel aspect ratio (PAR=N:D or "none")
-name tkID=NAME: sets track handler name
* NAME can indicate a UTF-8 file ("file://file name"
-itags tag1[:tag2]: sets iTunes tags to file - more info: MP4Box -tag-list.
-split time_sec splits in files of time_sec max duration
* Note: this removes all MPEG-4 Systems media
-split-size size splits in files of max filesize kB.
* Note: this removes all MPEG-4 Systems media
-split-chunk S:E extracts a new file from Start to End (in seconds)
* Note: this removes all MPEG-4 Systems media
MP4Box - GPAC version 0.4.4
GPAC Copyright: (c) Jean Le Feuvre 2000-2005
(c) ENST 2005-200X
$ /Applications/Video/mp4box_EvalVid/MP4Box -h hint
Hinting Options
-hint: hints the file for RTP/RTSP
-mtu size: specifies RTP MTU (max size) in bytes. Default size is 1450
* Note: this includes the RTP header (12 bytes)
-copy: copies media data to hint track rather than reference
* Note: speeds up server but takes much more space
-multi [maxptime]: enables frame concatenation in RTP packets if possible
maxptime: max packet duration in ms (optional, default 100ms)
-rate ck_rate: specifies rtp rate in Hz when no default for payload
* Note: default value is 90000 (MPEG rtp rates)
-mpeg4: forces MPEG-4 generic payload whenever possible
-latm: forces MPG4-LATM transport for AAC streams
-static: enables static RTP payload IDs whenever possible
* By default, dynamic payloads are always used
MPEG-4 Generic Payload Options
-ocr: forces all streams to be synchronized
* Most RTSP servers only support synchronized streams
-rap: signals random access points in RTP packets
-ts: signals AU Time Stamps in RTP packets
-size: signals AU size in RTP packets
-idx: signals AU sequence numbers in RTP packets
-iod: prevents systems tracks embedding in IOD
* Note: shouldn't be used with -isma option
-add-sdp string: adds sdp string to (hint) track ("-add-sdp tkID:string")
or movie. This will take care of SDP lines ordering
* WARNING: You cannot add anything to SDP, cf rfc2327.
-unhint: removes all hinting information.
$ /Applications/Video/mp4box_EvalVid/MP4Box -h import
Importing Options
File importing syntax:
"#video" "#audio": base import for most AV files
"#trackID=ID": track import for IsoMedia and other files
"#pid=ID": stream import from MPEG-2 TS
":dur=D": imports only the first D seconds
":lang=LAN": sets imported media language code
":delay=delay_ms": sets imported media initial delay in ms
":par=PAR": sets visual pixel aspect ratio (PAR=Num:Den)
":name=NAME": sets track handler name
":fps=VAL": same as -fps option
":agg=VAL": same as -agg option
":par=VAL": same as -par option
":dref": same as -dref option
":nodrop": same as -nodrop option
":packed": same as -packed option
":sbr": same as -sbr option
":sbrx": same as -sbrx option
":mpeg4": same as -mpeg4 option
-add file: add file tracks to (new) output file
-cat file: concatenates file samples to (new) output file
* Note: creates tracks if needed
-keep-sys: keeps all MPEG-4 Systems info when using '-add' / 'cat'
-keep-all: keeps all existing tracks when using '-add'
* Note: only used when adding IsoMedia files
All the following options can be specified as default or for each track.
When specified by track the syntax is ":opt" or ":opt=val".
-dref: keeps media data in original file
-no-drop: forces constant FPS when importing AVI video
-packed: * forces packed bitstream when importing raw ASP
-sbr: backward compatible signaling of AAC-SBR
-sbrx: non-backward compatible signaling of AAC-SBR
* Note: SBR AAC cannot be detected at import time
-fps FPS: forces frame rate for video and SUB subtitles import
* For raw H263 import, default FPS is 15
* For all other imports, default FPS is 25
-- THIS IS IGNORED FOR IsoMedia IMPORT --
-mpeg4: forces MPEG-4 sample descriptions when possible (3GPP2)
-agg N: aggregates N audio frames in 1 sample (3GP media only)
* Note: Maximum value is 15 - Disabled by default
$ /Applications/Video/mp4box_EvalVid/MP4Box -h encode
MPEG-4 Scene Encoding Options
-mp4: specify input file is for encoding.
-def: encode DEF names
-sync time_in_ms: forces BIFS sync sample generation every time_in_ms
* Note: cannot be used with -shadow
-shadow time_ms: forces BIFS sync shadow sample generation every time_ms.
* Note: cannot be used with -sync
-log: generates scene codec log file if available
-ms file: specifies file for track importing
Chunk Processing
-ctx-in file: specifies initial context (MP4/BT/XMT)
* Note: input file must be a commands-only file
-ctx-out file: specifies storage of updated context (MP4/BT/XMT)
LASeR Encoding options
-auto_quant res: resolution is given as if using -resolution
but coord-bits and scale-bits are infered
-resolution res: resolution factor (-8 to 7, default 0)
all coords are multiplied by 2^res before truncation
-coord-bits bits: bits used for encoding truncated coordinates
(0 to 31, default 12)
-scale-bits bits: extra bits used for encoding truncated scales
(0 to 4, default 0)
$ /Applications/Video/mp4box_EvalVid/MP4Box -h meta
Meta handling Options
-set-meta args: 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
-add-item args: 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
-rem-item args: removes resource from meta - syntax: item_ID[:tk=ID]
-set-primary args: sets item as primary for meta - syntax: item_ID[:tk=ID]
-set-xml args: sets meta XML data
* syntax: xml_file_path[:tk=ID][:binary]
-rem-xml [tk=ID]: removes meta XML data
-dump-xml args: dumps meta XML to file - syntax file_path[:tk=ID]
-dump-item args: dumps item to file - syntax item_ID[:tk=ID][:path=fileName]
-package: packages input XML file into an ISO container
* all media referenced except hyperlinks are added to file
$ /Applications/Video/mp4box_EvalVid/MP4Box -h extract
Extracting Options
-raw TrackID: extracts track in raw format when supported
-raws TrackID: extract each track sample to a file
* Note: "TrackID:N" extracts Nth sample
-nhnt TrackID: extracts track in nhnt format
-nhml TrackID: extracts track in nhml format (XML nhnt).
* Note: "-nhml +TrackID" for full dump
-single TrackID: extracts track to a new mp4 file
-avi TrackID: extracts visual track to an avi file
-qcp TrackID: same as '-raw' but defaults to QCP file for EVRC/SMV
-aviraw TK: extracts AVI track in raw format
$TK can be one of "video" "audio" "audioN"
-saf: remux file to SAF multiplex
* Note: can be used when encoding scene descriptions
$ /Applications/Video/mp4box_EvalVid/MP4Box -h dump
Dumping Options
-std: dumps to stdout instead of file
-info [trackID] prints movie info / track info if trackID specified
* Note: for non IsoMedia files, gets import options
-bt: scene to bt format - removes unknown MPEG4 nodes
-xmt: scene to XMT-A format - removes unknown MPEG4 nodes
-wrl: scene VRML format - removes unknown VRML nodes
-x3d: scene to X3D/XML format - removes unknown X3D nodes
-x3dv: scene to X3D/VRML format - removes unknown X3D nodes
-lsr: scene to LASeR format
-diso: scene IsoMedia file boxes in XML output
-drtp: rtp hint samples structure to XML output
-dts: prints sample timing to text output
-sdp: dumps SDP description of hinted file
-dcr: ISMACryp samples structure to XML output
-ttxt: Converts input subtitle to GPAC TTXT format
-ttxt TrackID: Dumps Text track to GPAC TTXT format
-srt: Converts input subtitle to SRT format
-srt TrackID: Dumps Text track to SRT format
-stat: generates node/field statistics for scene
-stats: generates node/field statistics per MPEG-4 Access Unit
-statx: generates node/field statistics for scene after each AU
$ /Applications/Video/mp4box_EvalVid/MP4Box -h swf
SWF Importer Options
MP4Box can import simple Macromedia Flash files (".SWF")
You can specify a SWF input file with '-bt', 'xmt' and '-mp4' options
-global: all SWF defines are placed in first scene replace
* Note: By default SWF defines are sent when needed
-ctrl: uses a dedicated stream for movie control
* Note: Forces '-global'
-no-text: removes all SWF text
-no-font: removes all embedded SWF Fonts (terminal fonts used)
-no-line: removes all lines from SWF shapes
-no-grad: removes all gradients from swf shapes
-quad: uses quadratic bezier curves instead of cubic ones
-xlp: support for lines transparency and scalability
-flatten ang: complementary angle below which 2 lines are merged
* Note: angle '0' means no flattening
$ /Applications/Video/mp4box_EvalVid/MP4Box -h crypt
ISMA Encryption/Decryption Options
-crypt drm_file: crypts a specific track using ISMA AES CTR 128
-decrypt [drm_file] decrypts a specific track using ISMA AES CTR 128
* Note: drm_file can be omitted if keys are in file
-set-kms kms_uri changes KMS location for all tracks or a given one.
* to adress a track, use 'tkID=kms_uri'
DRM file syntax for GPAC ISMACryp:
File is XML and shall start with xml header
File root is an "ISMACryp" element
File is a list of "ISMACrypTrack" elements
ISMACrypTrack attributes are
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)
Encryption only attributes:
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
$ /Applications/Video/mp4box_EvalVid/MP4Box -h format
Suppported raw formats and file extensions:
NHNT .media .nhnt .info
NHML .nhml (opt: .media .info)
MPEG-1-2 Video .m1v .m2v
MPEG-4 Video .cmp .m4v
H263 Video .263 .h263
AVC/H264 Video .h264 .h26L .264 .26L
JPEG Images .jpg .jpeg
PNG Images .png
MPEG 1-2 Audio .mp3, .m1a, .m2a
ADTS-AAC Audio .aac
AMR(WB) Audio .amr .awb
EVRC Audio .evc
SMV Audio .smv
Supported containers and file extensions:
AVI .avi
MPEG-2 PS .mpg .mpeg .vob .vcd .svcd
MPEG-2 TS .ts .m2t
QCP .qcp
OGG .ogg
ISO-Media files no extension checking
Supported text formats:
SRT Subtitles .srt
SUB Subtitles .sub
GPAC Timed Text .ttxt
QuickTime TeXML Text .xml (cf QT documentation)
Supported Scene formats:
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)
$ /Applications/Video/mp4box_EvalVid/MP4Box -nodes
Available MPEG-4 nodes in this build (encoding/decoding/dumping):
Anchor
AnimationStream
Appearance
AudioBuffer
AudioClip
AudioDelay
AudioFX
AudioMix
AudioSource
AudioSwitch
Background
Background2D
Billboard
Bitmap
Box
Circle
Collision
Color
ColorInterpolator
CompositeTexture2D
CompositeTexture3D
Conditional
Cone
Coordinate
Coordinate2D
CoordinateInterpolator
CoordinateInterpolator2D
Curve2D
Cylinder
CylinderSensor
DirectionalLight
DiscSensor
ElevationGrid
Extrusion
Fog
FontStyle
Form
Group
ImageTexture
IndexedFaceSet
IndexedFaceSet2D
IndexedLineSet
IndexedLineSet2D
Inline
LOD
Layer2D
Layer3D
Layout
LineProperties
ListeningPoint
Material
Material2D
MovieTexture
NavigationInfo
Normal
NormalInterpolator
OrderedGroup
OrientationInterpolator
PixelTexture
PlaneSensor
PlaneSensor2D
PointLight
PointSet
PointSet2D
PositionInterpolator
PositionInterpolator2D
ProximitySensor2D
ProximitySensor
QuantizationParameter
Rectangle
ScalarInterpolator
Script
Shape
Sound
Sound2D
Sphere
SphereSensor
SpotLight
Switch
TermCap
Text
TextureCoordinate
TextureTransform
TimeSensor
TouchSensor
Transform
Transform2D
Valuator
Viewpoint
VisibilitySensor
WorldInfo
AcousticMaterial
AcousticScene
ApplicationWindow
DirectiveSound
Hierarchical3DMesh
MaterialKey
PerceptualParameters
TemporalTransform
TemporalGroup
ServerCommand
InputSensor
MatteTexture
MediaBuffer
MediaControl
MediaSensor
CoordinateInterpolator4D
NonLinearDeformer
PositionAnimator
PositionAnimator2D
PositionInterpolator4D
ScalarAnimator
Clipper2D
ColorTransform
Ellipse
LinearGradient
PathLayout
RadialGradient
TransformMatrix2D
Viewport
XCurve2D
XFontStyle
XLineProperties
123 nodes supported - 48 nodes not supported