0
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

自分のApple製ハードウェアが対応してるエンコーダーの種類を調べる(2020年度 M1 chip 搭載MacBook Pro版)

Last updated at Posted at 2020-11-22

M1チップを搭載したMacBook Proが届いたので、今まで作っていたビデオ系のアプリを新しい"My new gear"であるこいつでビルドして動かしたところクラッシュ。

調べてみると、ハードウェアエンコーダーの指定を行うとクラッシュすることがわかった。

というわけで、前に書いた自分のApple製ハードウェアが対応してるエンコーダーの種類を調べるの記事をもとに新しいM1チップを積んでるMacがどんなハードウェアエンコーダーを積んでいるかをチェックしてみた。

結果が以下である。

{
    CodecName = "24-bit RGB";
    CodecType = 24;
    DisplayName = "24-bit RGB";
    EncoderID = "com.apple.videotoolbox.videoencoder.24rgb";
    EncoderName = "Apple 24-bit RGB";
    PerformanceRating = 0;
},
{
    CodecName = "32-bit ARGB";
    CodecType = 32;
    DisplayName = "32-bit ARGB";
    EncoderID = "com.apple.videotoolbox.videoencoder.32argb";
    EncoderName = "Apple 32-bit ARGB";
    PerformanceRating = 0;
},
{
    CodecName = "Apple ProRes 422";
    CodecType = 1634755438;
    DisplayName = "Apple ProRes 422";
    EncoderID = "com.apple.videotoolbox.videoencoder.prores-422";
    EncoderName = "Apple ProRes 422";
},
{
    CodecName = "Apple ProRes 422 HQ";
    CodecType = 1634755432;
    DisplayName = "Apple ProRes 422 HQ";
    EncoderID = "com.apple.videotoolbox.videoencoder.prores-422hq";
    EncoderName = "Apple ProRes 422 HQ";
},
{
    CodecName = "Apple ProRes 422 LT";
    CodecType = 1634755443;
    DisplayName = "Apple ProRes 422 LT";
    EncoderID = "com.apple.videotoolbox.videoencoder.prores-422lt";
    EncoderName = "Apple ProRes 422 LT";
},
{
    CodecName = "Apple ProRes 422 Proxy";
    CodecType = 1634755439;
    DisplayName = "Apple ProRes 422 Proxy";
    EncoderID = "com.apple.videotoolbox.videoencoder.prores-422proxy";
    EncoderName = "Apple ProRes 422 Proxy";
},
{
    CodecName = "Apple ProRes 4444";
    CodecType = 1634743400;
    DisplayName = "Apple ProRes 4444";
    EncoderID = "com.apple.videotoolbox.videoencoder.prores-4444";
    EncoderName = "Apple ProRes 4444";
},
{
    CodecName = "Apple ProRes 4444 XQ";
    CodecType = 1634743416;
    DisplayName = "Apple ProRes 4444 XQ";
    EncoderID = "com.apple.videotoolbox.videoencoder.prores-4444xq";
    EncoderName = "Apple ProRes 4444 XQ";
},
{
    CodecName = "H.263";
    CodecType = 1748121139;
    DisplayName = "H.263";
    EncoderID = "com.apple.videotoolbox.videoencoder.h263";
    EncoderName = "Apple H.263 (SW)";
    PerformanceRating = "-10";
},
{
    CodecName = "H.264";
    CodecType = 1635148593;
    DisplayName = "Apple H.264 (HW)";
    EncoderID = "com.apple.videotoolbox.videoencoder.ave.avc";
    EncoderName = "Apple H.264 (HW)";
    IsHardwareAccelerated = 1;
    PerformanceRating = 400;
},
{
    CodecName = "H.264";
    CodecType = 1635148593;
    DisplayName = "Apple H.264 (SW)";
    EncoderID = "com.apple.videotoolbox.videoencoder.h264";
    EncoderName = "Apple H.264 (SW)";
    PerformanceRating = 200;
},
{
    CodecName = HEVC;
    CodecType = 1752589105;
    DisplayName = "Apple HEVC (HW)";
    EncoderID = "com.apple.videotoolbox.videoencoder.ave.hevc";
    EncoderName = "Apple HEVC (HW)";
    IsHardwareAccelerated = 1;
    PerformanceRating = 400;
    QualityRating = 90;
    SupportedSelectionProperties =     {
        ProfileLevel =         (
            "HEVC_Main_AutoLevel",
            "HEVC_Main10_AutoLevel"
        );
    };
},
{
    CodecName = HEVC;
    CodecType = 1752589105;
    DisplayName = "Apple HEVC (SW)";
    EncoderID = "com.apple.videotoolbox.videoencoder.hevc.vcp";
    EncoderName = "Apple HEVC (SW)";
    PerformanceRating = 0;
    QualityRating = 100;
    SupportedSelectionProperties =     {
        ProfileLevel =         (
            "HEVC_Main_AutoLevel",
            "HEVC_Main10_AutoLevel"
        );
    };
},
{
    CodecName = JPEG;
    CodecType = 1785750887;
    DisplayName = "Apple JPEG";
    EncoderID = "com.apple.videotoolbox.videoencoder.jpeg";
    EncoderName = "Apple JPEG";
    PerformanceRating = "-10";
},
{
    CodecName = JPEG;
    CodecType = 1785750887;
    DisplayName = "JPEG (HW)";
    EncoderID = "com.apple.videotoolbox.videoencoder.jpeg.ajpeg";
    EncoderName = "JPEG (HW)";
    IsHardwareAccelerated = 1;
},
{
    CodecName = "Muxed Alpha";
    CodecType = 1836415073;
    DisplayName = "Apple Muxed Alpha";
    EncoderID = "com.apple.videotoolbox.videoencoder.hevc-with-alpha:com.apple.videotoolbox.videoencoder.hevc.vcp";
    EncoderName = "Apple Muxed Alpha";
    PerformanceRating = 0;
    QualityRating = 100;
    SupportedSelectionProperties =     {
        ProfileLevel =         (
            "HEVC_Main_AutoLevel",
            "HEVC_Main10_AutoLevel"
        );
    };
},
{
    CodecName = "Muxed Alpha";
    CodecType = 1836415073;
    DisplayName = "Apple Muxed Alpha";
    EncoderID = "com.apple.videotoolbox.videoencoder.hevc-with-alpha:com.apple.videotoolbox.videoencoder.ave.hevc";
    EncoderName = "Apple Muxed Alpha";
    IsHardwareAccelerated = 1;
    PerformanceRating = 400;
    QualityRating = 90;
    SupportedSelectionProperties =     {
        ProfileLevel =         (
            "HEVC_Main_AutoLevel",
            "HEVC_Main10_AutoLevel"
        );
    };
},
{
    CodecName = "Muxed Alpha";
    CodecType = 1836415073;
    DisplayName = "Apple Muxed Alpha";
    EncoderID = "com.apple.videotoolbox.videoencoder.hevc-with-alpha:com.apple.videotoolbox.videoencoder.hevc.gva";
    EncoderName = "Apple Muxed Alpha";
    IsHardwareAccelerated = 1;
}

自分が前に利用していたエンコーダーは com.apple.videotoolbox.videoencoder.h264.gvaだったが、リストに存在しない。どうやら、com.apple.videotoolbox.videoencoder.ave.avcに名前が変わった模様。

ここらへんをちゃんと見ておかないと、VTCompressionSessionCreate周りで OSStatus -12908 のエラーが返る。

というわけで、こいつを直してビルドしなおしたら正しくCompressionSessionが作成できた。

感想:
前の記事をメモ代わりにでも書いておいて本当によかった…。Appleが今回行ったアーキテクチャの仕様変更はビデオ系やハードウェア系のアプリケーションやフレームワークはかなり対応が迫られると思う。特にドライバー系はkext廃止の流れを受けてかなり厳しそう…。

Apple系のデベロッパーの人は頑張ってまいりましょう。それじゃHappy Hacking.

0
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?