技術的信頼性:2%
感想:
movie
exporterに慣れていない開発者の為に。Movie Export
Component (MovieExportType
or 'spit'
as they are called after their four character code)
はムービーをなんらかの他フォーマットに変換し、他のアプリケーションやデバイスで使えるようにするコンポーネントです。例えば、iPod movie
export component はアプリケーションに、QuickTimeムービーからvideo と audio
mediaを取り出してVideo iPodに適したH.264 / AAC-LC データの入った .m4v
ファイルに書き出す機能を付与します。
export componentを見つけるには、Component Manager FindNextComponent
APIを使います。このコンポーネントの各種属性は、component description record (ComponentDescription
)
にあります。以下を指定して下さい。the componentType
,
componentSubType
,
componentManufacturer
and componentFlags
fields。
Export componentは、the componentSubType
の指
定値を使ってサポートするデータタイプを決定し、the componentFlags
&
nbsp;fieldでより詳細な固有の能力のパラメータを決定します。
指定された export component (Component
)
が見つかったら、それを開くには OpenAComponent
.を呼び出さなければなりません。
OpenAComponent
は、そのコンポーネントのインスタンス(ComponentInstance
)
を返します。ここで返って来たインスタンスが MovieExportToDataRef
や、
ConvertMovieToDataRef
のようなexport APIで使えるものです。
目的のcomponentがcomponentType
と componentSubType
フィー
ルドだけで記述できるもの(*恐らく呼び出すだけで各種エンコードオプションの指定値を決めうちでcomponentFlags
に
入れてくれるもの*)であれば、componentの捜索とオープンに便利な OpenADefaultComponent
APIを使う事もできます。
開いたcomponentを使い終わったら CloseComponent
を
呼び出して、その都度、必ず、どんなものでも、閉じて下さい。
最初のiPod export component は QuickTime 7.0.3で出荷され、最大320x240のH.264 videoをサポートしていました。QuickTime 7.1.3以降では最大640x480です。
iPod export componentを見つけるには(*To find*)、Table 1に示したcomponent descriptionを使って下さい。
Table 1: Component Description for the iPod export component.
Component Description | iPod Exporter |
---|---|
componentType |
MovieExportType |
componentSubType |
'M4V ' |
componentManufacturer |
kAppleManufacturer |
componentFlags |
0 |
componentFlagsMask |
kAnyComponentFlagsMask |
第5世代 iPod (firmware 1.2以降) は、.m4vファイルの再生をサポートしています。条件は H.264 video のプロファイルが以下2種類のうちの一つであること (Table 2 と 3を参照)。320x240 Baseline profile (Level 1.3まで) または 640x480 Baseline Low-Complexity profile、音声はいずれも AAC-LC audio。
Table 2: Baseline Low-Complexity .m4v file type.
Media | Codec | Max. Bitrate | Rate | Max. Size/Channels | Profile |
---|---|---|---|---|---|
Video | H.264 | 1.5 Mbps | 30 fps | 640x480 | Baseline Low-Complexity |
Audio | AAC-LC | 160 Kbps | 48 kHz | Stereo, 2 |
Table 3: Baseline (up to Level 1.3) .m4v file type.
Media | Codec | Max. Bitrate | Rate | Max. Size/Channels | Profile |
---|---|---|---|---|---|
Video | H.264 | 768 Kbps | 30 fps | 320x240 | Baseline (up to Level 1.3) |
Audio | AAC-LC | 160 Kbps | 48 kHz | Stereo, 2 |
Note: H.264 規格には、使っても良い要素技術を指定するprofileというものがあります。Baseline profileのlebelに関する情報は H.264 Profiles(*Wikipedia - en)を見て下さい。
H.264 Baseline Low-Complexity profile は、Appleが iPodのために定めたものです。
iPod
exporterを使ったexport工程の出力結果を決めるのは、exporterに渡される素材ムービーのプロパティです。この中でもっとも重要なの
はムービーサイズです。これは次のものが返します。the GetMovieBox
API, または the QTMovie
-attributeForKey
:
method
using the QTMovieCurrentSizeAttribute
key.
iPod export componentが生成する.m4vファイルが、Baseline Low-Complexity profile .m4v file (Table 2)になるか、それともBaseline profile .m4v file (Table 3)になるかはソースムービーのイメージサイズによります。
iPod用のexport機能を付け加えたいデベロッパは、設定を受け付けるexportダイヤログでspecific output profileオプションを作れると思うかもしれません。しかしながら、iPod export componentはユーザーやデベロッパが指定出来るオプションを一切提供しないと知る事 が重要です。
IMPORTANT:
iPod exporter component flag hasMovieExportUserInterface
は clearです。これは、このコンポーネントがいかなるユーザーインタフェイスも提供していない事を示しています。
Note:
The rectangle enclosing the
movie display
boundary region is called the movie box. QuickTime provides the SetMovieBox
API allowing you to size and place a movie in the display coordinate
system. QuickTime automatically adjusts the movie matrix to satisfy
your request. The movie box may also be modified by adjusting the movie
transformation matrix directly.
A movie's composition and size may differ depending on the selected aperture mode. For example, if Clean Aperture mode is selected, a 4:3 DV NTSC track appears as 640x480 and a 16:9 DV NTSC track appears as 853x480. Because the represented size of a movie may differ depending on aperture mode, the output produced by the iPod exporter may also differ.
iPod export component は出力する.mp4ファイルに使う profileをソースムービーのイメージサイズを見て決めます。
出力ムービーのイメージサイズとprofileを決める条件をTable 4に示します。
Table 4:
Source Movie Size | Destination Movie Size | Destination Movie Profile |
---|---|---|
320x240以下 (≤ 320x240) |
素材と同じ | Baseline Profile up to Level 1.3 |
320x240よりも大きいが
640x480以下 (> 320x240 ≤ 640x480) |
素 材と同じ | Baseline Low-Complexity |
640x480よりも
大きい (> 640x480) |
アスペクト比を維持して640x480以内にスケーリ
ング |
Baseline Low-Complexity |
出力ムービーサイズにバラエティがあるので、目標となる データレートはそれに応じて計算されます (scalingが必要だった場合はその後の movie image size です)。(*以下、データレートの計算に使うフレームサイズを effective movie image sizeと呼んでいます*)
出力データレートは以下の通り:
effective movie image size がQVGA (320 x 240) 以下なら、700kbps.
effective movie image size がHVGA (640 x 240)よりも大きければ、1.5 Mbps (1500 kbps).
effective
movie image size が上記二つの間の場合、データレートは次の式で補間(* is
interpolated*)される:
データレート(kbps) =
{ (イメージ中のマクロブロック数 * 8 ) / 3 } - 100
movie image sizeはmovie image中のマクロブロック数に基づいて決定する(*マクロブロック一個の大きさは16x16ピクセル*)。
Note: The codec will also attempt to maintain a peak data rate under 249600 bytes over a 2.6 second period.
*なんだこれわ。これとは別にThe codecが2.6秒区間のピークデータレートが249600 byte以下に収まるよう努力します?
Apple TV export component は QuickTime 7.1.5 以降で使用可能で、以下のexportをサポートします:
Apple TV export componentを見つけるには(*To find)、Table 5のcomponent descriptionを使います。
Table 5: Component Description for the Apple TV export component.
Component Description | iPod Exporter |
---|---|
componentType |
MovieExportType |
componentSubType |
'M4VH' |
componentManufacturer |
kAppleManufacturer |
componentFlags |
0 |
componentFlagsMask |
kAnyComponentFlagsMask |
Apple TV は、Table 6.に示すように、 Main Profile@最大 Level 3.1 のH.264 プログレッシブ(Bフレーム入り)、最大1280x720 (720p)、24 fpsのビデオと、AAC-LC stero audio(最大サンプリングレート 44.1kHz)を再生する能力を持っています。
Table 6: Progressive Main Profile with B-Frames .m4v file type.
Media | Codec | Max. Bitrate | Rate | Max. Size/Channels | Profile | Max. Profile Level |
---|---|---|---|---|---|---|
Video | H.264 | 5 Mbps* | 30 fps** | 1280x720 | Progressive Main Profile with B-Frames | 3.1 |
Audio | AAC-LC | 128 Kbps | 44.1 kHz | Stereo, 2 |
*Maximum spikes may be as high as 12 Mbps.(*ピークは最大で12Mbps)
**Maximum frame rate for 1280x720 content is 24 fps.(*1280x720の最大fpsは24)
Apple TV
exporterを使ったexport工程の出力結果を決めるのは、exporterに渡される素材ムービーのプロパティです。この中でもっとも重要なの
はムービーサイズです。これは次のものが返します。the GetMovieBox
API, または the QTMovie
-attributeForKey
:
method
using the QTMovieCurrentSizeAttribute
key.
Apple TV export component はソースムービーのイメージサイズとフレームレートに応じて適切な .m4v ファイルを生成します。
Apple TV用のexport機能を付け加えたいデベロッパは、設定を受け付けるexportダイヤログでspecific output profileオプションを作れると思うかもしれません。しかしながら、Apple TV export componentはユーザーやデベロッパが指定出来るオプションを一切提供しないと知る事 が重要です。
IMPORTANT:
Apple TV exporter component flag hasMovieExportUserInterface
は clearです。これは、このコンポーネントがいかなるユーザーインタフェイスも提供していない事を示しています。
出力ムービーのイメージサイズはソースムービーのイメージサイズとフレームレートで決まります。最大解像度は24fpsなら 1280x720 at 24 fps、30fpsなら960x540 です。
Table 7:
ソースフレームレート | ソースサイズが 960x540以下 (≤ 960x540) |
ソースサイズが 1280x720以下 (≤ 1280x720) |
ソースサイズが 1280x720より大きい (> 1280x720) |
---|---|---|---|
25 fpsより小さい (< 25) |
縦横比は素材と同じ | 縦横比は素材と同じ | 縦
横比を維持して 1280x720 以下に収まるようスケーリング |
25
fps以上 (≥ 25) |
縦横比は素材と同じ | 縦
横比を維持して 960x540 以下に収まるようスケーリング |
縦横比を維持して 960x540 以下に収まるようスケーリング |
*960x540は1920x1080の
ちょうど半分。つまりスケーリングで1080iのインタレ解除をやる「なにも考えなくて良いです」仕様。
あとPAL
のHD光ディスクもこのサイズになっちゃうのかな。
さらに、エンコー ド後のムービーの中でデータレートは最大12 Mbpsまで変動できます。
Table 8:
Destination Movie Size | Max. Destination Movie Data Rate |
---|---|
320x240
以下 (≤ 320x240) |
768 kbps |
320x240
よりも大きく848x480以下 (> 320x240 ≤ 848x480) |
3000 kbps |
848x480よりも大きく1280x720以下 (> 848x480 ≤ 1280x720) |
5000 kbps |
http://www.xbox.com/en-US/community/news/2007/0408-im.htm?WText.camp=TS1-InstantMessaging&WText.campSrc=Home
・ H.264 video support: Up to 15 Mbps, Baseline, Main, and High (up to level 4.1) Profiles with 2 channel AAC LC and Main Profiles.
・ Added MPEG-4 Part 2 video support: Up to 8 Mbps, Simple Profile with 2 channel AAC LC and Main Profiles.
じわじわではありますけどXbox360も対応フォーマット増やしてきましたね。